#multiplayer

1 messages ยท Page 466 of 1

potent prairie
#

@winged badger whats the difference between starting new player and on post login? When to use one over the other?

urban dew
#

if you put your cursor over it, it tells you, i cant remember which is which

#

but one is when they have a controller asigned

winged badger
#

you can't override engine implementation of PostLogin from BP

#

you can HandleStartingNewPlayer

#

HandleStartingNewPlayer is called after PostLogin and after SeamlessTravel

#

PostLogin is not called after seamless travel

#

HandleSeamlessTravelPlayer is called instead

elfin veldt
#

I uh, I'm trying to create a lock-on the continuously get's the opponent's location and rotates the camera to follow it

#

atm I have this

#

My issue is that player 2 is locked onto their own location, and it's only their initial location, player one is also only locked on to the initial location

#

I also realized there was a little bit of redundancy in the blueprint before so it's now only two custom events

main halo
#

It's a bit hard to tell what's going on, but the LockOn event needs to replace "Opponent location" with"Get actor location" of the "player pawn".

hushed loom
#

Can i use a mysql database for Matchmaking?

elfin veldt
#

@main halo what if I get rid of the variable and combine the two events?

#

the opponent location event was redundant so I removed it

main halo
#

So that the logic in "set player pawn" is included in "Lock On"? No, getting the player array and looping it is unnecessary to do. Is this like a 2d fighting game? The characters will always have the other "locked on", or can the player choose the target, somehow?

elfin veldt
#

well it's a fighting game, just not 2d

#

think of the naruto games

#

probably the easiest way to explain it

#

oh, or devil may cry

#

and yeah it's only 2 players

#

but I don't know if I want them to always be locked on

#

I'll figure that out later, just trying to get all the core systems working for now.

#

wry.

main halo
#

Okay, so what you want to do is to setup the logic for the characters to set their target - the opponent in one event. Honestly, I would just use tab or something - that can be replaced later. So pressing Tab - the opponent is selected as a target.
Then, during the lockOn event, get the target actor location.

winged badger
#

i'd just set the Target pointers at the time of spawning them and mark them replicated

#

this is ridiculously convoluted

elfin veldt
#

I'm ridiculously convoluted.

#

Anywho, how might I go about that?

winged badger
#

2 players and no intention of ever being more?

elfin veldt
#

I mean

#

In the future I had hoped to increase it but I'm sure I can burn that bridge when I get to it

winged badger
#

you add a team variable to your PlayerState

#

integer, name, color doesn't matter as long as it varies by team

#

you have a pointer (or array of them for 2+ players) of enemy players in whatever class it fits most naturaly, APlayerCameraManager perhaps

#

it queries the GameState, gets its PlayerArray and adds the pointers to the Pawns that don't have the same team ID

#

now you have an easily accessible array of enemies

#

you can implement GetTargetedEnemy() function that in 2 players just returns the first element in the enemy array

#

in more then 2 you can do things like InputKeyTab->Increment Target Index-> TargetIndex = TargetIndex % NumberOfEnemies and have the GetTargetEnemy() return EnemyArray[TargetIndex], works with just 2 players just fine

#

as those are Actor poitners, GetActorLocation returns their current location at all times

elfin veldt
#

Gotta admit, I'm a little confused.

#

okay, I'm just green.

winged badger
#

well, good luck deciphering it, i am off to bed

elfin veldt
#

lol, g'night, and thank you

twin juniper
#

@elfin veldt my man is bringing up naruto games as an example when he can just say mortal kombat

#

what a champ

elfin veldt
#

lmfao

#

fair enough

fleet raven
#

how do you guys handle replicating visual side effects of players operating their weapons to other players? such as anim montages being triggered on the weapon or the player, or particle effects, or sounds

grizzled stirrup
#

RepNotify int to trigger muzzleflash / gunshot start sound / firing anim montage

#

Then in my case I can replicate a single repnotify vector (either blocking hit impact point or trace end) and then the remote clients can create the beam fx / impact fx themselves

worthy perch
#

Why not just use anim notifies?

#

If you already replicate/RPC the Anim to play.

grizzled stirrup
#

Because my anims aren't tied to the weapon / fx they should play

#

I mean I could fire a generic notify

#

And have the weapon play fx through that

#

But it's easier to just do it explicitly in the weap I find

worthy perch
#

Are your weapons their own class?

grizzled stirrup
#

yeah

#

It's the same amount of data sent though anyway (an int). Either the onrep triggers only the anim montage and the anim calls the weap fx or I just call them all together

#

It shouldn't make a difference

grizzled stirrup
#

Is there a reason UnrealTournament stores health as an int32 but most examples (including ShooterGame) use floats?

#

I guess cheaper to replicate and doesn't need the accuracy of a float?

supple crypt
#

what class handles spawning? (looking to make 1st player spawn at x and 2nd at y .. ect)

grizzled stirrup
#

@supple crypt the world handles it GetWorld()->SpawnActor<ClassToSpawn>();

supple crypt
#

What I mean in a multiplayer game what class is handeling the spawning gamemode, playercontroller as example

nocturne dove
#

ok i got a question

grizzled stirrup
#

Ah for players, usually the gamemode would spawn them

#

At least that's how I do it

nocturne dove
#

so im working on a project with @magic harness and was wondering if there was a short term thing using a extra pc for back end

grizzled stirrup
#

On post login, I have a ref to the controller so the GM can decide what / where to spawn

nocturne dove
#

that maybe we could use for testing features in game

plush granite
#

I cant override Online Subsystem in DefaultEngine.ini, and according to the documentation, this is the order of the configuration hierarchy, with values in later files in the hierarchy overriding earlier values:

  1. Engine/Config/Base.ini
  2. Engine/Config/BaseEngine.ini
  3. Engine/Config/[Platform]/[Platform]Engine.ini
  4. [ProjectDirectory]/Config/DefaultEngine.ini
  5. [ProjectDirectory]/Config/[Platform]/[Platform]Engine.ini
  6. [ProjectDirectory]/Saved/Config/[Platform]/Engine.ini

Therefore if I add this to [ProjectDirectory]/Config/DefaultEngine.ini,

DefaultPlatformService=Null```

The resulting default platform online subsystem service should be Null, but its not.

???
covert ember
#

What's the best way to replicate Projectiles from the client using BP?

onyx gale
#

Does anyone know how to run and set up the dedicated server for the ShooterGame project?

plush granite
#

Yes

hoary sandal
#

Hi guys I been using unreal for a bit now I wanted to jump into learning how multiplayer works do you guys know of any series that is worth watching for this ? and also is there a place like gumroad(a site for professional artists to sell their products/ tutorials) for blueprints?

distant talon
#

Is there a way to get a timestamp from when a specific client joined in any of the native stuff?

#

(say, from their pawn or controller or state)

real yacht
#

can someone explain me, what is difference between this, and if i change myEvent to Run On Server?

#

how i see, there is no difference, i have same result in both cases

fossil spoke
#

Run On Server means that the Event will be called by the Server.

#

By way of an RPC

#

Since your already gating it behind an Switch Has Authority (which will typically mean the Server) you will not see a difference.

real yacht
#

so at the end, that can be same thing?

potent prairie
#

theyre not the same thing, no

#

its really just a macro

#

if you double click it you can see what it does

#

and make your own if u wanted to

real yacht
#

okay, i understand it's not a same thing but result at the end is similar?

potent prairie
#

yeah usually like he said means the server

real yacht
#

cool, thnx

wheat eagle
#

hey guys how can I use tags for dedicated servers so the player can search servers with specific gamemode? I'm using advanced sessions plugin

lone vapor
#

Unrelated to the above question (sorry):
Aside from using "Advanced Sessions" plugin's "Extra Settings" function, is there an easy way to set the server name in blueprint with just a variable?
I tried this (passing a variable through upon creation and then text binding it to the variable in the ServerList BP) but it doesn't work (null). Assumedly some sort of "X doesn't exist on Y" issue.

blazing folio
#

Hello, I have another unrelated question :)

How reliable is the "ownership" in RPCs? Let's say I have Suicide server-only function on a PlayerController, can the attacker fake the RPC call for other PCs or will the network layer figure out it's fake? I wonder how does Unreal do "authentication" for RPCs, I guess an open TCP connection could work for reliable messages, but then unreliable messages could be spoofed? I'm trying to figure out just what I can expect from the network layer.

winged badger
#

it cant

#

you don't have other clients PCs

#

and even if you somehow managed to fake one, server wouldn't assign them a NetGUID

chrome bay
#

yeah exactly. server-side would reject it anyway if it doesn't think that client owns the object

#

and the server decides who owns what btw, setting the owner client-side won't do anything

blazing folio
#

And how does the server know that? RPCs have some sort of envelope that could be faked, unless it contains some auth info.

chrome bay
#

because the server determines who owns what

winged badger
#

that envelope does contain a GUID

chrome bay
#

it won't accept an RPC from a client if the server doesn't see the client as the owner

winged badger
#

which you don't know if you don't own the PC as far as server is concerned

chrome bay
#

also, GUID's are unique to each connection

blazing folio
#

ok, I see. so GUID gets established when a client first connects to a server

winged badger
#

only way you could expose yourself to such an attack

#

is by setting bOnlyRelevantToOwner = false on the PC

chrome bay
#

even then it wouldn't work

winged badger
#

yeah, the connection wouldn't match

blazing folio
#

well, if the traffic is unencrypted and you're sitting on a network element, you can collect GUIDs from passing packets

winged badger
#

you can if you're sitting next to the server

chrome bay
#

GUID's are unique to each connection, so unless your sniffing between the wall socket and the server, you can't get the GUID's used for other connections

#

Actor A might have NetGUID 'X' for Client A, but NetGUID 'Y' for Client B

#

As a client you have no way of finding out

blazing folio
#

It's a long way between the wall socket and the server ๐Ÿ˜‰ Or if your player is on a free-wifi he's essentially giving up his traffic for free. But yeah, spoofing GUID would need more deliberate attempts than just downloading a cheat program. Thank you both for the answers

wheat eagle
#

Hey guys simple question: How do you modify the extra settings of a session in advanced sessions plugin? I cannot even get a reference to the session I'm in.

#

I'm trying to change the extra sessions whenever a new player joins

thin stratus
#

There should be an UpdateSession node

wheat eagle
#

@thin stratus hm.. I tried running this node on game mode blueprint but I'm given this error even though I'm 100% sure I'm in a session

#

any idea why?

modern swift
#

hi all, anyone know where can download examples and get resource for replication graph

#

seems their documentation is not in details

fluid flower
#

@thin stratus Does update session work to update number of players in server?

#

My lobby session never updates number of players, perhaps this could be a solution

thin stratus
#

That happens automatically usually

fluid flower
#

I see, it does happen for dedicated servers, but not for my player hosted ones

#

I was wondering if I'm missing some call somewhere

twin vault
#

Is bAllowJoinInProgress working? If i set it to false players can never join, what does it count as "In Progress"? after StartMatch?

#

i guess i will use steam's SetLobbyJoinable() for now

thin stratus
#

I think it counts as In Progress once you start the session?

lime skiff
#

@plush granite What do you mean it should be null? If you set it to Null, the base class is used as far as I understand.

plush granite
#

base class?

#

Are you familiar with Online Subsystems?

lime skiff
#

@plush granite What do you mean with "the resulting default platform online subsystem service should be Null"?

plush granite
#

So there are a bunch of Online Subsystems Modules

OnlineSubsystemFacebook
OnlineSubsystemGooglePlay
OnlineSubsystemIOS
OnlineSubsystemSteam
OnlineSubsystemAmazon
OnlineSubsystemGoogle
OnlineSubsystemOculus
OnlineSubsystemTwitch
OnlineSubsystemNull

The game will load the OnlineSubsystem specified in

DefaultPlatformService=<HERE>```

@lime skiff
#

So therefore if I write

DefaultPlatformService=Null```

in [ProjectFolder]/Config/DefaultEngine.ini

It should set the DefaultPlatformService to OnlineSubsystemNull
but it does not.
#

I've verified this by dumping the GEngineIni config at runtime

twin juniper
#

@plush granite did you update your PublicDependencyModuleNames thingy in your build.cs file?

plush granite
#

No, I dont think it matters?

twin juniper
#

sure it does

plush granite
#

How

twin juniper
#

if u want to use the online subsystem

#

you have to tell it

#

its not there by default

plush granite
#

the online subsystem is loaded by default

twin juniper
#

no its not

plush granite
#

yea it is

#

OnlineSubsystemNull ?

twin juniper
#

I mean, I might be wrong of course

#

but its worth a shot

plush granite
#

pretty sure youre wrong

twin juniper
#

well it works for me

#

but not for you

#

so

plush granite
#

Well

twin juniper
#

it aint black magic

plush granite
#

What platforms are you targetting?

twin juniper
#

using Null

plush granite
#

platforms I mean

#

Like windows / mac / ios / android

twin juniper
#

I havent done any platform specific code

plush granite
#

What operating systems does your project support

twin juniper
#

Whatever the default is, since I havent changed anything in regards to that

plush granite
#

Did you change the DefaultPlatformService in DefaultEngine.ini ?

twin juniper
#

To Null yes

#

[OnlineSubsystem]
DefaultPlatformService=Null

#

Either way, the stuff in the build.cs is the only difference I can see between urs and mine

#

so was worth noting

plush granite
#

Is there a reason you changed the DefaultPlatformService? Did you change it because it was something you didnt want it to be?

twin juniper
#

No its just that before I headed into using steam, I wanted to test out the Null one

#

Both worked

plush granite
#

im gonna give what you said a try

#

but i think ive already tried it

#

i hope you're right xD

grizzled stirrup
#

In ShooterGame when a weapon is unequipped, they simply detach it in place and call SetHiddenInGame on the weapon mesh, it works great but how does it manage to not collide with anything or otherwise interrupt gameplay if it's only being hidden in place?

#

For example, I had a weapon that had a light attached, and the light of course stays active, so it's just a light floating in space until re-equipped

#

Of course it's trivial to also hide the light, but I wonder if this is the way most games do unequipping?

#

Trying to find if SetHiddenInGame actually affects collision too which would make sense- then the unequipped weapon truly wouldn't accidently absorb bullets or block pathways

grand kestrel
#

Hidden in game doesn't affect collision, you can disable it yourself if you feel the need to. Shooter game is a very bare example I wouldn't follow it closely, just use it to see how they did certain things then do them the way you think they should be done

grizzled stirrup
#

Ok thanks!

#

I guess I never accidently bumped into the weapons then

#

Scares me to think of loads of hidden items floating in space around the map ๐Ÿ˜„

#

Will make sure to disable collision on them too or move them to a point outside the map when detaching

grand kestrel
#

Just do SetActorEnableCollision(false)

grizzled stirrup
#

Perfect!

grand kestrel
#

Iirc they do indeed block projectiles so it's definitely needed

grizzled stirrup
#

Ah yeah they ignore collision on the mesh other than traces and projectiles

#

thanks!!

grand kestrel
#

Np

grizzled stirrup
#

For a health component, since it doesn't have the concept of a role and using GetOwnerRole() == ROLE_Authority returns false for clients, would it be the best option to instead of setting replicated health values on begin play within the component, to move those to a function and have the owning client actor call them on the server?

#

Or is there some other way to check if on the server's version of a component?

#

Maybe GetOwner()->GetRemoteRole() == ROLE_Authority

#

But that would then return false if the listen server host

#

Would RemoteRole in the case of a listen server client case always be the server?

#

Looks like the CMC does something like this CharacterOwner->Role == ROLE_Authority. Ah I guess GetOwner()->Role == ROLE_Authority works fine!

unreal pine
twin juniper
#

Anything from the hogwarts to westeros could be causing the jitter

#

welcome to multiplayer

unreal pine
#

sick ๐Ÿค™

#

thanks

grizzled stirrup
#

It looks like you just have a mismatch in values between the server and client

#

i.e. you are setting your movement speed differently on the client and it's constantly being corrected

twin juniper
#

Didnt you run into an issue where your values were not mismatched, yet didnt work on listen servers

#

cuz cpc crap

#

Kyle

grizzled stirrup
#

you mean the no interp between moves?

#

And also no anim interp between net updates?

twin juniper
#

The first part

#

The CMC is suppose to do that shit, but it wasnt?

grizzled stirrup
#

Yeah, it seems it does it in every other scenario

#

But not for listen server hosts

twin juniper
#

How did you solve that?

grizzled stirrup
#

I've scoured the internet and most of Epic's responses are, it's hard to solve or not a priority atm

#

You can solve it by:

#

Well basically solving it correctly would mean doing your own interp in a modified CMC

#

I'm too dumb for that

#

But if you have a low player game and bandwidth to spare you can increase the client send rate and also disable move combining

twin juniper
#

It seems really fucking weird that its not a priority? it basically means making a multiplayer game without dedicated servers is not ideal at all

grizzled stirrup
#

Yep

#

Many forum posts complaining about it

#

Best to submit a bug report to show Epic that it'd be of use

#

Honestly seeing how they do it in every other case it seems trivial

#

Blend from last update and extrapolate if the next update is late

#

I am guessing they just had more important things to focus on

twin juniper
#

like fortnite?

grizzled stirrup
#

Yep

twin juniper
#

yeah

#

probably got 90% of their staff on that shit

#

even the janitors are pitching in

grizzled stirrup
#

What someone said before would be great- having dedicated servers automatically being created behind the scenes even playing in a listen setting

#

That'd mean all multiplayer sessions would work the same

#

And there wouldn't be these weird edge cases

twin juniper
#

Hold up though

#

If you want an object, that is not a character to move on the server

#

like say...

#

just a regular actor, thats like an airplane

#

you'd need to interp that shit by urself

#

no?

grizzled stirrup
#

Yes

twin juniper
#

or perhaps the better solution is to just

#

make it into a character

grizzled stirrup
#

CMC does a lot of amazing stuff

#

But it's bloated

#

With the power comes great bloat

twin juniper
#

cmc is flawed up the anus

grizzled stirrup
#

I'd love a really lightweight movement comp

#

With super clean basic interp

twin juniper
#

and the option to use any of the other collision components

unreal pine
#

I'm probably out of my element here, but what's cmc?

twin juniper
#

character movement component

unreal pine
#

ah

#

lol

twin juniper
#

Divo here is probably thinking we are some mad geniuses talking about complicated networking

unreal pine
#

well when you said CPC I was like... is that some sorta procedure call that's different from an RPC?

#

haha

twin juniper
#

no one ever said cpc

#

it was cmc ๐Ÿ˜„

unreal pine
twin juniper
#

clearly photoshopped

unreal pine
twin juniper
#

@grizzled stirrup there is a udemy course that I think teaches intern in ue4 c++ in detail

#

they do it with a car that is a pawn

#

interp
*

grizzled stirrup
#

Yeah but I don't trust that guy at all haha

twin juniper
#

sam?

grizzled stirrup
#

He has good knowledge but almost 0 XP with UE4

#

YEah

twin juniper
#

yeah but

#

the courses are prepared and tested beforehand

#

so Im sure it works

grizzled stirrup
#

So the things they are teaching often is not the way Epic or a dev used to working with the engine would do it.

#

Yeah it probably does

#

I'd just always favor something like the tom looman course which is full of really good examples

#

But yeah no interp

twin juniper
#

tom loomans "multiplayer" course

#

is basic

#

and pretty much crap

#

I mean

grizzled stirrup
#

It's basic but he does things the "right" way in terms of how Epic do things

twin juniper
#

jus the multiplayer aspect

#

yeah... but

#

he barely dives into anything

#

where is the real useful stuff

#

Also

#

I think the Sam course is epic approved

#

no?

#

I know most of their stuff is

grizzled stirrup
#

I did the whole Sam course and it's good but he stops basically at the edge of a cliff and never ties things up

twin juniper
#

Yeah... and the steam course is sooooo basic

#

doenst go into anything

grizzled stirrup
#

Yeah

#

It's rare to find any good info

#

The best place would be honestly the CMC source and and extract what you can

#

or UT code

twin juniper
#

Are you going to be using steam

#

?

grizzled stirrup
#

Yes

twin juniper
#

Have you considered the advanced steam session?

grizzled stirrup
#

No but I heard it's good

twin juniper
#

is it c++ or blueprint

grizzled stirrup
#

c++

#

But there's BP hooks

twin juniper
#

yeah

grizzled stirrup
#

you don't need C++

twin juniper
#

also 111 euros

#

jesus

#

looks like its just steam party though

chilly mist
#

In blueprint, I have a multicast RPC with a breakpoint on it. It triggers only once. But if I attach a Print String node at the RPC function, it says:
Client1: Hello
Server: Hello
So breakpoint in blueprint editor only trigger once, even if the RPC is called on multiple clients?

twin juniper
#

The server wouldnt trigger the rpc would it?

chilly mist
#

It's a listen server

twin juniper
#

ah

hoary sandal
#

hey @grizzled stirrup and @twin juniper I was reading your conversation I'm currently going over the steam integration series from epic what do you guys recommend after that to understand more of the multiplayer aspect?

twin juniper
#

What steam integration series are you refering to? @hoary sandal

hoary sandal
twin juniper
#

One thing you could do is download the free advanced steam session plugin

#

Its all blueprints

#

And try to study it

hoary sandal
#

@twin juniper cool thanks also @grizzled stirrup mentioned these two sites called UT and CMC but when I do I search on those I get a lot of results that have nothing to do with unreal, could you give me more details to find them?

grizzled stirrup
#

character movement component and unreal tournament

#

Two good code sources to learn from

hoary sandal
#

oh my bad I thought those were sites, yeah I'll definitely have a look at unreal tournament, what is the thing that is good to learn from the character movement when It comes to multiplayer that got me a bit confused

grizzled stirrup
#

Honestly unless you are having specific interp problems you should be able to just use it

#

You shouldn't need to read it / know how it works ideally

hoary sandal
#

no no what I meant to say is that I failed to see the connection or how are these two related

grizzled stirrup
#

Oh they are just two good sources of interp code

hoary sandal
#

is it because I need to understand locomotion in a multiplayer environment?

grizzled stirrup
#

They have elegant solutions to interpolating characters and objects around

#

So that everything appears smooth from all perspectives

potent prairie
#

Yeah I can confirm when I try playing on a dedicated server with default movement component, there will be little hitches and such when moving forward or tapping sprint over and over and stuff like that

#

its one of those things I only really noticed when I set up my own ded server. It won't hitch around if I'm doing a local server

copper mango
#

well, to get sprinting to work properly with character move component, I think you'd have to make it a custom saved move

#

if try just to change the speed locally and then RPC that change request to the server, it will not rollback properly if that's needed

#

sort of like how they switch to crouch mode

#

"The main issue is that if a client is corrected back in time to before the Teleport was triggered, that client won't know to retrigger the Teleport as they repeat their pending move list, and the Teleport will appear to have been lost on the client side. This will make the game feel unresponsive in certain cases, especially in bad network conditions."

#

replace teleport with sprinting and I think you'd basically have the same issue

#

cause say you have move 1, move 2, sprint, move 3...and let's say move 1 gets rejected, if sprint isn't a saved move, the rollback playback would be move 2, move 3, and there's no sprint in there

#

although the saved moves do save velocity, but I'm not sure that would quite work properly without also making sprint a move

thin stratus
#

The big problem with just changing speed from outside of the CMC is, that it won't happen on the same frame for everyone.
Means if the Client sets MaxWalkSpeed to 1000 (from 600) and sends an RPC to let the Server do the same, it is already async.

#

This might look smooth on a low ping, because the RPC didn't take long enough to violate the SQRT(3) limit.
But if you have a higher ping, then the client might move several frames with a higher movement speed.
Same goes for stopping the sprinting.

#

The SavedMove isn't even the big point here, of course it's required so that the Client knows it sprinted several moves back and can simulate that behavior.

#

However the actual big point is that the client needs to send the Sprinting as a MoveFlag to the Server, similar as to how Jumping is done.
That way, Server and Client will perform it in the same Timestamp.

thin stratus
#

Man, struggled through GameSparks + GameLift with barely any documentation to get a proper matchmaking service up and running.
GameSparks gets bought, changes pricing that sh*ts on indie devs.
Now I have to go through the same struggle with PlayFab and Azure. Why do all these services have barely any documentation and if they have it's outdated and no forum posts.

You think UE4 has shitty documentation? Even without the docs and the wiki we have a better documentation than these third party services >.>

#

"We support Windows and Linux builds. Just choose it when uploading your Game Server Build in the Container dropdown."
There is no Container Dropdown in the newest version of that page.

#

If anyone already went through the process of using PlayFab and it's internal Server System with Linux, let me know -.-*

ivory portal
#

Yeah, I just use Gamelift atm but it is also shit

#

a lot of documentation where they assume you know some small tiddbit but they never explain it

bitter oriole
#

MP isn't really beginner friendly

#

There is so much to learn, at some point documentation isn't the answer

#

Gafferongames etc are really good sources of general knowledge of MP

fossil spoke
#

@ivory portal Currently going through GameLift integration myself. This is exactly how I explained it to a colleague lol. Small important tiddbits that arent documented but stop you in your tracks until you work it out lol

thin stratus
#

@bitter oriole Is that related to my text?

#

@ivory portal @fossil spoke Yeah took me a while to get this working, but the documentation on the features etc. was still a lot better than what I face with PlayFab atm

#

Sadly it's my client's decision what service to use >.>

bitter oriole
#

I misread your comment as a "UE4 has no MP doc", Cedric

#

Well, "shitty"

fossil spoke
#

Yeah i have nothing to compare to with GameLift. The documentation is ok. Just those little things that could have saved alot of time messing around that really ended up being really small things

thin stratus
#

Na, I'm just annoyed at PlayFab :P @bitter oriole

bitter oriole
#

Yeah I see that now

thin stratus
#

@fossil spoke The thing that took the longest with GameLift was understanding their REST API cause it was just opened up when I was using it

#

The UE4 integration as well as the Build Upload process is relatively okay

#

+- the Install.bat stuff, but it's kinda logical that UE4 needs some preinstalled stuff to work

fossil spoke
#

Yeah that stuffs ok.

#

Im using the C++ API directly

thin stratus
#

Second thing that threw me off was the missing certificate not allowing communication with GameSparks >.>

#

The Client one?

#

I tried making my own plugin as that didn't exist 1-2 years ago. But only for a small prototype for a client.

fossil spoke
#

Yeah its not as bad as i thought once you get your head around it

#

Its probably alot better now than back then

ivory portal
#

I even just stopped integrating myself and just started using a plugin from the marketplace. Sometimes I code my own stuff a bit but at the moment the plugin does most of the integration

fossil spoke
#

I took a look at one of the plugins that was about but it wasnt as well put together as id have liked. I ended up just goivg with my own integration

thin stratus
#

If you are just using C++, you can use their SDK and that's it.

#

The Plugins are only really relevant if you are doing BP work

fossil spoke
#

Yeah pretty much.

keen thorn
#

anyone here done networked physics (simple physics) and got any tips or links, thanks :D

chrome bay
#

yep

#

pro tip, do client-auth, and implement good anti-cheat

keen thorn
#

i saw a video of how rocket league did their netcode, but need some guidance on how to do their client prediction with physics

#

since rocket league use ue3

chrome bay
#

rocket league has an extremely specific setup that lets them do it

#

there is no generic implementation for client-predicted physics

keen thorn
#

also overwatch did similar style

chrome bay
#

It's a losing battle and a problem that hasn't been solved since the 90's

keen thorn
#

hmm

chrome bay
#

fortnite uses client-auth for all it's vehicles

#

character movement does client prediction, because it's kinematic

keen thorn
#

do u have good doc on a client auth model?

meager spade
#

vehicles are not simulated?

keen thorn
#

like how to anti cheat in client auth

chrome bay
#

it's an unsolvable problem, unless you have a very limited use of physics like rocket league does and can afford to rewind/replay the entire simulation

meager spade
#

the client just tells the server hey im here, and client goes ok, i believe you?

keen thorn
#

and also how to do prediction for other clients...

chrome bay
#

no idea. Epic didn't go into specific details when I asked them about the anti cheat

meager spade
#

server*

chrome bay
#

for obvious reasons anyone who has implemented good anti-cheat doesn't talk about it

keen thorn
#

:( secrets hmm

meager spade
#

then again i have never seen rubber banding whilst on a vehicle

#

but i have whilst running

keen thorn
#

i guess ure right, this is a lost battle, just gotta find something that works...

chrome bay
#

fortnite is 100% client auth vehicle physics. The FPhysicsReplication system smooths out a lot of the bumps for remote players, but it's confirmed

keen thorn
#

but i thought ue4 physics is not deterministic

#

or is it

chrome bay
#

it's not

thin stratus
#

Hehe

chrome bay
#

๐Ÿ˜„

#

basic client-auth physics means sending physics state to the server, and server sending that state to all clients

meager spade
#

the server can do some basic validty checks

chrome bay
#

yeah. thing is anyone who has done good anti-cheat isn't going to talk about it, that would defeat the point ๐Ÿ˜„

keen thorn
#

oh i just did a lookup, the FPhysicsReplication does some snapping so stuff become more deterministic in sync... is it right

meager spade
#

ie if you moved 10000 units in .1 second your clearly doing something bad

#

๐Ÿ˜„

chrome bay
#

there's no determinism, it's just updating the physics scene with the latest available update from the server

#

it utterly sucks I'm not going to lie

meager spade
#

networked physics is a nightmare

keen thorn
#

i guess these day they anti cheat my smpling, since a cheater will keep cheating, missing out 1-2 cheats wont hurt

chrome bay
#

but unfortunately there's just no way to simulate an object within the context of a physics scene without updating the rest of the scene too

#

So the only way is to change the entire scene and save it's state

#

and rollback/forward as required

#

In an ideal world, you would be able to simulate an individual object in the scene, and accumulate contact resolution/forces against other objects and apply at your discretion

#

But that kind of defeats the point of a physics engine

keen thorn
#

is there bullet physics plugin for ue4 :p

#

dont wanna do the physics coding

thin stratus
#

What I always wondered, isn't that the same problem you'd run into if you replay the CMC movement and in the meantime there is a block between where the char started and where it is now?

chrome bay
#

yeah exactly the same

#

there's not really anything you can do about it

#

CMC has the advantage of being relatively simple movement / shape etc

#

I've done kinematic movement for vehicles

#

Anything with an even remotely complex shape becomes a nightmare for collision resolution

keen thorn
#

@thin stratus it will be adjusted at some point later

thin stratus
#

The only way you can simulate this is indeed putting everything that is simulated (physics or not) into a bucket

chrome bay
#

this very issue is the bane of my existence

thin stratus
#

And having all of them react to the world being rewinded

#

As in, you'd basically need to, at all times, recreate the whole game scene from a timestamp

#

Every single object has to have a state saved for that

#

Physics alone might not even be enough or? Cause non-physics stuff could be spawned in the meantime

chrome bay
#

yeah that's why characters still go a bit crazy when two laggy players walk into each other

keen thorn
#

rocket league save state for all vehicles, and replay physics for all...

thin stratus
#

Yeah but that's basically all they have

#

The arena isn't changing

chrome bay
#

yeah but rocket league only ever has a maximum of nine physics objects, so it's easy

thin stratus
#

Neither are the powerups

#

Correct

chrome bay
#

no articulations or joints either

#

which makes things even more complicated

keen thorn
#

certainly much simplified scene yes

#

full networked physics i dont think is ever possible with player input

chrome bay
#

not without deterministic lockstep.. which in a modern world isn't gonna happen ๐Ÿ˜ฆ

keen thorn
#

unless we break speed of light

chrome bay
#

pretty much. when the internet is one big lan connection we'll be fine ๐Ÿ˜„

keen thorn
#

lol thats far fetched

#

maybe with elon's starlink...

chrome bay
#

I'm hoping the upcoming physics engine at least gives us the option to move objects independently of the rest of the scene, but somehow I doubt it will

keen thorn
#

they did say it worked over network

#

so lets see how much of it does

chrome bay
#

yeah so far they're only talking about destruction, which is a bit annoying.. but i guess it's a good marketing appetiser

keen thorn
#

they said it was made with networking in mind, in one of their more detailed talks, but did not talk much on how

#

so much secret

manic pine
#

is there even a theoretical way of making a good networked implementation

#

(for general purposes)

chrome bay
#

not really. I've tried it so many times. The best approach I think you could hope for is to create an immediatte physics scene for each object, and copy main scene data into it, run the immediatte sim then copy back to the main scene

#

I started on that, then when articulations and such became involved it became a total cluster of pain

#

A generic client-auth implementation is straight forward enough I would say

#

Hell I have that already, just without the anti-cheat part

manic pine
#

hmm even that sounds messy

#

with prediction on remote clients

chrome bay
#

yeah it really is... also there's the question of what does the server do while it's waiting for client packets

#

just re-sim with old inputs probably and round them down to zero over time, but the desync server-side would be awful I expect

#

lot's of tuning still required depending on the game

manic pine
#

yeah i mean for purely cosmetic purposes we could do a fixed timestep thing across all sims

chrome bay
#

at least if we could simulate objects individually in the primary scene and accumulate forces and contacts, you wouldn't need to copy soooo much data around

thin stratus
#

So games like Human Fall Flat are all client auth?

chrome bay
#

it'll still have some issues with contact between player-controlled objects - but it'd be an acceptable starting point I feel

thin stratus
#

How do they go around the sim problem?

chrome bay
#

googles

#

wtf

manic pine
#

hmm havent seen it

#

looks hilarious

thin stratus
#

It's basically a 3D "puzzle" game

#

Where everything is physics based

#

Or they just don't care about lag xD

manic pine
#

hard to say how well the MP stuff works without actually playign the game though

#

watching trailers or gameplay isnt all that telling usually

thin stratus
#

If you see multiple minutes/hours of coop gameplay, it's really not broken

#

Which you'd expect it to be

#

Same with something like Gang Beasts

manic pine
#

engine?

thin stratus
#

Although they have sync problems iirc

#

Unity for Gang beasts

#

No idea about fall flat atm

#

Apparently also Unity

manic pine
#

that does look quite well implemented

#

oh, seems like it skips lag compensation entirely

#

send input to server, wait for result

chrome bay
#

probably deterministic lockstep maybe

#

lot's of RTS's and such still using that kind of thing

#

but yeah the caveat is the huge input lag usually

manic pine
#

i think it just sends everything...

#

prolly just some mild interpolation on clients

#

yeah

#
The work was all about optimisation, particularly compressing the stream of information that would synchronise the state of the world for each connected player. He read Glenn Fiedlerโ€™s Gaffer On Games blog for generic tricks that reduced the information needed to describe the rotation of objects. He reduced the amount of shards and rubble that glass and walls would shatter into. And he really needed to fiddle around with how objects sleep.
#

so hes not running anything on the clients

potent prairie
#

fortnite's anti-cheat is a joke, i think anti-cheat is really just a lost cause cause people will always find a way to cheat

bitter oriole
#

Modern anti-cheat relies on actual anti-cheat, a good server architecture, a report and ban system

#

No such thing as just one anticheat software

#

It's not a lost cause - CS Go has has great success at combating cheating, and they basically guarantee that regular players never see a cheater

#

Of course it's a huge amount of work

chrome bay
#

yeah the report and ban part of anti cheat is probably the most effective bit I think

#

but you need so much support for it

bitter oriole
#

Yeah, Valve has a report -> jury -> ban loop that works very well, creates trust, and is the perfect foundation for deep learning

plush granite
#

Is there anyone who has experience with Online Subsystems? I'm can't override the online subsystem on iOS. Please anyone

#

I've been stuck on this for a week now

spark vessel
#

does any1 know how to create a custom launcher for a game?

#

I want to create a game for mac,linux and windows with opengl shaders

bitter oriole
#

Why do you need a launcher ?

#

Aren't you going to release your game on Steam, or Itch, or GOG or Epic or ... ?

spark vessel
#

idk, just want to make my game extra special?

bitter oriole
#

Special how ? What will your launcher do ?

spark vessel
#

just launch and maybe give some patch notes on the side

bitter oriole
#

Does it has to update your game too ?

#

Because a launcher that launches is like, 100% waste of time for you and players

#

Launchers exist to update games outside of Steam / etc

plush granite
#

So I think I found a bug in the way UE4 loads config files?

#

In the docs (Which last update was 4.9) https://docs.unrealengine.com/en-US/Programming/Basics/ConfigurationFiles/index.html
The file hierarchy for config files is wrong,
but its not only wrong for UE4 4.22.2, Its wrong for 4.9 too (the last time this page was updated)
If you take a look at

static void GetSourceIniHierarchyFilenames(const TCHAR* InBaseIniName, const TCHAR* InPlatformName, const TCHAR* EngineConfigDir, const TCHAR* SourceConfigDir, FConfigFileHierarchy& OutHierarchy, bool bRequireDefaultIni)```
in `UnrealEngine\Engine\Source\Runtime\Core\Private\Misc\ConfigCacheIni.cpp`
you will see that the file hierarchy is actually like this:
1. Engine/Config/Base.ini
2. Engine/Config/BaseEngine.ini
3. [ProjectDirectory]/Config/DefaultEngine.ini
4. Engine/Config/[Platform]/[Platform]Engine.ini
5. [ProjectDirectory]/Config/[Platform]/[Platform]Engine.ini
6. [ProjectDirectory]/Saved/Config/[Platform]/Engine.ini

So basically switching 3 with 4
#

so
[ProjectDirectory]/Config/DefaultEngine.ini
is going to get overwritten by
Engine/Config/[Platform]/[Platform]Engine.ini
Solved my problem! ๐Ÿ˜ƒ

stone sentinel
#

it looks cool!
I am doing a multiplayer game and I have a problem with synchronizing SERVER and CLIENT sides of Character, Controller and PlayerState.
Sometimes functions I have to be in the BeginPlay of the Character but after the PlayerState run into its BeginPlay. For this I am trying to Sync the three main classes of the player but the problem is that in Server side of the Character I cannot access the controller so my component (the SynchronizerComponent) cannot go in the Controller.
Do you have an object that is created before these three and can be accessible from the three of them Server and Client side?

onyx gale
#

Does anyone know how to set up multiplayer via HTML5? (WebSockets)

copper mango
#

@stone sentinel if I understand your question, Iโ€™d suggest putting it in Possess for authority and PawnClientRestart for clients, since youโ€™ll have access to the controller and the character at that point

#

In your character class, that is

winged badger
#

with c++ there are better options

#

OnRep_PlayerState, OnRep_Controller, SetPawn override

spark vessel
#

yeah, it will push new updates @bitter oriole

timid moss
#

guys can someone help me understand when this function gets called for the HUD class? I am having trouble understanding it. AHUD::DrawHUD

#

the api says this but I don't understand it "The Main Draw loop for the hud. Gets called before any messaging. Should be subclassed"

thick shale
#

@timid moss that function is going to be called every frame for your player, so any drawing you need to do would go in a subclass under that DrawHUD function

timid moss
#

@thick shale Ok. So then what is the difference between that and Tick is then? Whats so special about DrawHUD?

thick shale
#

DrawHUD will only happen locally for that player where Tick will be called in each world that actor is in

#

so all clients that see it, and the server will all run tick

timid moss
#

so what would be the advantage of using DrawHUD though?

#

if it helps on performance then I guess i just dont see how it does

thick shale
#

that it only runs for the current player, on their machine. So it makes it useful for cosmetic stuff like UI.
The server and all other clients dont have to worry about running anything in there

#

it would be a waste if everyone you were playing with also had to run UI code that only you would see

#

so thats where the performance benefit comes in

timid moss
#

ok i see now thats really cool! i thought the hud class only existed on the client though anyway.

thick shale
#

right, since it exists only on the client, and you know the DrawHUD function will run every frame, you can do all your UI stuff in there without having to worry about gating it to the local player

timid moss
#

but what i am confused about is since the hud class only exists on a client. Then even if you did use Tick instead it wouldnt matter right? because if you are a client you only have your HUD class that runs Tick and no one else's. And same for every other client. And the server wouldn't have any HUD class at all, so no unnessisary HUD class's tick wont run there either.

twin juniper
#

yeah I thought so too

#

but my HUD's begin play runs on the server

#

so I dunno anymore

timid moss
#

wut

#

my life is a lie. I saw this graph which made sense to me but now you just confused me

meager spade
#

HUD is local only

#

well technically

#

HUD is not replicated

#

and HUD does not tick on dedicated servers

#

playercontroller is server and owning client only

twin juniper
#

so if u'd want the hud to tick on dedicated servers

#

would you use playercontrollers SetHUD or whatever its called

#

override that one?

meager spade
#

why would you want it ticking on dedicated server?

#

its purely local and should not care for the server nor should the server care for it

twin juniper
#

but it does tick for every player right?

meager spade
#

no

twin juniper
#

well the thing is

meager spade
#

its local

#

its not replicated

twin juniper
#

In my HUD'S tick function, I have an if statement, which is true once a variable in game state is true, and that variable turns true once all players have finished loading into the map, so the timer starts at the same time for everyone

#

you saying this wont work?

meager spade
#

its local

#

its spawned when the player controller is created

#

if you want to do stuff when the game starts

#

bind it to the gamemode state changed or something to initialize the hud

#

gamestate*

twin juniper
#

As long as the player can access the game state from the huds tick

#

then its not an issue

meager spade
#

gamestate is replicated

#

so all clients have it

twin juniper
#

yup I understand now what you mean, was confused for a moment

#

Random question

#

If I have a fairly lightweight multiplayer game, for testing purposes, would it be fine to act as the dedicated server + play as the client

meager spade
#

sure

#

load the dedi up, and connect your client

twin juniper
#

Just asking because Im not sure if it would be skewed or something

red musk
#

Could anyone answer a quick question for me? I am using seamless travel to move multiple players to a new level, the game mode for that new level has Event Handle Starting New Player but this doesn't get triggered for each of the new clients, only the listen server

#

Anyone know why that is?

#

I have this RPC call trying to cause it to init the player controller on each of the clients

#

but only the listen server's client gets it successfully

#

It does successfully create call restart player on each controller, so the issue is with the owning client RPC it would seem

tribal solstice
#

Hey guys - I'm trying to setup a multiplayer game hosted by a PC, that mobile users can join. Is there anything I should be doing specifically to get this working properly or is it the same as any multiplayer setup? Would the only subsystem option be through IP?

copper mango
#

@lament cloak If you call SetActorLocation from the Server, then the location would get replicated just by normal property replication

#

but the client would report it likely as a misprediction, yeah

#

wait, but if you override RestartPlayer in GameMode then you could specify the starting spot there, and then it would just spawn at the correct location

#

rather than spawning it wherever and then setting the location immediatelya fter that

#

well, so the default implementation calls RestartPlayerAtPlayerStart, which does actually check if you already have a pawn

#

it only spawns a new pawn if there isn't already one

#

same thing if you instead call RestartPlayerAtTransform, I guess

#

sure, no problem

tribal solstice
#

To host a game that an Android will connect to, would it be best to use 'Create Session' or is there another method for opening an IP listen-server?

#

Or just an 'Open Level' node with 'listen'

copper mango
#

that is weird

tribal solstice
#

Is mobile multiplayer just undocumented and lacking in Unreal? Can't seem to find anything accept for lots of confused people wondering why it's so difficult.

copper mango
#

I think you should just be able to run a standalone build on your PC and then have the mobile device connect to the local IP, assuming the device is on your WiFi and your router forwards the ports

#

if the mobile device is gonna host the game, then I have no idea about that

chilly mist
#

But is it possible to replicate UObject, when their outer is Actor Component, which is owned by Actor?

copper mango
#

I haven't tried it, but I'd guess it would work as long as the actor, actor component, and uobject as a property are all set to replicate

#

because if an actor isn't replicated, then its components wouldn't be either

chilly mist
#

Will there be some extra setup required?
For example, in the guide I linked, there needs additional code to replicate UObject.

#

Also... How can I tell if it is or it is not replicating?
Is there a good way to test..? I'm just getting nullptr for the UObject now.

copper mango
#

I think you'd just a.) set bReplicates = true; in the Actor constructor then b.) call SetIsReplicated(true) on the component when you create it after spawning the component and then c.) in your ActorComponent you'd set that UPROPERTY as replicates. d.) implement GetLifetimeReplicatedProps in the ActorComponent

#

probably? I haven't tried it

#

one way to figure out if replication is happening is to declare a custom ReplicatedUsing function, cause then you could put a breakpoint in that function when it gets called to see if its replicating it

#

like

chilly mist
#

Yep, I'm using the ReplicatedUsing method. That should be a reliable way hopefully.

#

For UObject replication, the wiki said additional code like this is needed:

bool AReplicatedActor::ReplicateSubobjects(class UActorChannel *Channel, class FOutBunch *Bunch, FReplicationFlags *RepFlags)
{
    bool WroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);
    
    if (Subobject != nullptr)
    {
        WroteSomething |= Channel->ReplicateSubobject(Subobject, *Bunch, *RepFlags);
    }

    return WroteSomething;
}
#

I'm feeling really wonky doing this ๐Ÿ˜‚

copper mango
#

right but in this case the subobject isn't on the replicated actor, it's on the actor component, right?

chilly mist
#

Yes. And... Due to the gameplay, the subobject's outer can be changed from / to an Actor, or an Actor Component.

copper mango
#

well, ActorComponent also has a ReplicatedSubobjects function, so maybe if you did that?

#

what are you trying to do exactly, anyway?

chilly mist
#

I'm building an inventory system. I have a UItemInfo class which inherits from UObject.
It can either be set into an AItem Actor class if the item is out in the world, or be added into a UInventory Actor Component class if the item is picked up.

If Actor Component has a ReplicatedSubobjects function then it sounds like the missing piece.

#

I was also suggested to use a plain struct for Item Info.
But that seems to strip away its reflection features so I'm not too sure.

copper mango
#

would the CDO of the UItemInfo be enough, or like do you make different instances dynamically at run time with different potential properties?

chilly mist
#

UItemInfo has multiple subclasses for different "concrete" item classes.
Some subclasses have properties that change at run time.

#

I'm not familiar with CDO either ๐Ÿ˜‚

copper mango
#

ah, so like if all of the UItemInfos were strictly defined in the editor, you could just store TSubclassOf<UItemInfo> and then only need to replicate that, which wouldn't require anything fancy I don't think

#

but if the properties change at runtime and you could have like multiple instances of the same item with different properties, that wouldn't really work

#

CDO is the class default object, so it's like the template object that you can instantiate objects from at runtime

chilly mist
#

Yes.
I think properties change at run time. For example, a weapon item's damage can increase / decrease.

copper mango
#

yeah, so then you do need the actual unique instances

chilly mist
#

I think so.

#

It's describing my exact case omg

#

( Last sentence )

#

But it's not telling me how to implement all three methods

copper mango
#

I think that's talking about the Actor replicating a generic subobject, not the component

#

also I can't find that InstantiateReplicatorForSubObject function anywhere, don't think it exists anymore

#

OnSubobjectCreatedFromReplication is defined in AActor

chilly mist
#

Right.

#

So how can I find docs / tutorials / info on replicating subobjects in a component?
Especially that I'm replicating a TArray of subobjects ( the array of items ).

winged badger
#

basically

#

you look into Actor/ActorComponent source code after reading the tutorials that are surprisingly accurate this time around

#

"replicating subobjects unreal'

#

my buffs are UObjects, i keep them alive by tossing them into a non replicated array, i use struct inheriting from FFastArraySerializerItem that has a weak pointer to buff to manage them and client side callbacks to add/remove/modify them if needed

#

and they themselves replicate

chilly mist
#

Yeah... I didn't expect to need to study source code building inventory system.
It's a bit beyond my coding skill :()
But I'll try.

#

Oh wow that's so much information I haven't studied yet.

winged badger
#

the client side callbacks are more then a little handy

chilly mist
#

Keeping objects alive, serialization, weak pointer

winged badger
#
    void PreReplicatedRemove(const struct FMissionContainer& InArraySerializer);
    void PostReplicatedAdd(const struct FMissionContainer& InArraySerializer);
    void PostReplicatedChange(const struct FMissionContainer& InArraySerializer);
#
void FMissionStatus::PreReplicatedRemove(const struct FMissionContainer& InArraySerializer)
{
    InArraySerializer.Owner->HandleMissionRemoved(*this);
}
void FMissionStatus::PostReplicatedAdd(const struct FMissionContainer& InArraySerializer)
{
    InArraySerializer.Owner->HandleMissionAdded(*this);
}
void FMissionStatus::PostReplicatedChange(const struct FMissionContainer& InArraySerializer)
{
    InArraySerializer.Owner->HandleMissionUpdated(*this);
}
#

with normal replicated TArray, i'd have to back it up and compare to figure what got added/changed/removed

#

which is a pain in the arse

#

you can see a full example of implementing a FFastArraySerializer in NetSerialization.h header

chilly mist
#

I kinda see what you mean there.

#

It looks like a lot of custom engineering on your side. Do you know that it'll work from the start?
What if it's not possible at all?

winged badger
#

i was sure its possible before i started because... its how unreal network works

#

i generally dislike having a struct manage a lifetime of a UObject derived object instance

#

so weak pointer there was a no brainer

#

but with that setup i have to use an array to keep them alive

#

as nothing had a strong ref to those buffs

chilly mist
#

So the array is solely for the purpose of keeping objects alive?

#

And unnecessary otherwise?

winged badger
#

and i do access them for recalculation of attributes via that array as well

#

but

#

say my buff changed server side

#

i mark the struct managing it dirty

#

i get a postreplicatedchange callback client side

#

i call HandleBuffChanged from there

#

and i do have a pointer to the changed buff

#

i access the buff, i figure out what attributes its affecting

#

and i recalculate only those attributes

chilly mist
#

Owww I don't even know what dirty really is...

winged badger
#

i did run into a nasty caveat

#

my buffs and my BuffContainer are in an ActorComponent

#

and server side its constructing them, passing itself as Outer

#

but when they replicate the Actor owning the component is Outer

chilly mist
#

:()

#

I just want my inventory with a bunch of abstract item info object to work on a multiplayer ๐Ÿ˜ญ

winged badger
#

depending on what your items do, UOBject might be too heavy

#

my buffs handle the entire UX aside from just modifying attributes

#

and being able to wire custom logic to them in BP was a requirement

#

most inventories can get away with just structs

chilly mist
#

I do want my inventory system to be as versatile as possible.
So my UItemInfo has properties that change, has subclasses, has functions that'll spawn its Actor form, and has functions that duplicate itself.
I'd like it to be available in BP cuz who knows what I'll need later.

#

You mean, C++ struct and not UStruct?

winged badger
#

USTRUCT

chilly mist
#

Does UStruct support inheritance?

winged badger
#

here is a tip

#
virtual UWorld* GetWorld() const override;

UWorld* UItemInfo::GetWorld() const
{
    if (HasAnyFlags(RF_ClassDefaultObject)
    {
        return nullptor;
    }
    return IsValid(GetOuter()) ? GetOuter()->GetWorld() : nullptr;
}
chilly mist
#

This allows a UObject to Get World?

winged badger
#

they do, but their functions and operators aren't exposed to BP

#

GetOuter()->GetWorld() is undefined on a CDO

#

this allows you to call static functions in UObject derived BP

chilly mist
#

Oh, that seems to be handy ๐Ÿ˜ฎ

winged badger
#

basically

#

as soon as you right click in the BP event graph

#

unreal calls GetWorld() on the CDO

#

if that doesn't error out, even if it gets a NULL back

#

it lets you go on with functions requiring world context

chilly mist
#

Gotcha ๐Ÿ’ฏ

grim axle
#

Hey, trying to make a cross platform experience, where one player is VR and the other is on an iPad,
What is the right way to set this up, im opening a map as listen on the Host side, and connect <IP> for the client side,
The setup works fine in editor, but when i try to test it on iPad or Mac Editor with a Windows Editor host i get : TravelFailure LoadMapFailure

#

im expecting the experience to run on LAN

grim axle
#

anyone ?

copper mango
#

@grim axle is it that there's a map name mismatch?

#

the net connection will boot the clients if the map they're trying to load isn't loaded on the server

#

it becomes a problem if you're running through the editor, because it adds a PIE prefix to the map name

#

so for example if your editor thinks it loaded something with PIE and then your client on the other computer is trying to load the same level without the PIE prefix, it will kick you

#

most likely if you run the host in a standalone build, rather through the editor, it should fix that

#

if that's the problem, looking at the log more closely should verify it

#

I think the log message is "ServerUpdateLevelVisibility() ignored non-existant package..."

#

though I looked at the code again more closely and I guess as long as the package exists, it maybe is fine and won't kick you, hmm

#

the problem I had was because I was using package name aliases because I was using LoadLevelInstance

grim axle
#

I just call Connect <LocalIP> and it joins the session and opens the map for the client, so there is no where im supplying a map name there

#

@copper mango so i tried standalone PC and iPad build, and the crash happens after this line

Assertion failed: GetType() == FName(u"IOS") [File:/Users/build/Build/++UE4/Sync/Engine/Plugins/Online/IOS/OnlineSubsystemIOS/Source/Private/OnlineSubsystemIOSTypes.h] [Line: 10]

thin stratus
#

@grim axle Just to make sure stuff isn't mixed up: Connect <LocalIP> doesn't exist. It's open <ipaddress>. Further this does not join a Session, it only connects to the Server.

#

I'm sure you are more or less aware of that, just making sure that no one gets confused by wrong namings

#

When connecting to other instances of your game, you should never use PIE.

#

Standalone or Packaged Versions of your game should be used.

#

Further, what Engine Version are you running on? @grim axle

#

In 4.22 the file doesn't have these lines anymore

grim axle
#

I am using 4.22.2

#

Yeah, im sorry for that, its open and not connect

#

So, after further testing today, i got my code to work cross platform across Mac Windows & Android builds with Find Session Join Session Create Session, but still failing to do so for iOS

#

these nodes always seem to fail for iOS, not able to get them to work

#

the nodes are always entering the 'Failure' execution line

thin stratus
#

Weird part is that the Source Code of 4.22 has no Line 10 in OnlineSubsystemIOSTypes.h

wheat eagle
#

hi guys so I have a peer to peer session that acts as a steam party where the host is hosting a party and the other clients are people joining his party. When the host finds a game session, I want to send this blueprint session result variable to the other clients. I've tried sending it as a parameter or replicating it but everytime the client gets the variable as NULL and it can't join that game. What am I supposed to do? This should be trivial for every multiplayer game with party system.

wheat eagle
#

also I'm getting the blueprint session result (the session) from Find Advanced Sessions blueprint

hoary ridge
#

For a typical multiplayer first person shooter setup that isn't "true fps" (player just sees their first person viewmodel) and other clients see a third person character model, is this achieved simply by putting both the first person and third person models in a single character controller and then making only the respective parts visible to each client?

thin stratus
#

Yeah

#

You add two meshesComponents onto the Character

#

One already exists by default if you use the Character class as a base

#

Then you can use "OwnerOnlySee"

#

And "OwnerNoSee"

#

which are two booleans on the Mesh Component

hoary ridge
#

Awesome, thank you

tribal solstice
#

@copper mango thanks for the reply about mobile multiplayer. I have a feeling my issue is with the port forwarding.

#

hey eXi, saw some posts from you on my search for mobile multiplayer setup. Trying to get a PC hosting and an Android as client. Did you ever find a solid way to achieve this? I've tried direct IP but I can't seem to connect. I think it's port forwarding but I'm having a hard time cracking that, so I was wondering if there was a mobile online subsystem that worked well.

rotund sapphire
#

Do you have a router and setup the port forwarding?

tribal solstice
#

I tried following some tutorials but found a lot of conflicting info. I added UDP to port 7777 in my firewall.

#

Inbound Rules

#

If you have any info on clear methods I would very much appreciate it

plush granite
#

Well

#

Have you tried your servers local ip?

#

@tribal solstice

rotund sapphire
#

If it's a firewall setting you may want to setup both directions. Also 7777 may not be enough, enable 7778 as well. And i'm not sure whether it's udp only or tcp, i usually enable both TCP and UDP.

plush granite
#

7777 is enough

#

If your router doesn't have nat loopback, you wont be able to use your routers external ip.

tribal solstice
#

@plush granite I can connect if I'm testing in editor with 127.0.0.1

plush granite
#

yea thats not your local ip

tribal solstice
#

I know, local IP did not work.

#

but I may be misunderstanding

plush granite
#

Windows IP Configuration


Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : XXXXXX
   Temporary IPv6 Address. . . . . . : XXXXXX
   Link-local IPv6 Address . . . . . : XXXXX
   IPv4 Address. . . . . . . . . . . : 192.168.0.9 <---- HERE
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : XXXXX
                                       192.168.0.1```
tribal solstice
#

Ahhh

#

I was not understanding. I'll try that out.

#

Thank you.

plush granite
#

routers are confusing

#

I had the same problem

tribal solstice
#

I should know this though, hah.

plush granite
#

Lookup NAT Loopback

#

It might be the source of the problem

tribal solstice
#

Model of router and NAT loopback?

plush granite
#

exactly

tribal solstice
#

So if I'm going to demo this I'd have to know the router of the place I'll be?

plush granite
#

a lot of modern routers dont support for "security reasons"

tribal solstice
#

Oy

plush granite
#

well

#

ServerIP = IP == MyRoutersIP ? LocalIP : PublicIP

#

You know ternary operator?

#
if (IP == MyRoutersIP)
    ServerIP = LocalIP;
else
    ServerIP = PublicIP;```
tribal solstice
#

I do now! Copy that.

rotund sapphire
#

If you're going to demo your project on any random place, just bring a laptop and use a wifi usb spot you will connect to with your android, and it should be fine.

#

It's better not to rely on 'random place' network because it is likely wont work.

plush granite
#

I literally just setup a mobile multiplayer the past few days

tribal solstice
#

@rotund sapphire Awesome, great idea.

plush granite
#

The next problem you're likely to run into is Online Subsystems

tribal solstice
#

Yeah, so I don't need matchmaking or anything at all really, other than the ability to host the Android

#

It's not a game, I'm essentially streaming video and audio from server into a level populated by the Android

rotund sapphire
#

Once you compile a dedicated server out of your project you should be able to connect to it without online sessions. That is for advanced gameplay features and such.

tribal solstice
#

So with just 'open IP'?

plush granite
#

I use OpenLevel

#

either blueprint or C++

tribal solstice
plush granite
#

no thats the best you're gonna get

tribal solstice
#

@plush granite How does it know the IP?

plush granite
tribal solstice
#

Ahhh

#

Didn't know you could do that.

#

Thanks

plush granite
#

Np

#

You should read the entire guide

tribal solstice
#

So once dedicated server is up and running, all Android has to do is connect to same network and do an Open Level?

#

Which guide?

plush granite
#

The one that you linked

tribal solstice
#

I'll go through it again today

rotund sapphire
#

Brotchvorger what errors? You can bring those questions to #packaging maybe.

tribal solstice
#

It was awhile ago but I'll run through it again today and post there if I have any issues. Thanks Robert.

#

I need ARCore capabilities, so I should just build the ARCore branch for the dedicated server yeah?

rotund sapphire
#

But if you can get your project to compile properly, then from there it should be rather easy to add the new targets and shoot a profile from project launcher which will cook you a game or server of your choosing.

tribal solstice
#

Sorry, how do you mean 'new targets'?

rotund sapphire
#

Anything the server depends on will be required for the server. I'm not familiar with the ARCore stuff. :)

tribal solstice
#

Ah, I don't know much about that. Is that covered in the guide?

steep grail
#

@tribal solstice This helped me to start a dedicated server for testing a game. https://allarsblog.com/2015/11/05/support-dedicated-servers/

rotund sapphire
#

Actually you may be enough to output a dedicated server only. And just cook the game from editor menus it should be alright. But i found it more consistent for me to use one single launcher profile that can output either a client or a server.

tribal solstice
#

@steep grail Thanks!

#

Robert - I'm still a bit lost but I'll go through the guides and hopefully will understand.

steep grail
#

it is a lot of info and steps but it will help you out

tribal solstice
#

Appreciate it!

rotund sapphire
#

You can experiment with the shootergame project, it should be possible to output a client and server out of it.

tribal solstice
#

COol

rotund sapphire
#

I've checked that product and it's website but it doesnt really tells about access point features. But i just found you a better article, https://www.tp-link.com/us/support/faq/2021/ you can perhaps use this feature in windows 10 and your built in wifi just fine. See if that work and provides you access to your running dedicated server instance. Not sure about which IP you will access, but perhaps a ipconfig gives you a hint.

tribal solstice
#

Thanks a ton. It's just a wifi long-range adaptor. Not sure if that's the same as what you're referring to.

grizzled stirrup
#

There's one line in the ShooterGame pickup that is really confusing me, any help understanding it would be really appreciated:

    const bool bJustSpawned = CreationTime <= (GetWorld()->GetTimeSeconds() + 5.0f);
    if (RespawnSound && !bJustSpawned)
    {
        // Play sound
    }
#

So it's to prevent stale sounds from triggering when clients come into relevancy range

#

However I don't understand the conditional check, to me it reads: If the creation time (on the client, since it'd be created when coming into relevancy right?) of this pickup is greater than or equal to 5 seconds into the future, play the sound

grand kestrel
#

Check where creation time is set

#

Also is that on begin play

grizzled stirrup
#

@grand kestrel Creation time is not set explicitly in the pickup and this logic is ran whenever the pickup is respawned

#

Just a little sound that plays when it's respawned

grand kestrel
#

Ah right

grizzled stirrup
#

I just find the conditional check contradictory unless I'm missing something

#

I guess the !bJustSpawned part doesn't make sense

grand kestrel
#

It means don't play sound if it's beginning play

#

Only if it's actually respawning

grizzled stirrup
#

Ohhhh

#

So this pickup coming into relevancy for a new client, will creation time be 0?

grand kestrel
#

Haven't checked for sure

grizzled stirrup
#

AKA this will never matter unless it's the start of the match

grand kestrel
#

It's a decent assumption

grizzled stirrup
#

I thought it was to prevent a stale sound playing but this makes more sense

#

Thanks a lot

grand kestrel
#

Check creation time to see if replicated and where it's set to know for sure

#

I'd look for you but not at PC

grizzled stirrup
#

CreationTime = (World ? World->GetTimeSeconds() : 0.f);

#

It's not replicated

#

So if the client can call UWorld* const World = GetWorld(); then it will be set to the current world time

grand kestrel
#

Where's that run

grizzled stirrup
#

PostSpawnInitialize

#

Which I'm assuming runs on both client and server

grand kestrel
#

Ah there we go

grizzled stirrup
#

I'm going to log it out to test

#

Thanks for the help

grand kestrel
#

No prob

twin juniper
#

lately how many players have people been able to get in these dedicated servers with ue4?

copper mango
#

@twin juniper well 50-100 should be very doable, but you probably have to use the replication graph stuff

#

I have not done so myself, though, not working on that big of a game

grim axle
#

Can i replicate just a texture ? that is being dynamically changed by a scene capture component 2d, which is present only on server side

keen thorn
#

anyone watched this talk about networked physics?

chrome bay
#

Everyone whose ever tried it ๐Ÿ˜‰

#

Deterministic Lockstep isn't an option in UE4

#

hoping the new physics engine gives us new options

fleet viper
keen thorn
#

@chrome bay the guy seems to highly recommend for snapshot tho :p

chrome bay
#

They do but you don't have that level of control over the physics engine

#

UE essentially uses State Sync. The simulation runs on each client, and each gets state updates from the server

#

That's it though, there's no more advance than that - and the states can still go out of sync because client may simulate something the server doesn't know about

#

The engines support for networked physics as a whole is a trash fire, but unfortunately that's because it's an "off-the-shelf" engine that needs to work for a variety of scenarios, and Epic aren't building any physics-heavy multiplayer games right now

#

any physics-heavy network game is going to need some level of bespoke implementation

keen thorn
#

i guess ure right

#

dunno why i still wanna enter this hell XD

potent prairie
#

anyone figure out how to get non jitter movement with the movement component? Tried several different things now in c++ and still getting jitters when i play online

rotund sapphire
#

You can try throttling the networking - by simulating packet timing and other distrubances, so that would help you a bit in testing and figuring out the source of the jittering straight in the editor.

chrome bay
#

Jitter with Character Movement shouldn't happen that often

#

jitter with your own movement will if you don't have prediction and replay

potent prairie
#

Well unfortunately setting max walk speed in blueprint isnt enough anymore. It worked fine back in 4.20 but some recent update changed the component a bit

#

so ive tried doing the c++ stuff, helped a little but still noticable hitches

chrome bay
#

You probably have to save the max walk speed for replay (not something the engine does by default IIRC) - and make sure it's being set at the same time on server and client

#

It'll never be 100% perfect if the walk speed changes bases on arbitrary conditions

#

could be if it's driven by input

potent prairie
#

yeah that replay thing I was messing around for a while, I must have done it wrong

twin juniper
#

@copper mango Thanks . For some reason i was thinking ue4 supported 150 to 200 players

rotund sapphire
#

It has no limit on the players but the amount of work the engine has to do is a lot

#

You must find ways on limit on the work, there you can expand on the user count

#

Also, a beefy enough server and on well divided maps you can have thousands of players (not in one place at once but all in one game)

hollow portal
#

i have a problem with local multiplayer where if i press the sprint button with player 1 it works fine but with player 2 it puts player 2's screen on player 1's screen until i press the sprint button on player 1

plucky void
#

Hello guys, i need help with xsolla plugin for my multiplayer game . Do you maybe know how to skip the token authentication and make the player spawn ?

twin juniper
#

@rotund sapphire about how many with abd without optimization

mint jolt
thin stratus
#

Players BeginPlay?

#

@mint jolt What Player?

#

What class are we talking about

#

I'm 90% sure that neither the PlayerController, nor the Character/Pawn is guaranteed to have a valid PlayerState on BeginPlay

mint jolt
#

Thirdpersoncharacterโ€™s beginplay, sorry

thin stratus
#

Both have a specific function you use to make sure it's valid

#

Yeah that's totally wrong

#

BeginPlay Characters aren't possessed

#

They have no Player Assigned until they are possessed

#

Use the PossessedEvent

mint jolt
#

Ah!

thin stratus
#

Or utilize C++ with OnRepPlayerState

mint jolt
#

Does the above happen on the server?

thin stratus
#

PossessedBy happens on the Server

#

C++ has lots more functions you can override to handle this

#

Makes it a lot cleaner

#

If you use BPs only you'd use OnPossessed and if needed somehow use a custom PlayerState veariable to mimic the OnRep

mint jolt
#

Yeah weโ€™re in cpp land. Thanks weโ€™ll try that!

thin stratus
#

Yeah then you want to utilize:

PossessedBy for the SERVER for Controller and PlayerState.
OnRep_PlayerState for all Clients for the PlayerState
OnRep_Controller for the owning client for the Controller

#

Then you are on the save side afaik

#

@mint jolt

#

All Clients as well as owning Client does not entail ListenServers

#

(in C++)

mint jolt
#

I guess what threw us was that the player state looked corrupted, rather than null. Maybe itโ€™s cloned or something.

thin stratus
#

It should def not be usable on BeginPlay

#

It's a common mistake that I sometimes also run into

#

Specially since BP lack the additional functions

ornate crescent
#

Hi, any can advice for how to implement persistent item where the Character can Pick item and add to inventory and can modify stats like Durability

#

what is the best solution. Struct? Actor for pickableitem and after pick item, destroy this actor and replicate the struct to the inventory item?

west rapids
#

Guys, if you wanted 2 clients to run different game modes in multiplayer, at the same time, do you need 2 separate game modes and feed data through the game instance, or is there a way to have 2 game modes communicate?

fleet raven
#

2 game mode instances in one world is not supported at all

west rapids
#

so what are my options?

#

i have to have 2 game modes

#

that or maybe have a big modular main game mode

#

ok what about interfaces

#

like if had a game mode implement 2 interfaces

#

that would work ye?

timid pendant
#

Hello I am getting a network mismatch error joining from my client to a linux server. It was working fine until we switched to 4.22

#

Warning: GetObjectFromNetGUID: Network checksum mismatch. FullNetGUIDPath: [9]/Game/Levels/Alaska/Alaska_Ver_1.[7]Alaska_Ver_1.[5]PersistentLevel.[93]BP_Soldier_2, 1671717527, 3212134777

#

Theres the error ^

#

I know mismatch could be caused by different game versions but the client and server were always built on the same commit with jenkins

twin juniper
#

@west rapids can you give an example of what you'd need 2 game modes in one level for? Maybe there is another way

west rapids
#

Aight lets say I want to run a top down management game, managing players on the ground that have to complete objectives set

#

so essencially thats 1 player that basically playes an RTS

#

and however many that play fps

#

I wouldn't have a problem if i didn't have to feed score and such

winged badger
#

you can leave an Actor to store your data

west rapids
#

unless 1 gamestate is enough

winged badger
#

have it persist through seamless travel

#

and just read your data on the other side

west rapids
#

but this is happening in the same level

winged badger
#

2 different game modes?

west rapids
#

game instance would work for me

winged badger
#

that's not going to work

west rapids
#

even if i stream 2 levels through

#

game instance would work for me

#

yeah i'm just trying to figure it out before i realize i got an enitre class to reparrent

twin juniper
#

So... how would a player decide if they were playing in rts mode or fps mode?

winged badger
#

i find shoveling data through GI to be super inelegant

west rapids
#

same way you pick sides in a game

#

outside in a lobby

#

but they would share the same persistent lvl

winged badger
#

so why the two GameModes?

west rapids
#

yeah i know that GI is the "garbage can"

#

cuz i wanna be able to run both fps module or rts module in standalone

#

that or i need to separate walls of code

winged badger
#

for that you just need to run 2 different classes of PC

west rapids
#

with checkers

winged badger
#

with same basic interface

west rapids
#

i don't have issue with controller or state

winged badger
#

and override about 2/3rds of the GameMode without calling Super::

west rapids
#

ooooh

#

yes

#

great idea

#

xcellent

#

btw why do u super hate GI data transfer? thats what the thing is there for

winged badger
#

its not

#

there is always a better soultion

west rapids
#

afaik thats the only thing persisting through sessions

#

afaik thats the only thing persisting through sessions

#

unless u talk about some custom cfg on disk

winged badger
#

and yet, PlayerState can remember your name and basic info even through hard travel

west rapids
#

i dunno, moving inventory for example, I've seen several solutions, most just say store an array in GI and pass it down the line

winged badger
#

"remember" would be more accurate, but yeah

#

that is the easy way

west rapids
#

how much overhead would u rly be saving yourself if you go the harder route

winged badger
#

you can implement in 10 minutes tops without knowing anything about unreal

#

it also makes you want to cry after you look at your GI few months into development

west rapids
#

and then again refactor is always an option, just a pain in the arse, thats why i wanna set up classes proper

#

yeah i figure itd be a garbage can pretty quick

winged badger
#

the only solution is to never start

west rapids
#

dunno man feels like a bit of comp vs inheritance

#

going too much either way is just wasting time

winged badger
#

breakpoint APlayerState::CopyProperties when playing from DebugEditor from VS

west rapids
#

aight

winged badger
#

its what gets called to keep your PlayerName, ID and such even through hard travel

#

basically copies it from old PS into a new one

#

callstack should tell you all you need to know

west rapids
#

never though of hooking in through there

winged badger
#

and as for 2 GMs - that is sucidial

west rapids
#

thats why i was askin for ideas ๐Ÿ˜„

winged badger
#

you will basically have to use seamless travel from lobby

#

to initialize the play level properly