#multiplayer

1 messages · Page 121 of 1

gritty warren
#

and that's how all the motion is done I believe

#

So I was thinking we don't really need a custom float, we can just return the values directly i was thinking, and in calc velocity i have

thin stratus
#

Yeah but, what do you mean with "return directly"?

#

GetMaxSpeed has to return something

gritty warren
#

can't we just have GetMaxSpeed() to return whatever we are setting CustomWalkSpeed to?

thin stratus
#

If you explain me how :)

gritty warren
#

So like here is how i have it right now

thin stratus
#

How exactly are you planning to connect the function that handles unpacking the NetworkMoveData with the GetMaxSpeed

#

Without having the first set something that the second returns

#

What you have there won't work

#

Cause the Server will also run that

gritty warren
thin stratus
#

I don't see the gain

gritty warren
#

so in calc velocity we do GetMaxSpeed but i just overwrite it

thin stratus
#

I would not touch CalcVelocity for this

gritty warren
#

interesting

#

okay, i will undo that then 🙂

thin stratus
#

What does Super::GetMaxSpeed return?

gritty warren
#

So in GetMaxSpeed, can I reference the network data?

thin stratus
#

Pretty sure it returns MaxWalkSpeed

gritty warren
thin stratus
thin stratus
#

Not yours

gritty warren
#

well if it has the appropriate attribute set it returns the movespeed attribute

thin stratus
#

Buddy, the native CMC function

#

GetMaxSpeed

#

What does that do again

gritty warren
#

OH

#

im an invalid

#

the native one returns maxwalkspeed

thin stratus
#

Yeah

gritty warren
#

and some other stuff based on movement mode but we dont care

thin stratus
#

Then you don't need the Custom one

#

Just set that

gritty warren
#

okay so this, but i set MaxWalkSpeed in this other Before/Pre/Whatever Movement Update function,

thin stratus
#
  • Client sets MaxWalkSpeed in UpdateCharacterStateBeforeMovement to the Attribute Value
  • SavedMove SetFor uses GetMaxSpeed
  • SavedMove PrepFor sets MaxWalkSpeed
  • Client sets NetworkMoveData MaxSpeed from SavedMove (I assume)
  • Server sets MaxWalkSpeed from NetworkMoveData
#

There is one more thing that might be missing

#

The function that replays the Moves

#

You might want to override that

#

And save the current MaxWalkSpeed to some local variable
Then call the Super call
And after the Super call set MaxWalkSpeed back to the saved one

gritty warren
#

MoveAutonomous maybe?

#

Okay i'll try this

thin stratus
#

Might not be needed though cause you are setting the Speed every frame before movement anyway.
But at least that one frame you don't move with the saved moves value by mistake

#

Maybe

gritty warren
#

i'll give it a shot

thin stratus
#

Do the dotted list first

#

And see if it works

#

Do you already override that one function that the Server uses to get the NetworkMoveData unpacked to set stuff on the CMC?

gritty warren
#

I think so, I think its just the serialize function

#

and they do it in reverse on the server

#

So for that funciton i just do Ar << MaxWalkSpeed

#

and it will deserialize appropriately

#

I don't think i need to modify the PackedBits stuff, i think it will be handled automatically if i use the serialize function

thin stratus
#

But that is missing the part where the Server actually set the MaxWalksSpeed of the CMC or?

#

Cause that Ar part is inside the NetworkMoveData struct

#

That doesn't actually touch the CMC

#

iirc, the CMC sets the Current NetworkMoveData Container Pointer on the Server Side when the Server performs the move

#

It may set it multiple times to different packages

#

Old Moves, Dual Move, etc.

#

And calls the same function afterwards

#

That function you'd need to override, get the current network data and set the MaxWalkSpeed on the CMC

#

This is from memory, so you'd need to double check and in doubt show me some native code lines so I can remember

gritty warren
#

i see

#

there is another function called "ClientFillNetworkMoveDat"

#

This is my addition

thin stratus
#

Yeah that's fine

#

The opposite side is missing

gritty warren
#

it looks like this gets the value from the SavedMove

thin stratus
#

Can you screenshot the native ServerMove_HandleMoveData

gritty warren
#

yes

#

this is my custom data container

#

with the NetworkMoveData

thin stratus
#

Right, can you do the same with ServerMove_PerformMovement?

#

Trying to see where you can best do this again

gritty warren
#

It is extremely long, let me see

thin stratus
#

Ah

#

Then just the start

gritty warren
thin stratus
#

Yeah I would try to override that one

gritty warren
#

aha

#

here

thin stratus
#

And before the Super:: call take the NetworkData

#

Cast it to yours

gritty warren
thin stratus
#

And get the MaxSpeed from it

gritty warren
#

MoveAutonomous I could overwrite?

thin stratus
#

Na

#

ServerMove_PerformMovement

gritty warren
#

Interesting

thin stratus
#

MoveAutonomous is called for Client too

#

We don't want that

#
void UTowerCMC::ServerMove_PerformMovement(const FCharacterNetworkMoveData& MoveData)
{
  const FTowerNetworkMoveData& TowerMoveData = static_cast<FTowerNetworkMoveData>(MoveData);
  MaxWalkSpeed = TowerMoveData.MaxWalkSpeed;

  Super::ServerMove_PerformMovement(MoveData);
}
#

Don't know if that cast needs FTowerNetworkMoveData& or none ref

gritty warren
#

In my CMC constructor though I have set the kind of container already

#
{
    SetNetworkMoveDataContainer(TowerNetworkMoveDataContainer);
}```
thin stratus
#

And?

#

I think you are not yet understanding why we are doing this

gritty warren
#

So that container already has my custom move data, so I would still need to cast?

#

i do not know why we are doing this haha

thin stratus
#

The MaxWalkSpeed variable of the CMC exists on Server and Client, right?

gritty warren
#

(also I am happy to venmo you for your time, much appreciated)

#

Yes

thin stratus
#

The Client sets its local Version of that Variable via the BeforeMovement function. Okay?

gritty warren
#

Okay

thin stratus
#

The Client then uses the GetMaxSpeed function, which returns that variable, to set the SavedMove MaxSpeed variable. Okay?

gritty warren
#

This is in our case or in the native case?

#

Native case right, okay

thin stratus
#

All in our

#

Native has no MaxSpeed saved in the SavedMove iirc

#

Still okay?

gritty warren
#

SavedMove native does have a MaxSpeed, it is just not sent over the NetworkData

thin stratus
#

Ah, I didn't remember that

gritty warren
thin stratus
#

Are they setting it from GetMaxSpeed?

gritty warren
#

searching

#

Yes

#

In Set Move For, they get charactermovement and call GetMaxSpeed

thin stratus
#

Alright, yeah I forgot about that. Then forget that part

gritty warren
#

for whatever reason, this is not part of the serialized data though

thin stratus
#

So Client sets MaxWalkSpeed in UpdateCharacterStateBeforeMovement to the Attribute Value

gritty warren
#

So this is native:

unborn nimbus
#

When do replicated actors receive their initial bunch of data?

gritty warren
#

And I just jam it in at the start

#

well

#

in its own if for ensuring i am client

thin stratus
#

Just after the Super call fwiw

gritty warren
#

or maybe just in that If ! SimulatedProxy

#

gotcha gotcha

thin stratus
#

No you'd need to do that only if AutonomousProxy actually

gritty warren
#

Okay got it

#

wwait so

#

Here I set MaxWalkSpeed to attribute value for client

thin stratus
#

Yeah

gritty warren
#

GetMaxSpeed() actually just will return that value for the WalkSpeed

thin stratus
#

fyi the MaxSpeed in the SavedMove is probably only used to check if the Move can be combined/is important

gritty warren
#

NetworkMoveData needs to cary along max speed.

In GetMaxSpeed() function, I have something that references the network move data

thin stratus
#

Now you have your custom NetworkMoveData with a custom MaxSpeed value that you serialize.
That is set in the Fill function from the MaxSpeed of the SavedMove, right?

gritty warren
#

Yes yes

thin stratus
#

Yeah, so the last part that I posted before is the part where the server uses that data to set the variable on his end too

gritty warren
#

Is there anything I need to do to make sure that GetMaxSpeed knows what the current NetworkMoveData is? 🤔 or can I just reference it?

thin stratus
#

Cause without that, the MaxWalkSpeed on the Server isn't set

thin stratus
gritty warren
#

We don't touch GetMaxSpeed at all in this case

#

okay i see i see

thin stratus
#

Yeah

gritty warren
#

bro i have just learned so much

thin stratus
#

I think you still need to use the PrepMoveFor function of the SavedMove

gritty warren
#

I will message your studio here in a few hours when I'm done with my next bit of work

thin stratus
#

To set the MaxWalkSpeed to the MaxSpeed of the SavedMove

#

Cause Epic doesn't do that

gritty warren
#

well

#

MaxWalkSpeed isn't mutable

thin stratus
#

There might be some more things that we overlooked, cause CMC is hella complex

gritty warren
#

so should I change it?

thin stratus
#

Where is it not mutable?

gritty warren
#

In PrepMove For

thin stratus
#

One sec

#

You sure?

gritty warren
#

I believe so, I was having trouble doing that directly before

thin stratus
#

Character->GetCharacterMovement()->MaxWalkSpeed = WalkSpeed;?

thin stratus
unborn nimbus
#

Somewhere between PostInitializeComponents and BeginPlay it seems

gritty warren
#

that makes sense

#

Okay sweet, i have to go now unfortunately but this was hugely helpful, i feel like i really understand so much more now!!

thin stratus
unborn nimbus
#

Ah yes but do you know if there's a property tracking the initial bunch

#

ie the COND_Initial properties

#

ah it's probably PostNetInit

#
/** Always called immediately after spawning and reading in replicated properties */
    virtual void PostNetInit();
thin stratus
#

Could be. :S

unique forge
#

someone being something

#

alr done

shy gust
#

Hey all, Im just making sure I have the right idea about this process.
So I have client authoritive movement in my racing game, I want to replicate the players variables to the server, and then to all versions of that player on the clients
the process would be an RPC to the Server , and then RPC multicast to all clients? or would I use client RPC ?

fossil spoke
#

Which variables?

#

Depending on what you are trying to achieve you may want a different approach

#

But it would first start with an RPC to the Server in most cases.

shy gust
#

Im sending a float of the velocity and Bools ive set up for the current state : "total velocity,Drifting,Boosting,tricking" mainly to control VFX on the remote vehicles

#

i first thought to use a Rep var , but I believe those only speak from Server to client

fossil spoke
#

You would likely want these to be Replicated Properties as they are "Stateful"

#

You would use RPCs for one off "Events"

#

Events are not stateful

#

Properties are stateful.

#

Replicated Props are only replicated from Server to Client yes.

#

But they serve a different purpose than RPCs as I explained a little above

#

You would use an RPC from Client to Server to notify the Server of the change in those properties

#

Then the Server would update the Replicated Properties so they can send their values down to Clients

#

Via property replication

#

Because they are stateful.

#

If they were not stateful

#

Like

#

"Started Boosting"

#

Thats an Event

#

You might use a multicast RPC instead

#

"Started Boosting" isnt stateful

#

"IsBoosting" is stateful

#

RPCs are not stateful

#

Rep Props are stateful

#

Does this make sense?

shy gust
#

gotcha that makes perfect sense , So then RPC to the server, Server updates variable. and that updates all clients.

fossil spoke
#

Yes

#

You can then use the OnRep specifier to get a function which executes when that variable changes on Clients

#

You might use that to trigger things like the toggling of effects

#

I suggest you read up on how OnRep works

#

The Network Compendium pinned in this channel explains all of this

#

You should take a look at it.

shy gust
#

thanks a million! Ive frequently watched that video and alot of others, its been extremely helpful , I just wanted to double check the process . I appreciate the clarification

fossil spoke
#

The compendium is not a video

#

Its a document

#

You really need to read

#

More than once

#

And reference in the future.

shy gust
#

Ooh, this I havent seen , ill give this a scrub through, thanks

fossil spoke
#

Its literally the first pinned message lol

shy gust
#

sorry my brain saw the video underneath first , ive watched that alot whenever its been awhile since ive touched my netcode lol

unkempt tiger
#

is the built in replay system up for the task of capturing an entire playtest session (held on a dedicated server with multiple clients connected), and then outputting some file I can download and watch myself (from different angles etc)?

#

my main objective is to basically be able to produce a trailer from real gameplay sessions from the replay (that is, not in real time)

#

ideally by being able to change camera angles, and other directing controls

#

okay, per the documentation, the answer is a vague yes, still not sure how it all works and how easily one can get some directing controls during replay playback

#

so I guess I'm changing my question to: did anyone here ever get to work with replays and/or did something similar to what I'm asking?

lost inlet
fossil spoke
#

So network prediction plugin isnt being forgotten about after all?

lost inlet
#

well I'm sure it is, I got confirmation that NPP was dead, but I suppose this is an "NPP 2.0" type effort

fossil spoke
#

Eitherway, I welcome progress in both these areas thats for sure

lost inlet
#

me too, it's been a long time coming

fossil spoke
#

Generic Movement and Generic Network Prediction

#

Both good things for the wider audience

tropic snow
#

I just created a dedicated server for my game, anyone know how I can start up my server with custom server name, player slot, level?

limber minnow
#

@fossil spoke wasnt really necessary, but people told me it was a bad idea to maintain a connection with the server inside a game instance

fossil spoke
fossil spoke
#

Or add detail

limber minnow
#

well, I have a server console which receives a buffer from the game

#

receives data

#

and then retrieves the data back via tcp socket connection

tropic snow
#

Where can I get such commands? My dedicated server doesn't let me input anything. I see it though the cmd..

limber minnow
#

to stabilish the connection I need something to connect to that socket inside the game

tropic snow
#

Can I have a configuration file of some sort before starting a dedicated server to set up game settings?

limber minnow
#

then I started looking for plugins or features inside unreal engine to connect

fossil spoke
#

@tropic snow Research how to setup a config.ini file

#

Which the Server would read settings from.

limber minnow
#

somebody from here told me about Ftcplistener, but I didnt find any documentation or feature inside unreal for that

fossil spoke
#

@limber minnow You must not have searched very far, the Engine certainly has those features and are used in many areas of the engine

limber minnow
#

well I downloaded the plugin from Spartans and just created a class, builded inside my project adding in the build.cs and now the connection works fine

#

but I need to cast as object inside the game instance and then connect

fossil spoke
#

TcpListener.h is literally a listener for TCP connections

limber minnow
#

does it also send messages ?

fossil spoke
#

Just look at the Networking Module

#

It has everything you need

#

A Socket Builder

#

A Listener

#

A Receiver

#

Go and look my friend.

limber minnow
#

well I dont know where to look and how to learn it

fossil spoke
#

If you dont know how to research this, how on earth do you thiink you are going to build an MMO?

#

Take some time to look around the engine

#

Understand its classes

#

How to search for things

limber minnow
#

well the game is already working and connected

#

also with mysql database

#

I just wanted to get somebody opinion where I should stabilish the connection

#

in a subsystem or in the game instance

fossil spoke
#

A GameInstance Subsystem would make sense

limber minnow
#

good thanks

#

Im still working in the class so it can work

#

ha

#

I was trying to cast the gameinstance subsystem at first inside the game instance but for some reason didnt work

#

but now it works outside the game instance and still connected when I switch the levels 🥹

faint eagle
#

if autonomous proxy sends reliable server RPC, and then, after 0.1s, an unreliable server RPC, can it be that the unreliable one comes to server before reliable even thought it was sent 0.1s later? 🤔

fossil spoke
#

Reliable = I will eventually get there
Unreliable = I may or may not get there

#

Once an RPC is sent, there is no way to predict when it will be received.

#

So there is a potential for unreliable to reach the target first, if its received at all.

coarse patrol
#

Hello,

I have a basic question and I'm seeking some assistance. I need to create a VR multiplayer game, but I only need two devices to be in sync: a VR headset and an iOS device. In this setup, the primary gameplay will occur on the VR device, while the iOS device won't be actively playing but will** display a real-time sync of the game being played on the VR device**. Essentially, the** iOS device will act as an observer or inspector, showing the player's character's transformations, the game map, and various widgets displaying player game details and progress.**

I've read several resources and articles, but I'm struggling to understand which server solution to use. Most tutorials and courses demonstrate how to connect devices on the same network, but in my case, the two devices will be connected to** different networks**. Furthermore, I only need two devices to be in sync, which makes me wonder if there's a simpler solution available.

I've explored options like EOS, which allows us to join sessions, but it appears that connecting across different networks might require an additional server solution like GameLift- this i am not sure pls let me know if there is some solution with EOS.
I'm looking for a more straightforward approach if possible. I've also considered Photon Realtime, which seems suitable, but I'm concerned about the availability of resources and support. Additionally photon doesnt support unreal engine multiplayer system ig.
I've also looked into PlayFab, but it doesn't seem to support iOS and Android.

Could someone please suggest the type of server or system to use, or if there's a simpler technique to address my specific problem

sharp vigil
#

Would you generally implement teams on the game state and keep track of what player is on what team there?

fossil spoke
#

The GameMode could be the one that creates those Team Actors though.

#

You would probably want to have the GameState replicate a reference to the Team Actors as well.

#

So they are easily accessible.

#

This is how Unreal Tournament handled Teams.

#

Its a fine solution for traditional Teams if thats all you need.

#

Traditional in that there are only 2 teams.

#

If you need nested teams

#

Like, squads within teams.

#

Probably better with a different solution.

sharp vigil
#

Ah okay thanks. I'll try that

hollow eagle
#

You've named 3 different things that have nothing to do with each other. EOS is not a server hosting platform or a networking layer, it's a layer for platform services (friends/lobbies/matchmaking/achievements/etc, but not actual server hosting or networking). Photon realtime is a networking layer (and also user data storage and platform services? honestly unsure), but unreal already has a full networking layer and you'd have to have a damn good reason not to use it. PlayFab has server hosting but also user data storage and platform services and has nothing to do with your game's networking.
What are you actually looking for?

rich dune
#

Hey,

I'm passing trough some variables to a projectile at spawn so It can modify it self at begin play. However this does seam to work on Singleplayer only. I run this on the server and even with a Multicast those variables are never replicated on the Projectile Movement. Any idea why?

thin stratus
rich dune
coarse patrol
# hollow eagle You've named 3 different things that have nothing to do with each other. EOS is ...

I had some uncertainty about the choice of backend and dedicated servers. In my scenario, I only have two devices in sync: one device is primarily for inspection, but it will still load maps and data. I'm wondering what type of multiplayer system to use and whether I need a dedicated server for this. Additionally, how can I ensure synchronization between these two devices on different networks?

Also yeah now i understood i could use EOS as backend which is free too and all i need some dedication server service -- is this effiecent solution?

willow surge
#

Hello everyone, I have a question regarding the Lyra Sample Game (using it as base for my project) at this moment I have a "fully" working Dedicated -> client model with the server running on PlayFAB (only using it as host at this moment) I'm able to join the server with the console command on the client "open IP:PORT" and I can play on it against the bots. Now for the problem. Each time the 3rd round start I get "spawned" in the ground and can't do anything. EOS is fully working, and I register myself (player) without problems and the EOS backend reflects this as well (a play slot gets taken) -> If I exit the game on the client on the 2nd game I also UnRegister the player and this also get's reflected in the EOS backend. Does anybody have the same issue or an idea why on the 3rd round I'm not able to play anymore?

willow surge
coarse patrol
#

are u using playfab GSDK plugin?

#

is playfab better compared to gamelift?
is it free or paid?

thin stratus
#

Those services are down the line all paid

willow surge
coarse patrol
#

even we cant test for free, like for development?

willow surge
coarse patrol
#

ok

#

are u using EOS and only server as playfab ?
EOS is free ryt and playfab analytics those stuffs are also paid ryt?
any reason u dont prefer EOS

thin stratus
thin stratus
#

And possibly other differences

coarse patrol
#

and also gamelift is expensive than playfab?

coarse patrol
thin stratus
#

Buddy, people already explained you this stuff

#

Photon is irrelevant for UE

#

And for Gamelift vs PlayFab Pricing you have to check their website

coarse patrol
#

ok

#

got it

thin stratus
#

They generally all will cost you multiple hundred $ per month depending on your game

willow surge
#

I’m sorry eXi just trying to be helpful and friendly. Just hope someone had the same experience as me with the Lyra Sample Game and not being able to play more than 2 rounds when running dedicated servers.

thin stratus
#

I simply asked if the same happens without EOS and PlayFAB

#

Cause it generally sounds like you should be able to reproduce this locally

#

Which would make debugging easier

willow surge
#

I can not test this locally as I can’t run a dedicated server and a client on the same IP?

willow surge
# thin stratus Eh?

Sorry I missed your previous comment/answer I was replying to the above. But no I can not test it locally as I can not run the server and a client on the same ip.

thin stratus
#

open 127.0.0.1 should work just fine

willow surge
#

🤔 then I have to make a separate Server and Client builds that disable PlayFab (otherwise it will crash as it can’t receive heartbeats) I will try that now.

#

And I guess I have to disable all the EOS register / unregister nodes.

thin stratus
willow surge
astral gust
#

Hello everyone, I’m Parzival (Parz for short), i’m new here and have recently decided that I want to try and learn Unreal Engine in my spare time and hopefully meet some like minded folks to hangout and network with. I have a few tutorials i’m going to start with, Smart Poly on Youtube seems to cover a lot of stuff, but if anyone has any comments or suggestions on that i’m open ears. This next thing is a two parter, I wanted to jump in and start making a game, but based on his tutorials it looks like having a really good understanding of all the available tools is a better idea. I was wondering what you guys think, should I learn on the go or actually take the time to navigate and explore everything first? Last, I have a little drawing board for my first game idea, obviously i’m a long ways away from developing a pleasurable multiplayer experience, but I was curious as to what the limitations are in terms of player size, for a game that compares similarly to early day fortnite in both appearance, weapons, and player capabilities. If I wanted smooth gameplay, how many players can I expect to be able to host without frame drops? Thanks in advance for any tips and direction, I look forward to hanging out here more often!

#

*Side note, the game would eventually be a battle royale, much smaller map than fortnite maybe about 2/3 to a 1/2. No building, maybe destructibles here and there. I was thinking about 20-36 players max. This will just help me plan a little bit better if I have an idea of what’s capable but I haven’t been able to find much information. Thanks again!

thin stratus
#

Well, 20-36 players is fine.

#

Wanting to make a Battle Royal as your first game, when learning the Engine and its Multiplayer, is nonsense though.

#

It's up to you how you learn best. The Engine is huge and you are required to use C++ for a project like this ultimately anyway.

#

So if C++ is not a thing for you yet, I would suggest you scrap the Multiplayer part and learn BP/C++/UE in Singleplayer first.

astral gust
thin stratus
#

Only for Multiplayer specifically, which is the Compendium pinned to this channel

#

Everything else, not sure. Depends on how you learn best

#

YouTube tutorials are littered with false knowledge, even from Epic. Even paid ones might be bad.

#

So it's probably best to watch/read a lot of different stuff and just toy around

#

The biggest headache will be learning "the proper way" of doing something

#

Cause you will find more people teaching you the wrong way

silent valley
#

Does NetUpdateFrequency affect RPCs at all?

frozen moat
#

guys. i made a simple sessions widget which works but if i'm in the same network? kind of i think?
i have my pc connected via lan and my laptop is connected to the same wifi and it works when i run it like that. but when i change my laptop's wifi to my mobile hotspot it doesn't work anymore

#

i tried to implement Epic online subsystem but idk if i did fully because i don't see any activity in it's analytics

willow surge
#

Well I got it to run sort of from the editor (build from source) with net mode client (as it will start a server) and I was able to get through the 3 rounds albeit a bit wonky. I don’t know why registering someone with the EOS backend, and hosting the server on PlayFab would make it have problems not wanting to go past the 3rd round. @thin stratus (don’t know if I’m allowed to mention you or not as I wanted to update you on the status of your suggestion.)

willow surge
#

Can also confirm it happens locally without EOS/PlayFAB now

#

but it took much longer

#

UActorChannel::ProcessBunch: New actor channel received non-open packet. bOpen: 0, bClose: 0, bReliable: 0, bPartial: 0, bPartialInitial: 0, bPartialFinal: 0, ChName: Actor, ChIndex: 78, Closing: 0, OpenedLocally: 0, OpenAcked: 1, NetGUID: 0 seeing a lot of this (errors)

hushed sigil
#

Do you need to create a C++ class for every actor you want to replicate, to implement Getlifetimereplicatedprops()? Trying to replicate a simple AStaticMeshActor by setting replicates/replicates movement to true, but that doesn't work

round mist
#

Just to verify.... there's literally NO way to have instanced maps loaded in like you get in an MMO using client hosted listen servers, right? Like, not without some crazy C++ stuff?

Our world is getting too big and I'm considering just having players load up new maps for our future content zones, but I know that means all players in the game have to then travel to the new map currently.

formal plume
#

Hey when I use AttachComponent, how do I get this new subobject to obey SetOwnerOnlySee? It's being attached to a skeletal mesh with that set to true, but I can still see it on other clients.

formal plume
#

oh I think I see the problem attachcomponent doesn't change the owner

latent heart
#

You can use rename to do that possibly.

#

Or just SetOwner

formal plume
latent heart
#

That will absolutely do bad things in multiplayer, I expect.

formal plume
#

yep its very angry about that lol

#

for some context, I'm trying to take the first person starter project and make it multiplayer. I've added a third person mesh, and trying to show the weapon in the right place for 1st and 3rd person meshes. I'm beginning to think that I may just have to change the way weapon pickup works completely instead of using AttachToComponent

#

this is what I get right now 🙂

dark edge
faint eagle
#

Is there a way to optimize TSubclass<UDamageType> when sending it over RPC? Judging by the insights profiling, it takes 112 bytes which's like 3 times of all the other shot data

inb4 why the hell do you even send TSubclass<UDamageType> for damage data - i'm kinda a victim of the situation here, optimizing someone else's netcode and would really like to avoid any tangible refactorings at the moment

hm, checked out other bunches, for some reason, sometimes TSubclassOf<UDamageType> takes only 2 bytes. and sometimes 896 🤔 what could be the reason of this?

formal plume
#

maybe this is why over the shoulder view was invented 😄

lost inlet
#

Since in the engine there is a table of common FNames in a table that will be networked by a numeric index rather than the string representation

faint eagle
lost inlet
#

Yeah it's an odd choice, is this a client to server RPC too?

faint eagle
#

it is

lost inlet
#

Because yeah I would expect the server to be able to figure out the damage type on its own without the client sending it

hoary spear
#

I wouldnt trust the client to tell the server at all

rose turret
#

code structuring question

my game starts with players in a 3D "select your character" screen and when they click on buttons it moves them around the level to take the next actions (marking themselves as ready, etc.)

right now I'm spawning a camera Actor on the server and using that to move them around the UI, but it doesn't seem right for me to do this on the server (replicating down position vs. being able to smoothly interpolate around on the client)

any tips for how to structure this? should I have the server run the Possess function but turn off replication for the camera actor and just move it around on the client and intentionally let client/server get out of sync?

fossil spoke
#

Why does the server need to know about something cosmetic like that?

#

If its just a selection screen, the client should control that entirely.

rose turret
#

where I'm getting stuck is that I didn't think I could have the PlayerController possess the camera actor without the server

rose turret
#

when can I safely use GetPlayerState() in a player controller? I'm getting NULL in BeginPlay(), BeginPlayingState(), etc.

frozen moat
#

why doesn't my eos work? i think i "set" it up right

#

the multiplayer sessions work as long as i'm in the same network

sinful tree
rose turret
twin juniper
#

Hi guys, I created a new project using the ThirdPersonTemplate and enabled Network Emulation with an Average profile, however this causes a noticeable jitter on character movement (quantization?) what could be the cause of this and how to ease it. Can a product like Smooth Movement help with this? Thanks!

pearl bear
#

When I move the object by applying force on it, I cannot replicate this, the client starts to vibrate. How should I replicate such a system?

#

I am using chaos

#

when I uncheck Replicate Physics to Autonomous Proxy my object start flying not going crazy

fiery wadi
#

Anyone know why my player when being spawned into a lobby is not receiving input from the Enhanced Input please?

#

this is in the Lobby GameMode

#

this is in the base character that is spawned

#

The 8 Keyboard Event prints out "OK" and the "IS NOT VALID" print string does NOT print out so I can only assume that the Enhanced Input is attached to the character.

severe bough
fiery wadi
#

@severe bough I double checked the input default and its all populated with mappings.

severe bough
#

Look here at the section Adding Input Listeners. You should be able to add one of the Enhanced Input Action events to your base character's event graph. Then you should see it when you press the matching key.

fiery wadi
#

Ok thank you will do!

elder sable
#

Hi, is it possible to get the array size of a replicated fast array ? I can get it with a replicated using function but i would like to have a single call function

queen escarp
#

hmm i got a weird issue

#

when im trying to show the "tooltip" on the client side it gives null error :/ ?

#

hmm anyone ?

untold dove
#

Seems to me that it's not able to find the property you're trying to reference (yeah, obvious. I know).

#

Perhaps you could track where the property is supposed to be getting initialized

#

and see if it's happening on both the client and server sides?

#

And otherwise just add log reports every time it's otherwise supposed to be getting used. If you can find a point between two log reports where it suddenly stops behaving how you want it to, then you've narrowed the scope of the problem.

#

(But that's the best general advice I can give, since, as of yesterday, I couldn't even figure out that the text field for the text widget was a text box, and not an unresponsive check box.)

queen escarp
#

xD

#

well im creating the widgets inside another widget and asigning it ot a player contoller index that might be the issue tbh

twin juniper
#

Guys, should i use player state or player controller to store my player data?
I am making an offline game but i want to try to do the best practice

#

My play data include items, inventory, hp and mana

untold dove
#

State persists for the level, while controller persists for the entire duration of the game

#

At least if I am correct

untold dove
#

You could test it

#

Create a variable. Assign to state, and try to access it in the next level

twin juniper
#

hmm

#

i should do that

untold dove
#

But otherwise, no, I don't have a source.

twin juniper
#

fk it, i'll just put all code in player state until it bugged out then i'll fix

untold dove
#

Honestly, a good response. Work hard, and fail quick.

twin juniper
#

Fail hard, and learn quick?

untold dove
#

I certainly hope you learn quick if you fail hard

queen escarp
#

@dark edge where u at = )?

#

nevermind i solved it * 😮

lean current
#

I need some advice.

I am trying to make a online game, the game part is easy enough. Shouldn't take too long. Its the online part thats killing me. I cannot get it done. I have learned most of the theory but there is a lot more for things like subsystems and just general application. And the slowing down is making me lose motivation. I thought to find a tutorial that will show me how to actually make a online server (+ master server for browsing servers). Is this the best way to continue?

rocky knot
#

Hey, is there a way to have an actor change "only relevant to owner", but not to be seen on the server ?

dark edge
#

You can just spawn a non-replicated actor

rocky knot
#

I guess it shouldn't know, you are right. Thankyou

dark edge
#

You should be able to just spawn the actor clientside and do whatever you want with it. Only client will know about it

rocky knot
civic valley
#

Hi everyone, i start by saying that i never did replication and im trying to replicate the als turn in place but im getting a lil frustrated on this error. You may ask, why didnt you get directly the replicated als? thats because i only need this turn in place feature to work and i can make the other features myself without sticking to als functions and methods. i successfully replicated the method of rotating the player and capsule als use. The turn in place itself works fine in first person but then gets fucked up when trying to replicate it. It only happens when you are playing from a client, meanwhile from the server view it does not happen and you can see the other players performing the turn in place perfectly. I tryied printing a few values and even tho im not that sure i think that the problem may be the get the actor rotation, since the value im printing on the screen should reset to 0 every time i pass a certain treshold (in that clip its 50).

zenith wyvern
#

This is firing on the client, it says 'i see the rep notify'

#

but this bind to never fires

#

it binds and never prints 'see inv update' on the trigger

twin juniper
#

When I try to add Replicated to the UPROPERTY of a struct I get an error saying struct properties cannot be replicated, however I can mark a struct variable as replicated. In this second case, will the struct be replicated properly?

zenith wyvern
#

My example started to work when I put the bind event first. Why the hell would that be the case

mortal mica
twin juniper
#

This code causes the compile error

`USTRUCT(BlueprintType)
struct FHEInteractPromptStateTeamOverride
{
GENERATED_BODY()

UPROPERTY(VisibleAnywhere, Replicated, Category = "Interact Prompt")
uint8 TeamID;

UPROPERTY(VisibleAnywhere, Replicated, Category = "Interact Prompt")
EHEInteractPromptState PromptState = EHEInteractPromptState::Hidden;

};`

#

but I am able to mark that struct itself as replicated in an actor, like so
UPROPERTY(VisibleAnywhere, Replicated, Category = "Interact Prompt") TArray<FHEInteractPromptStateTeamOverride> PromptStateTeamOverrides;

mortal mica
#

right, you need to replicate the instance of the struct

#

not the members of the struct

#

the struct is replicated as a whole

twin juniper
#

ok cool, so I guess then it just replicates all the UProperties?

mortal mica
#

yup

twin juniper
#

awesome, thanks!

mortal mica
#

there's a flag to ignore a specific property

#

but I dont recall what it is

#

but yeah, by default all UPROPERTIES of a struct are replicated

#

ah

#

UPROPERTY(NotReplicated)
float NotReplicatedProperty;

smoky crag
#

Hi everyone, I have a quick question. I noticed that UE original movement has huge data to replicate so the total amount of character you could have in a multiplayer game is very limited due to the network bandwidth.(Like 100 characters fighting, each character may have 12+ floats data per frame). Does any plugin that optimized the networking on this to support more character on the screen(I know something like GMC but not sure if it do this kind of thing)? Thanks.

wary topaz
#

How do I get the character controller in multiplayer? ive been trying for hours to make a client possess a random pawn when Tab is pressed with no luck 😦
tried all kind of things, this is what I have now...

frozen moat
#

guys someone help please

#

i am unable to login for some reason although i do see the brower epic confirmation

sharp hedge
#

hey I'm developing the game OwnRules RPG for this I need a way for server operators to have the function to set a password, the number of players and a whitelist system. My question now is how do I create such a config file that can be adjusted by the operator at the end like e.g The server name or number of players or whitelist, maybe someone has an idea or perhaps a tutorial or documentation ?

thin stratus
#

If you want it more custom, then I would suggest simply using a Json File and having a matching struct for it which you can auto deserialize to via the JsonSerializer stuff

sharp hedge
thin stratus
thin stratus
#

BP would probably requires a plugin for the Json solution. No clue how to do the config stuff in BP. Doubt it's possible

#

Ultimately you also need to utilize all of those settings and for those you need at least custom sessions code, so advanced sessions plugin or c++

sharp hedge
frail temple
#

Question, I hope that I'm finally learning or if it was just a fluke. When calling a server request (e.g. replicated server event > spawn an actor) it HAS to be called from a player controller or a pawn owned by a player controller? Or else nothing will happen if it's called from an actor without a PC? I just want to make sure I understand because it's driving me nuts learning it.

fallow monolith
#

can anybody suggest a course or a book to learn how to make multiplayer in unreal? I know basic c++ and python

thin stratus
#

That's somewhat like a book

thin stratus
#

The point is kinda the PlayerController, but the actual term is Ownership

#

Ultimately it boils down to the Client owning the Actor you wish to perform the ServerRPC in.

Owning means that the Owner of the Actor (you might have seen the Pin on the SpawnActor node) is set to something that ultimately results in the PlayerController if you recursively call GetOwner on the Owner.

So your PlayerCharacter, if possessed, can also work as an Owner.

The Owner has to be set on the ServerSide and only one Client can own a given Actor at a time.

frozen moat
#

can anyone tell me why does my packaged game crash but works fine in standalone mode in editor?

frail temple
# thin stratus Yes and no

Thanks for the explanation and the link. I'll still muck around with it and try the whole ownership thing instead of having the actor requiring a PC ref to do the spawn command. I thought I was getting there but I think I was wrong haha

thin stratus
#

I would suggest attaching Visual Studio to it if you have any C++ experience

frozen moat
#

it is a bp project

thin stratus
#

That is pretty unfortunate

frozen moat
#

and it works fine in editor

thin stratus
#

Did this start recently?

frozen moat
#

like i run standalone instances and it works fine

#

but when i package game doesn't even start

thin stratus
#

There is something with steamAPI in the callstack

frozen moat
#

but i'm not even using steam

#

i'm using eos

thin stratus
#

Does the same happen if you disable EOS?

#

Just to get somewhat of an idea where this comes from

frozen moat
#

uhh

#

my intent was to build multiplayer so i haven't tried that

thin stratus
#

Yeah it's just for figuring out what is missing

#

I mean, it does somewhat look like it tries to grab steam api dlls

#

Not sure why

#

But you can try putting the steamapi dlls into the binaries folder of your packaged game

#

Just for funs

#

And see if that helps

#

C:\UE\UE_5.3\Engine\Binaries\ThirdParty\Steamworks\Steamv153\Win64

frozen moat
#

advanced steam sessions plugin is enabled for some reason idk if that's a pre requisite to have advanced session plugin

thin stratus
#

You can find them here +- the engine version

#

No, you can also try disabling that

thin stratus
#

My random guess is, since I see load helper and steam api dll, that ittries to load the dll and fails or so

thin stratus
# frozen moat ?

The path I posted, mine has 5.3 and the steamv153 might be different if you use a different version

#

But the rest of the path should be similar

#

There is the dll in there

#

You can try copy pasting that into your packaged binaries win64 folder

#

But disabling steam requirements is probably the better solution

frozen moat
#

ok before i try that i'll try disabling steam plugin

thin stratus
#

That's all I can suggest atm. I also gotta leave now, got an appointment in 20 minutes.
Feel free to ping me if anything changed on the issue and I will read it once I have time

frozen moat
#

thanks man i've been beating my head around from two days hoping someone would respond

thin stratus
#

(fyi: dietered actually means that you suggested a solution and the person asking for help simply ignored your solution and started trying other things)

#

(at least iirc)

frozen moat
#

oh

thin stratus
#

Dieter is a user that got ignored so often in the past, he got his own emoji

frozen moat
#

ok that plugin was breaking things

#

💀

thin stratus
#

Awesome, little bit of guessing around callstacks helps sometimes

#

:D

frozen moat
#

now to test if the multiplayer works from different networks

#

i'll probably need to re- enable that plugin to implement crossplay

#

😩

#

OMG it works thanks soo much @thin stratus

#

i'll probably not mess with cross play for now

frail temple
willow surge
#

Isn’t it as simple as disabling steam support / plugin if it’s not being used? Like in plugins / subsystems? Edit: ahh seem it was already suggested.

frozen moat
#

ok so my first conundrum is i want to swap player pawns. (i don't have 2 player start objects and i don't know how both the players are spawing using the same player start in the default third person template map)

  1. how do i spawn the second player(more importantly how do i identify the second player) in a certain spot with a certain pawn
frail temple
#

There is probably a whole bunch of different ways to do it.

frozen moat
#

hmm.. i login in menu widget and once the session is created the map is opened. so can i write the event functionality in the level to add players? but that's not where i login so idk it doesn't make sense to me

#

also the game modes are weird. i was following a tutorial which made a new game mode for the main menu level. and used it through level override. same happens with the tpp template into third person player game mode

frail temple
#

So when you select the session you want to join, it will call a OnPostLogin when joining, you can handle all the "initial" setup of the controllers there on the server.

I have 3 game modes, MainMenu, Lobby and MainGame.

frozen moat
#

i only have 2 players btw

frail temple
#

The host of the server calls the OnPostLogin call too.

#

Want to jump into a chat? Might be easier to say it than to type it sweat_smile_mirrored

frozen moat
#

uhh i'm currently in a class 💀

frail temple
#

All good 😂
Class and working on a game? I love it.

frozen moat
#

yeah i have to show my progress by next class

#

and although i am satisfied with my current progress my faculty is kind of a jerk so he might not be

#

so i want to atleast get the swapping work

frail temple
#

So, host creates the session, it will open the level that you have selected to open, which will run the Gamemode set for that level. When the host or another client joins, the OnPostLogin function will be called. You can Spawn Actor From Class and then add Possess with that controller that recently joined the session.

frozen moat
#

so i'm assuming you want me to store the controllers into array and pass it on

frail temple
#

Yea, I think it's best practice to store them into an array. I stored them into one because I want all the players to join the game before it spawns anyone.

frozen moat
#

also i don't know how the tpp bp does it i'm assuming it does it through cpp(the spawning and possessing the pawn)

#

weird i don't have OnPostLogin in the scope of the main menu widget

frail temple
frozen moat
#

oh

frail temple
#

You can create another GameMode and have it run only on that specific level.

frozen moat
#

so how do i pass it onto the next game mode?

frail temple
#

I assume you want to take variables with you to the other level?

frozen moat
#

i mean i do have the menu game mode specifically for menu

frozen moat
#

i just need to identify if the current player is player 1 or player 0

frail temple
#

I don't know the proper way to actually carry variables over, so I just created a Game Instance which stores the username and selected class then call it from the GameMode for each controller.

frozen moat
#

i feel like this shouldn't be that hard

#

let me ask this.

#

since i'm opening a level(thirdpersonmap) would the postlogin be called there or would it be called in the menu level where the host/join buttons call the session create/ join nodes

#

because both exist in different levels with different game mode overrides

frail temple
#

It will be called on both.

frozen moat
#

that should make it easier then

frail temple
#

You're opening a new level, so it's a new game mode, so when the controller goes through servertravel from the ExecuteConsoleCommand from the host, OnPostLogin gets called for each controller that connects again.

#

Everytime someone joins, post gets called.
So, host opens a sessions, which opens a new level. Players can join and then you can store their selections or choice or anything that they do within that level through a Game Instance (probably not the correct way, I think you should Player States or something like that)

frozen moat
#

so this is what i think i should be doing

frail temple
#

You can test it and see if it works.

frozen moat
#

the game mode somehow by default has the pawn to thirdpersonbp

#

i need to change that just for 1

frail temple
#

just remove it, have none if you want.

frozen moat
#

if i do that i have to also do it for 0 then right?

frail temple
#

I have no pawns in menu/lobby levels.

#

Nobody will have a pawn if GameMode default pawn = none

#

because on my game you can select which class you are, I set it to default = none and called the spawn request on the server for the players selected class.

frozen moat
#

how do i spawn the pawn again

#

😛

frail temple
#

You do a server call Spawn Actor From Class and then you Possess it with the player controller

#

It's a server call so it gets replicated to all the clients connected.

frozen moat
#

werid i don't see anything in details panel

frail temple
#

Also, make sure the Pawn has Replicates to true

frail temple
frozen moat
#

spawn actor

#

to do a server call

#

oh i have to create events right

#

my bad

frail temple
#

^

#

Yup

#

Does that all make sense? You get it working?

frozen moat
zealous knoll
frozen moat
#

i need to somehow get the reference for the player start in game mode

#

and also posession

frail temple
#

By reference you mean their class choice?

#

I didn't figure it out so I just did a Cast to the "parent" bp I'm using. You can always pull from the return value and cast to pawn to get the Possess

frozen moat
#

player start object that's in the map

#

i need to get it's reference to get the spawn transform

frail temple
#

I did BeginPlay > Get All Actors Of Class and put them in an array and looped through it for each controller so only 1 would spawn on each

#

BUT I think OnPostLogin gets called before the BeginPlay event.

frozen moat
#

looks good?

#

and this is what i did i duplicated the third person player for now and changed one of the material

#

called it second player

#

it didn't work

#

@frail temple ok my class ended

#

and i have like 15-20 mins for before my next class if you want to do that vc again

frail temple
#

@frozen moat sorry I was in a game of LoL and afk. I'll be available a bit later if you still need help

frail temple
frozen moat
#

i got it working

#

but it seems like i might not have the class

#

:p

agile adder
#

Hey does anyone know why the movement becomes all jittery when changing the max walk speed at runtime? this happens only in client server and not in standalone but it happens both if i run the "set" code on the client and on the server

frail temple
#

Don't you just need to set it up on the Server? Begin Play > Custom Event (CL) > Custom Event (SR) Set Max MS? Or I could be wrong

echo bough
#

You need to predict the changes by changing it locally, then server changes it, replicate to client to update again.

#

Or to start, you can do the latter portion first

#

Only server changes, replicates the variable to client, using onrep to set speed on client

agile adder
#

thanks! I wasted too many hours on this

echo bough
#

Most prediction kinda goes by the same rule, update it first, server updates too, then replicate to update again.

#

Not really a multiplayer expert, but i understood it that way.

#

I certainly hope its correct 😅

agile adder
#

fair enough ahah

civic valley
#

Hello everyone, i wanted to ask something. How can i replicate the get actor rotation node? Because ive been trying but im not getting any result. Would be glad if someone can give me any tips or suggestions on how to do it.

unique forge
#

hellow there, having problem with the leaving lobby system, when i leave the lobby as a normal player, i cant rejoin the lobby

#

the session was found but can not join the session

sharp vigil
#

question, wondering if its performant in a multiplayer RTS to use actor components to keep track of which unit belongs to which team?

severe bough
sharp vigil
#

I mean eventually I'd want to. But for now just trying to learn UE game framework before I deep dive into more specialized systems

queen escarp
#

Hey guys question what would be the best way of blocking players to join if game is “on”? (Listen server)?

severe bough
# sharp vigil I mean eventually I'd want to. But for now just trying to learn UE game framewo...

Then I would probably make a base class for all the units that contained common info such as team that all units need, and then use subclasses for the individual unit types. Actor components are best use for adding functionality that only some actors will need. For example, if some units have weapons and others have an inventory to carry things, you could use actor components for each.

ocean phoenix
#

Hello guys! Does anyone encountered the problem that some components are not loaded on clients on time (In Lyra they added dynamically btw)? For example, server knows about first person mesh comp I've created for Lyra Hero, but client still has it as nullptr. I cannot operate on those comps nor on BeginPlay(), neither on other events which I fired recently after BeginPlay(). If I do my stuff after, for instance, 0.5s - this will work. Any ideas how to solve that issue?

jovial stream
#

Hi, I am encountering a very annoying but where whenever I try to send my player transforms (motrion controller data, player data, and camera data), the skeletal mesh becomes super laggy even though the transforms are sending smoothly.

However, this ONLY happens when I have either physical animation or physics control applied to my skeletal mesh. Any ideas how to fix this?

jovial stream
ocean phoenix
jovial stream
#

yes no problem

hoary spear
#

Postlogin in gm, or possess in pawn /playercontroller

fluid summit
#

Hi!

does anyone know if TSets and TMap are still not replicated?

grand kestrel
#

It has been made pretty clear that TMap shouldn't be replicated and that it would be a bad thing thus it won't happen

fluid summit
#

checking just in case, thanks!

#

-Goes back to use array

unique forge
#

Hi there

#

Um im having a Problem with the server Traveller or not

#

everytime when I start the match in a lobby with friends blabla

#

i have to hold left click to look around

#

walking etc works normally but I have to hold left mousclick to look around

fossil spoke
#

You have a "focus" issue

unique forge
#

Mb

fossil spoke
#

It is likely that you have caused the UI to retain focus.

unique forge
#

Oh okay

unique forge
fossil spoke
#

@unique forge As I said its not likely anything to do with travelling, you should ask in #ue5-general

short arrow
#

Is it possible to essentially stop clients from practically shuffling a net serialized array? Anytime I remove an item from the array on the server the clients just completely unorganizes everything.

#

Ex: if I remove index 3 on the server, what was index 4 for clients can possibly become index 0

#

It's super weird

#

Like just become the new index 3 bro

twin juniper
#

I appreciate any help.I created a third person template (C++) however when enabling network emulation with an average profile I am noticing a heavy stutter, I mean, it makes a very unpleasant gaming experience with a 'real-world' lag setting. So is this normal CMC operation? If so, could you point me to some solutions? Thanks!

#

worth noting the same behaviour occurs when using Clumsy to simulate real-world network operations.

dusky yoke
#

Hey guys. On BeginPlay I have my actor spawn a fireball on a looped timer. My client's seem to be out of sync with the server's spawning of these fireballs - how can I sync this? Is it just an editor thing, as the client starts its own window, or is it an actual initialization issue?

unkempt tiger
#

during replay playback, is the replay system supposed to 'resend' the same packets the server originally sent out?

mortal mica
#

Any idea why this happens? T

[2023.10.08-01.30.12:826][610]LogSockets: Warning: Tried to bind address with protocol STEAM to a socket with protocol IPv4
[2023.10.08-01.30.12:826][610]LogNet: Warning: Could not create socket for bind address 76561197984884899, got error SteamSockets: binding to port 7777 failed (0)
[2023.10.08-01.30.12:826][610]LogNet: Warning: Encountered an error while creating sockets for the bind addresses. 
[2023.10.08-01.30.12:826][610]LogNet: Error: InitBindSockets failed: 
[2023.10.08-01.30.12:826][610]LogNet: Warning: Failed to init net driver ListenURL: /Game/Scavenger/Maps/DevMap?listen: 
[2023.10.08-01.30.12:826][610]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = NetDriverListenFailure, ErrorString = , Driver = GameNetDriver IpNetDriver_0
[2023.10.08-01.30.12:826][610]LogNet: Warning: Network Failure: GameNetDriver[NetDriverListenFailure]: 
[2023.10.08-01.30.12:826][610]LogNet: NetworkFailure: NetDriverListenFailure, Error: ''
[2023.10.08-01.30.12:826][610]LogWorld: Failed to listen: 
[2023.10.08-01.30.12:826][610]LogNet: DestroyNamedNetDriver IpNetDriver_0 [GameNetDriver]
[2023.10.08-01.30.12:826][610]LogNet: Error: LoadMap: failed to Listen(/Game/Scavenger/Maps/DevMap?listen)
#

(the first warning is repeated dozens of times)

mortal mica
honest lantern
#

why does this only work for the first client?

#

i dont have the events replicated

#

(ping me pls)

fossil spoke
#

You should not be relying on the indexes that elements exist in to be in order.

#

If you need that, then you will need to setup some mechanism to identify their order separately.

fossil spoke
short arrow
# fossil spoke Array order is not guaranteed in any way.

Right so I get that but I'm afraid to loop through an array everytime I need to "get" something. Like what if I had an array with 1000 entries and I looped through the entire thing. Could c++ handle this efficiently? Maybe I am overthinking the costs

#

I could just profile it but I am for some reason convinced it will be an expensive process

fossil spoke
#

1000 elements is nothing

#

If you had 1m elements, then maybe you need a different solution.

short arrow
#

Okay so I am way overthinking it

#

Oh wow

#

I mean blueprint looping 1,000 times seems scary to me

#

Maybe I am severely underestimating c++ capabilities

fossil spoke
#

You are

honest lantern
fossil spoke
fossil spoke
#

GameMode only exists on the Server

#

Thats why its only working for the Host

honest lantern
fossil spoke
#

The GameState has a list of all Players that are accessible to everyone.

#

Use that instead

honest lantern
fossil spoke
#

You dont. PlayerControllers only exist on the Server and for the local Player.

#

The PlayerState exists to represent other Players to each other

#

You need to read the Network Compendium in the pinned messages.

honest lantern
#

i see

#

that makes sense

#

so is there another node i could use to replace the set view with target blend?

#

@fossil spoke ?

fossil spoke
#

No there isnt. You likely need to rethink your approach

honest lantern
#

agh

honest lantern
#

ive been confused for like 2 days..

honest lantern
#

also if it would help you can ask any questions about what i have set up here

tropic snow
#

Is there a way to avoid lag spikes in a team death match? Happens when players respawn..

fossil spoke
pearl bear
#

Hello, I am developing a racing game and I would like to get your opinion on my approach to networking. My vehicle works with physics, the first thing that comes to my mind is to send values such as speed to the server with ServerRPCs and apply the necessary forces within the tick. I wonder if this approach is correct. Is this how racing games in the industry work?

whole solar
whole solar
pearl bear
whole solar
pearl bear
#

So I can compensate a portion of lag

whole solar
pearl bear
#

Thanks a lot

twin juniper
whole solar
twin juniper
#

I see, thanks. Could point me to some info about it, that would be greatly appreciated!

whole solar
grand kestrel
#

Err... I just read up. You're getting incorrect information. CMC works out of the box and with network emulation or clumsy too

#

You definitely don't want to implement lag compensation in CMC, because it already has it, you'd just be breaking it

twin juniper
#

Hi Vaei, thats what I though : /

#

mmm, could this slightly desync caused when network simulation enabled be related to default settings? I watched a video about fixing rubber banding

grand kestrel
#

Can you show your lag compensation settings

twin juniper
#

default values, using Average and Bad profiles with ue 5.3.1

grand kestrel
#

These are mine

#

I don't know the default values or 5.3 sorry

#

Do the default values have any packet loss

twin juniper
#

1 sec 🙂

#

yes

grand kestrel
#

Remove it, packet loss isn't part of a normal simulation
It does occur when something goes wrong, so you do need to use it sometimes to make sure corrections are being handled properly, but for regular testing it should be off

#

Any time you lose a packet it should desync, its specifically what you want to happen

twin juniper
#

ah! that totally make sense! :D. This are the settings of the Bad profile

grand kestrel
#

Yeah that's basically simulating a faulty connection

#

Which is worth doing, on rare occassion, not each time 😄

twin juniper
#

ah so the desync is expected to happend 🙂

grand kestrel
#

Yes when packets are lost the inevitable result is something goes out of sync and then its corrected

whole solar
twin juniper
#

thank a lot for help, it was driving me crazy hehe

grand kestrel
#

Also because you have 100-200 on both incoming and outgoing you're going to get closer to 200-400ms latency

grand kestrel
twin juniper
#

yes, I was trying to 'test' maximus

#

and reconciliation, causing the location pop when needed right?

whole solar
grand kestrel
#

OK?

twin juniper
#

thanks for help, I appreciate it!

velvet jacinth
#

Why the user widget isn't displayed in the client ?
Inside the ConstructUI the function ConstructIngameHUD exists.

grand kestrel
velvet jacinth
#

I do call add to view port after that function.
It shows on the server but not on the client

thin stratus
#

The client may/will return false, cause the Pawn/Character isn't actively possessed yet

#

In Multiplayer you always have to use Events that make it absolutely clear that you have everything available/setup that yo uneed to perform your code.

#

So here it's better to use an Event that calls when the Pawn is actually possessed.

#

PossessedBy would come to mind, but that's ServerOnly.

Next alternative would be an OnRep_Controller, but that's C++ only (and wouldn't call for the Server).

For BPs you can use OnControlledChanged, which calls for Server and Local Client, so there you can do IsLocallyController and do your UI stuff.

queen escarp
#

hey guys question

#

so im using this code to join the listen server

#

is there a way to get information from the server before joining ?

#

to check for a bool inside the game mode for example

grand kestrel
# thin stratus PossessedBy would come to mind, but that's ServerOnly. Next alternative would b...

@velvet jacinth

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

    TryTestCharacterReady();
}

void AMyCharacter::OnRep_PlayerState()
{
    Super::OnRep_PlayerState();

    TryTestCharacterReady();
}

void AMyCharacter::OnRep_Controller()
{
    Super::OnRep_Controller();

    TryTestCharacterReady();
}

void AMyCharacter::PossessedBy(AController* NewController)
{
    Super::PossessedBy(NewController);

    TryTestCharacterReady();
}

void AMyCharacter::TryTestCharacterReady()
{
    if (bIsCharacterReady)
    {
        return;
    }

    if (!GetController() && GetLocalRole() > ROLE_SimulatedProxy)
    {
        // Warning: This means that characters that don't have controllers can never be made ready
        return;
    }

    if (!GetPlayerState())
    {
        // If we are possessed by AIController and don't want a PlayerState, then we're ready
        if (!GetController<AAIController>() || GetController<AAIController>()->bWantsPlayerState)
        {
            return;
        }
    }

    OnCharacterReady();
}

void AMyCharacter::OnCharacterReady()
{
    if (bIsCharacterReady)
    {
        return;
    }

    bIsCharacterReady = true;

    if (OnCharacterReadyDelegate.IsBound())
    {
        OnCharacterReadyDelegate.Broadcast();
    }

    K2_OnCharacterReady();
}
grand kestrel
# queen escarp

@queen escarp sorry I just scrolled your question off, didn't mean to

queen escarp
#

x) np

#

Cedric Neukrichen probably know this im reading about his suggestion thath once u joined then use the post login function to dissconect and that was my first though however would be nice to get info even before joining but that might not be possible

thin stratus
#

Also have a Widget that does something similar

grand kestrel
thin stratus
#

Cause there are Games where the Character gets destroyed and has to be relinked to the Widget

grand kestrel
#

Doesn't have to be elaborate, but just something simple like... what I posted

thin stratus
#

cause their original stance on this stuff is: You all have the ability to add this yourself and release a plugin.

grand kestrel
#

Gosh, those poor new users

thin stratus
#

Best example: AdvancedSessions

thin stratus
#

The only two native things you can use are Sessions, where your boolean is a SessionSetting.
Or the whole nightmare setup that Beacons are (C++) to connect to the Server beforehand, without actively joining it.

queen escarp
#

aye i figured,

#

so i guess ill use your dirty suggestion then

#

thats how i imagained it first also tbh easy fix

#

( for now =

thin stratus
#

Yus

queen escarp
#

hmm i do remeber theres a way in BP´s to get a players IP right ?

#

and ping

thin stratus
#

Not to my knowledge

grand kestrel
#

PlayerState has ping

thin stratus
#

I think they meant actively ping the Player by IP

grand kestrel
#

Ah

thin stratus
#

But maybe I read too much into it

grand kestrel
#

I only do gameplay multiplayer 🤣

thin stratus
#

That's also the sanest thing to do

grand kestrel
#

I've never been called that before hmmGe

queen escarp
#

hmm

#

am i missing something, when another player in game game dose something im switching the bool "game started" on the game mode

thin stratus
#

You can't use the delay like that

queen escarp
#

and if i new player joins and the bool is true do >

thin stratus
#

It's easy to forget but as soon as you delay even by a frame, the input of your PostLogin is not guaranteed to be the same anymore

#

If two players join close to each other you would already have an issue

queen escarp
#

oh ok well the delay was just a test i removed it dident use it*

thin stratus
#

Why is that boolean marked as replicated :D

queen escarp
#

but is the event on post login happening before game mode ? no that cant be the case since it always running `?

#

idnno * since its only held on the server 🙂

#

altho it dose nothing if replicated right ?

#

if its only on the game mode

#

just uncessary

thin stratus
#

Yop

#

You have 2 delays there though

queen escarp
#

oh right

thin stratus
#

But I don't get what your issue is

#

is the boolean is not turning true?

queen escarp
#

oh right yeah that was the problem 😛

#

sec

#

lol im not chaning it anywhere-.-

#

dumb

#

aye so that works

fiery saddle
#

Hey, do you know how many units Unreal can handle (on and off screen) for a rts multiplayer game using the Actor framework (and not ECS) ? I guess there is a lot of factors to take into account, but I just need a gross estimation to know if I should move to ECS right now. The game would be of the unit number scale of age of empire or starcraft.

sharp vigil
#

I've read about 1000 actors? Take that # with a grain of salt though. Your mileage may vary.

fiery saddle
#

We are talking about actors on screen or on the whole map?

sharp vigil
#

I don't know honestly. I'm pretty new to multiplayer programming in UE. Maybe someone else can respond who is more knowledgeable.

quasi tide
#

Definitely don't use Characters

#

Won't get SC levels of units with that class.

sharp vigil
#

So Pawns are out of the question then? 😄

fiery saddle
#

In that case, You would recommend using their experimental ECS framework ?

quasi tide
#

It has no networking support really. So it depends on how much you're willing to do

quasi tide
#

But you wouldn't need Pawn in an RTS for the units anyway

sharp vigil
#

What would you recommend?

quasi tide
#

Just regular ol' actor

sharp vigil
#

ah ok

quasi tide
#

If you're trying to stay in the Actor framework that is

sharp vigil
#

Thanks Durox.

fiery saddle
#

yeah thanks

sharp vigil
#

Nic you could use the replication graph system to get more mileage out of your game. That's mainly for networking purposes and dealing with large amount of actors in a multiplayer game. ECS is probably good if you dont want to do multiplayer games.

fiery saddle
sharp vigil
#

Yeah I agree, prolly not doable in 2 hours of work :D. If your goal is to ship something in the same year you start development I'd say good luck. (it's super sick though)

fiery saddle
#

Yeah my point exactly, would make sense if I was fulltime on it but meh. Also considering Unity ECS framework at this point

quasi tide
#

Not to mention, it requires a pretty deep knowledge of some fairly low level stuff

#

Extremely low level

fiery saddle
quasi tide
#

That is probably extremely lightweight compared to what GB has done

#

So lightweight that I wouldn't be surprised if it is about as equivalent as having never done it at all.

#

(Obviously you don't need to be as extreme as GB though)

fiery saddle
#

I did my fair share of doing stuff from scratch, that's why I decide to use a framework for once, and I am here on unreal, being limited by the technology x) So yeah, I will not going into the cuda/directX etc path. I will try to figure something out with what unreal offers.

What do you think about a "squad" system like dawn of war did. Maybe there is a way to create a "squad" character actor which is lightweight on the replication, and do the singular units processing on the client ? Downside would be all clients wont see the exact same things (like the positioning of singular units on the squat would be determined by the clients)?

quasi tide
#

For large unit numbers, stay far away from the Character class

#

The CMC is going to be too heavy

sharp vigil
#

What does CMC stand for?

quasi tide
#

Having multiple "units" be represented by one actor is a common trick devs use though.

#

But still, do not use character for a game with large amounts of unit counts

velvet jacinth
#

I'm calling this function on tick.
I created a custom function to control the rotation on the character and unchecked in the character blueprint - UseControlRotation, Orient etc... The player controller doesn't control any rotation.
The client rotate perfectly and I can see it on the server side.
But when the server moves his YAW locked and he doesn't rotate in the direction of the movement.
I just can't figure out what's the problem here.

fiery saddle
sharp vigil
#

Was wondering if I could get some input on this idea for keeping track of ownership of units in an RTS?

I was going to have a team actor component attached to all my actors. This would have a unique ID and their team on this component.

In gamestate:
I would have map mapping all unique ID's to their team. So if I needed to update anything with regards to ownership of an actor.. like an actor dies then just delete them from this map in gamestate.

Any thoughts? Does this seem reasonable?

Now that I type this out I'd need an easy way to grab the component and update the it..

stuck cloud
#

I just started playing around with Unreal 3 weeks ago. How would you go about implementing shared screen multiplayer with (mostly) turnbased mechanics?

The way I understand it, it would be best for every physical player to get an instance of a playercontroller which all control an instance of a pawn, which then would get input only when its their turn. All the pawns would then somehow share the same camera.

#

Also I want the players to be able to move small units around, but I think those wouln't have to be pawns right?

#

(sorry for the basic questions, there are still a lot of things that I didn't fully understand)

willow surge
#

Well the logs just show the msg
[2023.10.08-14.23.28:844][324]LogNetTraffic: Error: UActorChannel::ProcessBunch: New actor channel received non-open packet. bOpen: 0, bClose: 0, bReliable: 0, bPartial: 0, bPartialInitial: 0, bPartialFinal: 0, ChName: Actor, ChIndex: 11, Closing: 0, OpenedLocally: 0, OpenAcked: 1, NetGUID: 0 [2023.10.08-14.23.28:961][333]LogNetTraffic: Error: UActorChannel::ProcessBunch: New actor channel received non-open packet. bOpen: 0, bClose: 0, bReliable: 0, bPartial: 0, bPartialInitial: 0, bPartialFinal: 0, ChName: Actor, ChIndex: 11, Closing: 0, OpenedLocally: 0, OpenAcked: 1, NetGUID: 0

#

and keeps giving the error. If I recconect to the server I can play again.

#

The issue is:
[2023.10.08-14.38.03:354][493]LogBlueprintUserMessages: [B_Crowbar_LyraPlayerController_C_0] Player Pawn: Not Valid
I think? As I don't have a valid pawn assigned I can't play? We do have a valid Controller, PlayerState and UniqueNetId (just for loggin)

#

I just don't undertand why it's happeing so random? It's just the Lyra Sample Game, No default assets change or anything.

fallen orbit
#

Hey guys. Is there a way to manage all the sessions running? I am new to multiple-player stuff and I think the system UE5 offered is so weird. How can I debug for the dedicated server part?

#

I want a way to controll all the player controllers and build a kind of subsystem to deal with these controllers, so I can controll all the players more freely, like assign them to specific session or something else.

#

Anyone can give me a hint on this? Thank you very much

twin juniper
#

so im having some issues trying to figure out how to replicate this item picking up feature, any ideas?

#

nevermind i figured it out, if anyone wants to see the results just let me know i can share :)\

velvet jacinth
#

Created an inventory system base on an array of UDataAsset that I inherited in c++
I then populate the inventory array with empty slots calling with an event on server.
Why the inventory doesn't load on the client and only on the server?

dark edge
velvet jacinth
hushed rain
#

Is there a way to replicate an actor for a short amount of time (like after a trigger)

#

(in blueprint)

unkempt tiger
#

oh god my replay playback is so broken

#

i really kind of expected it to work seeing as normal gameplay works

#

and i figured 'it'll just be as if im controlling another pawn while every other actor will be a simulated proxy and the packets sent from the server will replay'

#

but barely anything works :((

grave lynx
#

Hey, using the OnlineSessionSettings in my join function, I'm trying to use the Get method to get settings defined in the create session function.

FName Value;
result.Session.SessionSettings.Get("MatchType", Value);

But can't compile and have this error:
unresolved external symbol "public: bool __cdecl FOnlineSessionSettings::Get<class FName>(class FName,class FName &)const " (??$Get@VFName@@@FOnlineSessionSettings@@QEBA_NVFName@@AEAV1@@Z) referenced in function "public: void __cdecl UEVMultiplayerSessionsSubsystem::JoinsSession(class FOnlineSessionSearchResult const &)" (?JoinsSession@UEVMultiplayerSessionsSubsystem@@QEAAXAEBVFOnlineSessionSearchResult@@@Z)

fossil spoke
#

@grave lynx Did you forget a module dependency in your Build.cs?

grave lynx
#

I mean no x) I don't think so

rose turret
#

I have a game that allows clients to draw a sketch and it shows up on the screens of other players

I'm using a texture render target to do the drawing, but now I need to RPC that around so the other users have access to it

I'm getting LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: TextureRenderTarget2D /Engine/Transient.TextureRenderTarget2D_2 NOT Supported which I assume means that I can't send a render target in an RPC

is there another way I can get that information across the network?

thin stratus
thin stratus
# rose turret I have a game that allows clients to draw a sketch and it shows up on the screen...

Probably only 2 options:

  1. Send the data needed to recreate the drawing instead of the drawing and draw the image again on the other Player
  2. Turn things into a Texture2D, serialize it and send it like that and then deserialize it back to a Texture2D object on the other Player. That's C++ though and also more a "This should work." Idea. Can't give you more on that. Might be that there is a similar way.
rose turret
thin stratus
#

uint8 array yeah

#

Pretty sure the texture type already has something for that but it's mostly an idea cause I haven't actively done that yet

round mist
#

Quick question. When an actor becomes net relevant again, is there any way to trigger blueprint logic at this point?

solar stirrup
#

If so: BeginPlay() gets called again once it spawns from replication

velvet jacinth
#

Question,
I'm calling an event called DropItem on server, first checking if has authority, if does then calling the actual drop item function.
This logic doesn't work on the client side only the server.
But, if I do not replicated the DropItem event, it works perfect on both of them.
Is it that problematic to not use event replication? without using also the has authority ?

solar stirrup
#

And then replicate the fact the player doesn't have the item to the client

velvet jacinth
#

But the client never have authority

#

This too doesn't work. only the server drops the item
Also, When I do not replicated any event (when it works) I'm calling get owner (in the inventory component) to get the actor location.
Then the client drops at the server location and the server drops at the client location 🤔

When setting a text in the inventory widget, using GetOwningPlayer it prints for both the same player controller.
Although that GetOwningPlayerPawn shows 2 different player pawns.

solar stirrup
#

You can only call server RPCs in an actor you have ownership of (generally player controller and your possessed pawn)

#

@velvet jacinth

#

Includes components of said actors

#

You also probably don't wanna be using a multicast rpc to drop on everyone

#

this is a good read

queen escarp
#

Where can i find

bShouldUpdateReplicatedPing ??

#

cant find it anywher not of google either

silent valley
queen escarp
#

i cant find it there wher 😮

#

class defaults ?

#

@silent valley

silent valley
#

yeah should be in class defaults

queen escarp
#

cant findf it ://

#

u sure ?

silent valley
#

yep, definitely there 🙂

#

did you derive PlayerState for your own class?

queen escarp
#

yeah

#

i have a custom player state yeah if thats what u mean

silent valley
#

what version are you on?

queen escarp
#

5.1

silent valley
#

Should definitely be there

queen escarp
#

what tha hell ?=??

#

dont have pålayer state only game state

silent valley
#

You need to make a custom Player State too

queen escarp
#

ohh

#

where do i asign the player state :/

#

oh sry

#

just saw it

#

same place

silent valley
#

you set the type of Player State to use in your Gamemode

queen escarp
#

obvi

#

yeah

#

dident even know there were 2 seperate ones

#

nice thanks

velvet jacinth
# solar stirrup this is a good read

Indeed a good read thanks for that!
So just to clearify, If I would print the GetPlayerController from the begin play on the player pawn, it will print the same PlayerController instance for the client and the server (?)
Client: PlayerController_C_0
Server: PlayerController_C_0

solar stirrup
#

I think so but do try it out

queen escarp
#

why would this cast fail :/ ?

queen escarp
#

cant a widget get a referense to game mode 😮 ?

solar stirrup
#

And widgets, unless you're on a listen server (a player is also the server) or standalone, are client only

queen escarp
#

im on listen

#

asye

#

aye but still

#

if the widget is owned by a client

#

then that widget shuld be able to get a reff to the gamemode via him right O.o

#

also why is this failing :/

#

on event post login im adding to "all player contrller" array annd then looping casting from those controllers to the player Bp

#

i dont get it 😮

thin stratus
#

You aren't really sharing enough to help you

queen escarp
#

i mean all im trying to do is to cast to all players controller from withing the controller i get a reff to the player and do stuff

thin stratus
#

What is the goal here anyway?

queen escarp
#

well

thin stratus
#

And what does UpdateHeroFriends do

queen escarp
#

So basicly i have player frames on UI

thin stratus
#

That looks really wrong

queen escarp
#

well im kinda hooking up an old system but

#

ok so each unit frame is a widget and the widget updates all stats based on the player chracter index

#

and that im doing when updating friends basicly is setting the index and check how many frames should be seen*

#

but its breaking from the Gamemode first instance

thin stratus
#

You should not use the PostLogin event to update UI.
For one you can't even make sure the Character is valid at that point, and on the other side, you would need to ClientRPC to even get the UI.

queen escarp
#

why not post login ?*

thin stratus
#

Why would you use PostLogin? (:

queen escarp
#

im checking if character index is valid tho*

#

why not 😛

dark edge
queen escarp
#

how else would i detect when player joining/leaving

thin stratus
#

Well you seem to think that PostLogin is the right choice

queen escarp
#

lawl

thin stratus
#

Yeah but your UI is not interested in that

#

Your UI is interested in the Characters

queen escarp
#

this is how im updating the "UI" frame

thin stratus
#

That Index is not for online Multiplayer

queen escarp
#

so update friends calls this initializing

#

oh

#

This will not include characters of remote clients

#

....-.-

#

that make sense

thin stratus
#

Well, either way, you shouldn't use PostLogin to begin with

#

If you need Characters to be valid, use Characters BeginPlay

dark edge
#

Just do it on BeginPlay of the Character, that'll ensure at least 1 character is around

queen escarp
#

true

dark edge
#

Then when other characters join, they'll call begin play, letting you know to update

#

I'm not 100% sure you won't have a race condition with Player array or anything but it'd be a lot better than anything Gamemode-side

thin stratus
#

In BPs this is shitty either way

#

You'd still need some sort of Index (custom) to make sure they are ordered

#

Or just loop the 4 widgets and take the first that has an invalid character reference i guess

#

Order on everyone would be different though