#multiplayer

1 messages Β· Page 531 of 1

odd iron
#

without refreshing

chrome bay
#

You can't. Anybody viewing that data needs to refresh it

#

When a player joins a server, the server updates the count and updates the "master" server which advertises it with the new data

#

Other players have to "refresh" their view of the master server to see those changes

#

You could continuously refresh if you like, but you would have to modify the engine to handle this better.

odd iron
#

Can't i just update the Variable that holding the current player number ?

#

like +1 every time player joining

chrome bay
#

How can it if it doesn't know who is looking at the data?

#

The "server browser" doesn't ask for information from servers directly, it gets the information from the "master" server for the game.

#

Otherwise those servers would be constantly hammered from outside packets querying it for info

odd iron
#

Yes its working when the players refreshing the list

chrome bay
#

Exactly

#

Players have to refresh the list themselves

#

There's no alternative

#

So as a "sort of" solution, you can just keep refreshing the list

#

We found that Steam stops showing you servers if you do it too often however

#

Getting a list of servers is a one-way transaction. You can ask for info, but the master server cannot tell you the info

odd iron
#

Yes i have assigned the refreshing when player clicks on Server browser button

#

or refresh button

chrome bay
#

yep, and you'll get a list from the subsystem of what servers are currently available and any advertised properties.

#

But only the list as it currently stands

odd iron
#

sometimes full servers not showing

#

even if hide full server unticked

chrome bay
#

Yeah, steam master servers don't always give you the info reliably

#

Especially if you search too often

odd iron
#

ok got it

chrome bay
#

I have a huge thread on UDN about issues with Steam searches, in the end we found the answer was to use the old advertising system for steam servers.

steep cipher
chrome bay
#

But there are hard caps on how much data you can advertise that way

steep cipher
#

will refresh players etc

chrome bay
#

That only works for dedicated servers too

odd iron
#

ok cool about servers list update i thought its because of we are using the appid of starwars and its have alot of servers

steep cipher
#

yeah but we're talking about servers and not lobbies afaik

odd iron
#

thats why its take time or not showing sometimes

chrome bay
#

Could likely be that yeah. It's probably a good idea to get your own appID when testing online features.

#

If not essential

rain coral
#

Does anyone know a guide or something for understanding the Network Profiler?
I'm comparing the profiling of a game where things went smooth, and one where it was very laggy (sending more info), and I can't see an obvious difference between the two.

Not sure what numbers are good and bad and what to look for.

chrome bay
#

Other than the huge initial spike nothing about that graph looks particularly bad

odd iron
#

yes that what i was thinking but at least i need to finish the maps before getting own appid xD

chrome bay
#

It tells you how much data each asset class uses, outside of that that's pretty much all it's useful for

rain coral
#

Yeah that's a player joining. Hmm, because that client warps around on the server's view when they're sending some extra floats ;/

chrome bay
#

The key is getting those numbers as low as possible

#

It's hard to say because its always very game specific

rain coral
#

But in theory if someone is sending too much info, it should be possible to determine it through this graph right?

chrome bay
#

You just have to look at how much data each individual actor is sending and why, then work out ways of trimming it down

#

You may also need to profile the server and client independently, you'll get two different graphs.

rain coral
#

Hmm yeah that's a good idea.
The lagging only occurs when testing through Steam (on a real build etc) now. Is there a way to provoke the same results with the settings in the editor with just the PIE windows?

chrome bay
#

Best way is to use Clumsy to see how the game copes with lag and packet loss

rain coral
#

Thanks, will check it out

chrome bay
#

Run PIE, then enable whatever effects you want in clumsy. It works out of the box thankfully.

livid holly
#

has anyone implemented a system where AI takes control of pawn when a client disconects? I'm having trouble trying to do so

#

I couldn't use GameMode Logout because I couldn't find the pawn from the controller argument

#

so on the Pawn, I override OnUnPossess to send the info to the game mode to spawn a new AI which will possess the pawn

#

the repossession works but I think the pawn is still sending Replicated functions to the client that doesn't exist anymore, causing the game to crash

rain coral
#

@chrome bay So I found the RPC that is sent (that is causing the intense lagging), from the client's profiling, and see that the total size is enormous compared to everything else, but the average size is same or lower. The struct that is sent in this RPC is exactly 4 floats and marked Unreliable, sent in the TickComponent of a CharacterMovement class.
Do you know what the big total size indicates?

hoary lark
#

22.7 x 2377

chrome bay
#

Yeah, it was sent 2377 times

hoary lark
#

what framerate is your game running in final build/steam vs PIE?

chrome bay
#

Even character movement doesn't send moves on ticks

#

It combines multiple moves into single packets and sends them at a lower rate, up to a maximum delta time between packets

hazy siren
#

yeah you're sending an RPC update every single frame, you definitely don't want that

chrome bay
#

Each float is 4 bytes, so 16 bytes per RPC

rain coral
#

Ahaa. I think the frame rate is uncapped for the clients and the server, so it could be running 120 FPS for example.
What's the recommended approach for sending RPCs like this? A repeating function called every x seconds?

chrome bay
#
  • the RPC headers
odd iron
#

the players can join the session even when the session is full

chrome bay
#

@rain coral The recommended approach is to never send anything on tick - my advice would be to override CallServerMove() in the CMC and put the RPC there

#

you will at least send the RPC at the same rate as the movement RPC's then

#

And unless you need full precision I would also compress the floats

rain coral
#

Ah, makes sense

chrome bay
#

but yeah otherwise, impose limits etc.

#

You can do simple stuff like this too:

#
{
SendRPC();
LastSentTime = GetWorld()->GetTimeSeconds();
}```
rain coral
#

Yeah. I think I assumed there was something like this behind the scenes taking care of send rates for RPCs

chrome bay
#

Nah nothing. Engine doesn't do any dynamic bandwidth control

rain coral
#

Well, glad to find the culprit, thanks!

odd iron
#

TheJamsh

#

When i make session with 2 slots 4 players can join

#

Im trying to open 4 windows one for host and 3 searching for servers they are finding the result at same time and when im joining with 3 of them without refreshing they are all joining

hoary lark
#

you're trying to enforce max player cap on the client side??

#

i don't know anything about this specific stuff, but .. figure it out proper πŸ˜„ the server handles how many people can connect, not the clients

odd iron
#

The session Public Connection is setted to 2

#

but 4 players can join if they found the server at same time

#

but if one of them refreshed the list he will not be able to find the server

chrome bay
#

Players will still be able to attempt joining yeah

#

The server should kick them out if they joined a server that's full

odd iron
#

So i must Check between the max server and current server when the player click join

chrome bay
#

no

#

You join anyway

#

Then if the server says "you joined a full session" it will kick you out

#

The client will also load the map too even if they get kicked. We implemented a server queue and joining via beacons to prevent that.

#

None of it is straightforward however

odd iron
#

oh

chrome bay
#

You are always potentially working with out-of-date information in the Server Browser.

odd iron
#

Yes that what can i see

chrome bay
#

You have to find ways to mitigate the problems yourself, like refreshing when trying to join for example, or refreshing continuously. There's no other way around it.

odd iron
#

But if used Refreshing Continuously will that cause Performance or not ?

pallid stone
#

@steep cipher With this query ping, how would I get the ip address to ping?

chrome bay
#

It's not a good idea to do it too often yeah

odd iron
#

So i will refresh each time player click

chrome bay
#

Perhaps the steam function that @steep cipher linked will make it easier though.

#

I.e, just query a single server instead of refreshing the whole list

pallid stone
#

Jamsh, is there anything about this server setup that would indicate someone could not find it in a query is they were using the same client doing a findsessions? https://paste.centos.org/view/afb0b8e3

chrome bay
#

I have no idea

#

this could be something, IDK:
SessionInfo: HostIP: INVALID SteamP2P: 76561197962486250:7777 Type: Lobby session SessionId: Lobby [0x18600000BFDCAF7]

pallid stone
#

Cannot find anything online about what that means

tawdry pond
#

Hello, so i am trying to make a pickup so when a client pickup a weapon all the others can't see it any help?

pallid stone
#

Replicate on server function, have the server do the picking up, give it to the client, then multicast a destroy function or other necessary cosmetics

tawdry pond
#

oof i will try

#

thx @pallid stone

odd idol
#

hoi

#

Does anyone here have experience in "chunking" UPROPERTY replication?

#

I have some massive structs I want to replicate, but running into max chunk size. Do I really have to split it into multiple UPROPERTYs, or is there some way to tell the engine not to send it atomically?

#

I don't even mind if OnRep is called multiple times, once for each chunk tbh

bitter oriole
#

You probably don't want to be using replication for anything over a few bytes

odd idol
#

Well I need to replicate it to clients... Are you saying I should be using reliable RPCs?

#

That gives me problems with late joins though

bitter oriole
#

How big are we talking here ?

odd idol
#

LogNetPartialBunch: Error: Attempted to send bunch exceeding max allowed size. BunchSize=71522, MaximumSize=65536

#

But I probably will have much bigger than that one eventually

tawdry pond
#

@pallid stone hmm now its not destroying (i have made it NetMulticast )

bitter oriole
#

And how often is that data updated ?

odd idol
#

Very seldomly HittyKitty

bitter oriole
#

@odd idol My advice would be to do a completely custom system then, using sockets, to transfer the data in bulk when connecting

#

"Much bigger" then 70KB isn't going to be doable every second on any network

odd idol
#

It's going to be a lot less frequent than that. More like a couple of times per session.

#

But I take it then that there is no support for automatic chunking in the engine :/

bitter oriole
#

Replication is built for constant, adaptative update of thousands of small properties, with a lot of logic to vary the frequency down to zero depending on distance, etc.

#

What you want here is a download, plain and simple

odd idol
#

It's unfortunately not that simple, but I appreciate the advice!

bitter oriole
#

No, it's not simple, but it's going to be simpler than getting replication to work with this

odd idol
#

I'll try to see if I can figure out a path forward. I don't think a custom socket solution will work for me. I would really like to leverage the reliability of the replication stack.

#

I'll post if I figure something workable out πŸ™‚

bitter oriole
#

Alright, but keep in mind it's reliable because it's a typically a 10KBps channel

tawdry pond
#

hmm its still not destroying @bitter oriole

odd idol
#

Good info, thanks! mUmlove

bitter oriole
#

I'm pretty sure replicating 1MB of data through replication is simply going to delay every single other update, breaking all movement for a few seconds

odd idol
#

Yeah, I think this will have to be a combination of things to make it work

tawdry pond
#

@bitter oriole it dose not destroying ?

bitter oriole
#

Why are you tagging me ?

tawdry pond
#

idk

bitter oriole
#

Read the link I sent you, and plan your multiplayer architecture based on that

#

You're not going to randomly find a working answer

cunning shoal
#

Does anyone here use ragdolls upon player deaths? If so, how do you typically handle them (do you replicate the impulse when players shoot them, or have it individualized? do you have collision on them?)

steep cipher
#

@pallid stone from the server list

odd idol
#

@bitter oriole Yes, thanks for the link. I have already read the docs though, I make it a point to do that before I ask here.
No-one said anything abut randomly finding an answer. Reading the source code and drawing conclusions is how I like to find mine.

It seems like a combination of breaking up the UPROPERTY and spreading out other replication might be the answer for me.

Thanks for the input though.

bitter oriole
#

So what is your current solution, how does it behave, and hjow do you want it to ?

odd idol
#

I don't know the answers to those questions yet. But I have gotten past my initial problem. I might ask some more questions later on if you don't mind though πŸ™‚

#

Well, the solution for now is what I mentioned above

#

But I probably need to do more work before it really behaves like I want it to.

bitter oriole
#

Basically if you want the server to do something, just use a reliable server RPC from an owning client

#

Multicast is for server to clients

odd idol
#

Yes, I am still considering solving late join by having clients ask for data.. But I also need partial updates of some of the data, so I don't think that works as a complete soution

bitter oriole
#

Wait, we're both confusing two discussions here

#

The link wasn't for you

odd idol
#

oh, well then πŸ™‚

#

I mean I don’t mind either way ❀️

bitter oriole
#

Same for the random answer part

odd idol
#

oh, oke

#

It's sometimes hard to parse discussions in Discord, it happens. shrug

bold totem
#

Hello! I am making a dice game and I have 2 types of actors, player type and dice type, the thing is that I would like the player to be able to save an array of dice actors to be able to control the play but I am unable to do so, could you help me?

analog rover
#

If you are trying to store an array of actor types, you could try using a TArray<TSubclassOf<ADiceActor>> and replicating that

bold totem
#

how can i do that if i am using blueprints ? D:

hazy siren
#

@bold totem make a variable of type ADiceActor (or maybe make an interface for it) and then there's a little bar next to the variable type you can use to convert it to a collection

bold heron
#

Hi Everyone.
I'm trying to pass an array of structures to my server so it can essentially roll some dice for me and replicate the results down. The server function i on the player controller to let it have authority but sometimes the array is null. Other times it's not. Not 100% sure why. Any thoughts?

#

It ends up crashing in cpp in the Invoke function before it reaches the actual graph.

violet geode
#

What do I need to replicate for animations to show on other clients?

dark edge
#

@violet geode Best practice is to replicate whatever is triggering or driving those animations.

toxic schooner
#

For mmo's is it better to have character data (inventory, health, experience) on the character bp or the player controller bp?

shut gyro
#

Is it possible to make an array of FUniqueRepl structs in BP and use the contains method? Doesn't seem to work for me - contains always returns true

#

Even when the values are different

final thicket
#

How does it work to have replicated actors spawned in the level?
does the server still create them, how would running code on them locally work before the server connection is valid?

#

@bitter oriole what do you mean by this, "You don't exactly have access to the level before the server connection is valid" ?

bitter oriole
#

I mean when you connect to a new server, you only see actors when the server gives them to you ?

#

But yes, they'll be created on the client first

#

And then they'll get the initial replication bunch

rain coral
#

Anyone knows about the best practice for clientside prediction and resimulation when it comes to extending the CMC?
Currently I'm overriding FSavedMove_Character and FNetworkPredictionData_Client_Character, and saving and applying inputs back with the SetMoveFor, PrepMoveFor and Clear functions. All the ticking code for the characters is called at the end of PerformMovement and SimulateMovement.

It's kind of hard to tell if the resimulation is working as intended or not, but just wondering if anyone has some do's and don'ts?

meager spade
#

that is the only way to do it

#

i do the same for sprint, and walk

#

its bad just to change the movement speed for big changes

polar wing
#

@rain coral Hey, you've definitely nailed most of it by the sounds of it, but consider doing your movement code in the OnMovementUpdated function (just override it). Those functions you mentioned call this function anyway. https://docs.unrealengine.com/en-US/BlueprintAPI/Character/OnCharacterMovementUpdated/index.html

SabreDartStudios does some amazing tutorials. Here's a CMC one that I found super useful. https://youtu.be/Of8SGBa3WvU

On Character Movement Updated

In this video I show the proper way to make movement abilities for your characters. This is done by creating a Custom CharacterMovementComponent.

We start from scratch with a third person BP project, but here is the completed project you can copy code from: https://drive.go...

β–Ά Play video
meager spade
#

only issue is debuffs/buffs that modify speed is pretty sitty.

#

ah Darntella's tutorial

polar wing
#

I've added stuff to PerformMovement and Simulate Movement before, but those were very specific things that pretty significantly modified how the move would be simulated. However, the same thing can be done by modifying MaybeUpdateBasedMovement for pre-move stuff, as far as I know.

rain coral
#

@polar wing Thanks, will check that out!
What kind of things did you put in PerformMovement/SimulateMovement instead of OnMovementUpdated?
We've modified a bunch of things, such as a how jumps are calculated (jumping lower/higher/further based on your speed and how much you crouch), and the hardest things so far to deal with is climbing, which involves using root motion to move and getting parented to a moving platform.

Is any of that a reason to not put something in OnMovementUpdated?

polar wing
#

in that case, I don't think there's much of a reason to move out of OnMovementUpdated. When it comes to climbing or "parkour" elements, you could create a custom movement mode and switch to it via a flag you set (like the bWantsMovementSpeedChange flag).

Then, you can write your own simulation code for how it's handled in the Phys_Custom function (basically follows the same pattern as the other movement modes, like how the walking movement mode calls Phys_Walking, except you create your own logic there). However, for simplicity's sake, you could try get away with sticking to the normal movement modes and maybe doing a few logic rewrites. This gentleman has a pretty decent video on how to do the custom movement mode stuff (it's not really a tutorial, so mostly just take a look at how the code works) https://youtu.be/DoZyH86n_gs.

When it comes to working with root motion, though, I'm unfortunately not very clued up.

Higher playback speed recommended. It makes those moments of dead air where I am figuring out what the hell I wrote more palatable. Also the mumbling.

Table of Contents
2:12 Sprinting
26:14 Jetpacking
55:02 Gliding
1:26:02 Networking

This project: https://github.com/HarryPe...

β–Ά Play video
rain coral
#

I see, well it's only the networking part that is kind of 'off' regarding climbing. On the server we've got it working properly by using the flying mode. Anyway, we don't need to get too deep into what's wrong there. Sounds like I should use OnMovementUpdated for ticking my character, and keep doing what I've done otherwise.
I kind of can't see a difference when commenting out stuff in PrepMoveFor and not, but maybe I'll make a 'rewind' functionality that plays through the entire client buffer just to see if it resets the character properly.

Anyway, thanks for the info!

polar wing
#

awesome, glad to help in any small way! I've been doing some pretty significant rewrites to things, so figuring out the best way to get them networked in the CMC has been a nightmare hahaha. I can't wait for the network prediction plugin 😫.

rain coral
#

Hah yeah, I've kind of been all over with my networking code. Have attempted custom server reconciliation and resimulation, before we learned more about CMC and that it makes sense to do do this in harmony with it πŸ˜„
I went absolutely mad over this stuff. I could basically rewind my entire character's state and watch the last minute be reperformed in near perfect detail like a movie, but when doing it in a for-loop in response to a server update, we encountered issues with jumping that was absolute torment.

polar wing
#

oooof I feel you. I also attempted to make a custom replication component at one point, but realised that the CMC just does so much for you.

rain coral
#

Aah. Yeah it's great to be able to extend it, and it's pretty customizable, but takes a lot of time to learn the proper ways to do things.
One of the main reasons why we went our own way with replication for a while was because of things like the client being able to set their own global time dilation and cheat their move speed ;D So we didn't trust it to be authoritative. Try it on your own if you want to see a hilarious exploit in the CMC ;S

jolly siren
#

CMC actually already has speed hack prevention

#

See bMovementTimeDiscrepancyDetection and bMovementTimeDiscrepancyResolution

rain coral
#

Oh thanks, will check that out!

jolly siren
#

It's disabled by default

#

No problem

fleet raven
#

it's disabled by default because it does not work without changes

#

for one, it does not prevent you from going slower than the server and doing things like floating after jumping off a ledge

#

and on long running servers (even a single day) it will slowly drift until it thinks everyone is speedhacking all of the time

rain coral
#

! Damn, sounds not too good.
We tried to 'validate' move distance on the server manually some time ago, and also struggled to not only limit how far you can move, but how 'short' you can move

#

I'm more curious why they take the client's time dilation as a truth to begin with

chrome bay
#

Hopefully they'll look at all this with the new movement stuff.

fleet raven
#

considering that has a fixed tick rate, it'll be way easier to add

chrome bay
#

yeah for sure

odd iron
#

Hey Guys GoodDay
im trying to Swap the Controller from lobby PC to Game PC the event not firing

#

i've tried to open the game stand alone and tried it from editor too samething

analog rover
#

Could I get some feedback on this layout for a simple networked equipment system?

#

Essentially, I'm thinking of adding a replicated property on each character to indicate what item the player has equipped, and then using a server RPC from the client to notify the server of an equipped item change

#

And calling server RPCs on the client for stuff like attacks, then having the server do multicast RPCs to broadcast the attack events

rain coral
#

@analog rover Sounds very reasonable to me at least! Replicated on the equipped item so new joining players can get the update, RPC + Multicast for the attacks which likely are just one-off events

analog rover
#

Thanks! I'm always a bit sure about what best practices for networking should be

grand lance
#

hey guys. So a few issues with ragdolls in MP. When I add an impluse to a player, I want them to go to ragdoll mode. Once they land, I blend the ragdoll into a get up montage. However, when I simulate physics on the mesh to ragdoll, it doesn't follow the capsule anymore. What's the best way to fix this?

analog rover
grand lance
#

yeah the issue is when the skeleton mesh gets simulated and detaches from parent. Do I need to replicate both that the skeleton mesh is simulated and pelvis bone location? Then have the server move the capsule component to follow the skeleton mesh position?

analog rover
#

Yeah, I think you'd want to replicate all the simulation toggles and movements just to make sure it's consistent across clients (imo)

odd iron
#

Hey Guys GoodDay
im trying to Swap the Controller from lobby PC to Game PC the event not firing
if you can see it guys xD

analog rover
#

@odd iron so you're switching the controller but the event isn't firing?

odd iron
#

Yes

#

i have set that in new gm and lobby gm same

analog rover
#

@odd iron are you using seamless travel to transition from your lobby to the game? It looks like the event will only fire on seamless travel

odd iron
#

yes im using seamless travel

analog rover
#

@odd iron sorry, I'm a bit out of my depth with this one since I've never really messed with seamless travel

odd iron
#

No worry mate i thought there is a check box or something i missed

analog rover
#

Can you verify that the player controllers are actually changing to the new type when you switch map?

odd iron
#

Yes i can use Printstring with Chat button one sec

analog rover
#

My last thought is did you put the OnSwapPlayerControllers event on the new game mode or the old game mode?

odd iron
#

Yes its switching

#

I've tried to use it in the new gamemode like this

analog rover
#

Sorry, I'm officially out of ideas πŸ˜…

odd iron
#

I remember in the past there was Seamless Travel Checkbox but i forgot where to find

#

or i dont know if its still exist πŸ˜„

#

no worry mate thanks for help

#

at least we tried :d

analog rover
#

Yeah - I'd love to help more but I'm still figuring out all this multiplayer stuff myself 😬

odd iron
#

goodluck

#

@analog rover You know sometime im being idiot πŸ˜„ i forgot to tick use seamless travel for Lobby GM

tall pine
#

Hi guys,

are all properties replicated together? so say I have 20 properties that were updated on the server in one tick (all in the same actor). after this unreal pushes them to the clients. in the next clients tick will all 20 properties be updated, or is it possible to get like 15 property updates on a tick, then the other 5 on the next tick?

ornate holly
#

Hey, I've been trying to set up a REALLY simple multiplayer using blueprints but it's not working correctly

#

I can have multiple players in the editor, but once I build the game, they can no longer connect

#

Maybe I'm doing something wrong, but if I am, any help is greatly appreciated

brazen sluice
#

Hello! I have a very simple BP that spawn an Actor around players. It's supposed to be local only, and is not replicated

  • In local it works
  • in networked with dedicated server it work
  • In networked without dedi, it breaks. Basicallly, the server player works, but the clients dont spawn the pawn anymore??
#

Disconnecting the two events is enought to make the clients work in a non dedi nertwork environment

#

Any help would be appreciated, thanks!

ornate holly
#

@brazen sluice What type of networking is your end result? Dedicated or P2P?

brazen sluice
#

I tried both, Dedicated works, but not P2P

ornate holly
#

But what's your end result?

brazen sluice
#

P2p, the server player work fine, but the client dont spwn anymore

ornate holly
#

What do you plan to launch the game with?

#

Dedicated?

brazen sluice
#

I'd like to have both working

ornate holly
#

Have you looked into the Switch has authority node?

brazen sluice
#

Same result

#

Client dont spawn the default pawn

#

OK I have more

#

It seems the clients are not allowed to perform a SpawnActor

#

But only with my specific class

#

Which is a C++ class

ornate holly
#

If the clients are not allowed to perform a spawn actor, then either let the server do it, or make the function to do so a replicated one

brazen sluice
#

It can't be replicated

#

But it's odd thought, I guess something is fishy in the class itself

ornate holly
#

Then use the switch has authority node

brazen sluice
#

It's only a static mesh generated with the lib RuntimeMeshComponent

#

OK Update it seems clients break when setting a Collision Mesh, going to ask the author of the lib thanks for your help @ornate holly

ornate holly
#

yw

#

Now I need help lol

#

When I build my game and open two windows, the players don't connect to each other

#

idk why on earth they don't since they connect fine in the editor

twin juniper
#

Umm is there any tutorial about how to create a loading level for the player to have fun while waiting while the server is loading

#

it is also including the loading of another level while not in it

#

Im ok with this one as well

#

I dont want the player to get in the game and walk through unloaded objects teleporting around

meager spade
#

GetPlayerCharacter in multiplayer

#

unless you know what you are doing

#

its very very bad practice.

brazen sluice
#

Oh really

#

How else do you get the player location ?

meager spade
#

there are plenty of other ways

#

but GetPlayerCharacter is a crutch, works fine in Singleplayer, but in multiplayer, i really don't trust it as far as i could throw it

#

i have never had to use it

brazen sluice
#

Expand xD what kind of other ways, I couldnt find any other node able to return a player handle in my BP

#

Or they all rely on the same mechanism

#

Do you mean looping throught player array and stuff?

meager spade
#

if you want the first player, i use GetFirstLocalPlayerController

#

but this it the local player

brazen sluice
#

Well I want the local player which Im assuming is the first one

meager spade
#

be it the listen server, etc

#

i never trust the indexes

brazen sluice
#

So the first player is always going to be the server even in the clients?

meager spade
#

there is no guarentee

brazen sluice
#

I mean surely there's a reliable way to get the current player in a client

meager spade
#

there is

#

GetFirstLocalPlayerController

brazen sluice
#

okay okay

#

Thanks Let me try

#

Dont have it in my context ^^

meager spade
#

actually

#

i think we made that specific :/

brazen sluice
#

XD

meager spade
#

yeah we did

brazen sluice
#

Does it return Player index 0 ? Lol

brazen sluice
#

Cool

#

That's probably more solid

meager spade
#

controllers only exist

#

on owning client and server

#

so GetController node on a client

#

with index 0 will be there controller

#

GetCharacter on the other end i don't trust/refuse to use

#

best way to get the local player pawn

#

anyway probably wont fix your issue of clients not having a pawn

#

if that was your issue (think we got sidetracked)

#

where is this logic?

brazen sluice
#

I was just checking Calibrator's idea of checkign for authority which did not work

meager spade
#

yeah but where is it

#

i need more context

#

cant really help with just that

brazen sluice
#

Yes yes
Essentially uppon spawning the world I create a terrain mesh, using RuntimeMeshComponent lib
The mesh is local to the player (since htey can be in 2 different spots in the map)

#

Everything work fine when using a dedi server

#

but in P2P the client are not allowed to set the collision box of the procedural mesh for some reason

#

Well I say "not allowed" but I have no error whatsoever

#

The pawn simply dont spawn if I call StaticProvider->SetCollisionMesh(CollisionData);

#

If I comment out the last line, everything is fine in P2P but obviously Idont have collision anymore

chilly mason
#

never thought I'd be debugging netcode w/ OBS

ornate holly
#

When I build my game and open two windows, the players don't connect to each other
idk why on earth they don't since they connect fine in the editor
Can someone help?

fading birch
#

are you using a dedicated server?

ornate holly
#

Yes

fading birch
#

are you opening one of your windows with the listen argument?

#

if you're using a dedicated server

ornate holly
#

I'm sorry but I don't have enough knowledge on ue4 to know what that means

fading birch
#

launch a window with the -server argument

ornate holly
#

Where do I put that argument?

fading birch
#

how are you opening them now?

ornate holly
#

I package the project then open the generated exe file

fading birch
#

oh

#

you don't need to do that everytime lol

ornate holly
#

🀦

fading birch
#

we all start somewhere

ornate holly
#

yeah lol

fading birch
#

also if you're wanting to test it as a packaged build, you also need to build your dedicated server

#

which requires you to build source

ornate holly
#

Wow thank you so much

fading birch
#

as for testing a dedicated server without packing

#

i'll DM you

#

to not flood the channel lol

cerulean escarp
#

hey y'all I just finished packing my game as a windows dedicated server, and I noticed that my search for servers function always returned nothing, and when I connected to the local server using open 127.0.0.1 I could join the server but got this warning:

#

is the warning related to not being able to find any servers? I should also clarify when I run the game in PIE with the dedicated server tick set to on, I am able to search for the server and it always shows up

shy kelp
#

simple question : is ip hosting local or global for multiplayer? meaning if the client types the ip of the dedicated server from anywhere, can they connect?

timid moss
#

@cerulean escarp iv always wondered what that warning meant. if you find out anything let me know

cerulean escarp
#

will do

ocean geyser
#

@shy kelp it should be global, ive had others connect through my IP before

shy kelp
#

Thx, Im new to networking so I need a lot of help lmao

neon path
#

Login failed: Tick the dedicated server checkbox

fleet raven
#

did you try doing what it tells you to

neon path
#

like?

#

you know this stuff?

#

@fleet raven

#

lets say im trying to do this with a shortcut arguement

fleet raven
#

to launch a dedicated server through the editor you pass your project file and -game -server

neon path
#

not exactly all i need

final thicket
#

Is it more expensive to send an Enum that is the size of a byte than a byte?

bitter oriole
#

No

meager spade
#

Enum == uint8

#

that is all it is

bitter oriole
#

Enums can be much more than this, but if it's an uint8, it's an uint8

final thicket
#

That's very interesting why don't they just store the EMovementMode in CMC? they specifically store the uint8 and they call it packedmovementmode ?

#

uint8 StartPackedMovementMode;

#

Why not,
EMovementMode StartPackedMovementMode;

bitter oriole
#

Because it's old as fuck, probably

final thicket
#

Actually it was recently changed...

uint8 MovementMode;

// Information at the start of the move
uint8 StartPackedMovementMode;```
meager spade
#

its just different name for same functionality

#

and they stored it before

final thicket
#

Perhaps it performs better as a uint8

meager spade
#

EMovementMode is not the new enum type

#

its the old type

final thicket
#

Oh whats the new enum?

brazen sluice
#

Hello all!
Was wondering this scenario:

  • I have an actor WorldManager which hold level information (There's a wall here, a chest there that's unopened, etc...)
  • I have clients who load / unload the world in local (Since they might not be in the same emplacement, they load what's relevant to them)

Up until that point everything is fine. Now, I would like to make the WorldManager server owned, and have the client do getStuff() in RPC, without having to replicate the whole world to every clients.

The issue i'm running into, is that clients can't execute RPC on actors they dont own (WorldManager) so my clients when LevelManager tries to to do WorldManager.getStuff(), will just drop the call since they dont own WorldManager.

Essentially my question is, how would you implement a simple getStuff / here'sYourStuff pattern within Unreal (using C++)

#

i have a

 UFUNCTION(Server, Reliable)
 Level* getStuff();

How do I call it from the client, to get the stuff, without having the whole world replicated?

#

Thanks for help!

meager spade
#

the RPC would have to be on the controller

#

and the controller (server side) calls Level->GetStuff

brazen sluice
#

Alright and since the controller is replicated, boom

meager spade
#

RPC's dont care for replication

#

it only cares for owning actor

#

a non replicated actor can still send rpc

brazen sluice
#

And I store the level infos on the controller itself

meager spade
#

yeah or w/e

#

but you just need to forward via the PC

brazen sluice
#

Well the levelActor would need to get that infos at some point so it's not a direct PC

meager spade
#

why not just replicate the level actor?

#

i mean what is stopping you?

brazen sluice
#

Because the level Actor spawns stuff, if I replicated you will get spawned stuff that are not in the same part of the world as you

#

You only spawn what's within a certain radius around you

meager spade
#

why you doing it like that?

brazen sluice
#

Open World, no boundaries

meager spade
#

hmm

#

looks like you want some spatialization grid system

#

and only replicate a subset of information to each client

brazen sluice
#

Yeah it's in an H1 octree

meager spade
#

depending on what nodes they can see

brazen sluice
#

yup

#

That's it

meager spade
#

Repgraph does that

brazen sluice
#

I have the tree already, just need to do a getNode() to the relevant places

meager spade
#

might be worth a dig into the code for it

#

oh

#

so why not replicate the subset

#

the actor can be replicated

#

but only replicate what is actually needed

#

for that client

brazen sluice
#

Not sure how to do this tbh

#

I'm assuming if I tell Unreal to replicate a client, it will replicate to all clients

#

not just the ones that are within a radius?

#

replicate a node*

#

Oh I see there's a distance based relevancy system

#

interesting

#

That's kinda heating up my mind TBH

#

So I set the "node" actor to replicate (multicast?) and I add distance based relevancy.
But then I need a client-only method to call the actual "spawn" may be, so I can stream the content of the nodes rather than the geometry? Or is Unreal a smart-ass that will replay the geometry instanciating?

#

If that actually work that easily, I would kiss you

brazen sluice
#

OK So progress: I implemented something like :

Node [Replicated actor] {
UPROPERTY(replicated)
theData
}

The on Begin:
if(HasAuthority) { // whoever spawn the actor
theData = loadData();
}
// Client would get theData already populated
SpawnTheStuff(); // read and spawn everything in theData

#

The thing is, the clients freeze completely upon starting the game... not sure what I'm doing wrong

thin stratus
#

How much is "LoadData"?

brazen sluice
#

It's an Array of 5832 Structs (for now just one int)

#

so about 5kb

thin stratus
#

Hm right. Well keep in mind that you can't do that all at once in the end.

#

Either way, not sure what the comment "Whoever spawn the actor" is about

#

Server has to Spawn the Actor

brazen sluice
#

Right

thin stratus
#

And the freezing,.. do they unfreeze eventually?

brazen sluice
#

Doesnt feel like it does, but also it seems not to be completely frozen, BC I can see the clouds moving it's just that the FPS is so low that I couldnt notice it

#

Anyhow from client's perspective, it seems no Actor are being spawned at all

#

I cant see a single node, but with a breakpoint, I can see the lifecycle of the actor being run throught so they def spawn server side

thin stratus
#

You aren't doing any EventTick RPCs that are Reliable or?

brazen sluice
#

I have a Tick, but it's not replicated

#

Or I'm misunderstanding something

thin stratus
#

Are you calling RPCs on tick

brazen sluice
#

No I'm only spawning meshes

thin stratus
#

On tick?

brazen sluice
#

if the data are loaded

#

Yeah, only once tho

thin stratus
#

Why do you need tick for that?

brazen sluice
#

BC meshes are loaded Async

#

So I have a thread, who sets a bool when the meshes are ready

thin stratus
#

Does the game freeze for the clients if you don't load the data?

brazen sluice
#

And tick does
if(ready) spawn();

#

Let me try to comment the tick out

thin stratus
#

Does it also do ready=false afterwards? :D

brazen sluice
#

yes lol

#

πŸ˜‚

#

Replaced by if(false) and it still freezes

#

Gonna try to comment out the thread then

#

OK Only commenting out loadData() seems to work

#

if (HasAuthority()) will only execute on server right?

#

OK am I allowed in loadData to just do mySharedData = some new Array() ?

#

Or does it need to keep ref?

#

Will BeginPlay have been executed alreaady on the server once the actor is replicated?

#

Holy shit, I moved the loadData to the constructor and it works πŸ’Œ

#

I'm going to cry I'm so happy! Thanks @thin stratus @meager spade

rose egret
#

in C++ how do I know its being compiled for dedicated server ?

#

I want to exclude some useless components from the dedicated server build to save a little memory

brazen sluice
#

There's a pragma:

#if WITH_SERVER_CODE
....
#endif // WITH_SERVER_CODE

#

How many time a day you guys read "Well This isn't very helpful Amanda"

odd iron
#

Hey Guys
When the player disconnect of close the session im using " Destroy Session " Node to destroy the session he have made
but when im trying to make a new session without restarting the game
the player cant control anything or move i've looked into the log
found this

LogGameMode: FindPlayerStart: PATHS NOT DEFINED or NO PLAYERSTART with positive rating
[2020.04.04-16.22.07:206][720]LogSpawn: Warning: SpawnActor failed because no class was specified
#

its look like the old session data stay at the game when he try to connect some of old data still there

rose egret
#

imagine I spawn a replicated actor on the server and initialize some of its properties at the same time .
``
FActorSpawnParameters asp;
asp.Owner = this;

WeaponRifle = GetWorld()->SpawnActor<AProtoWeaponBase>(RifleClass, asp);
WeaponRifle->RelicatedClass = MyClass;
//...
``
on the client side what event is called when the actor is spawned for the first time ? I need something before BeginPlay

#

I want a guaranty that properties are replicated as well ? is BeginPlay ok with that ?

brazen sluice
#

Quick one, will hasAuthority be true only on server? (if server spawned)

odd iron
#

Hey Guys
When the player disconnect of close the session im using " Destroy Session " Node to destroy the session he have made
but when im trying to make a new session without restarting the game
the player cant control anything or move i've looked into the log
found this

LogGameMode: FindPlayerStart: PATHS NOT DEFINED or NO PLAYERSTART with positive rating
[2020.04.04-16.22.07:206][720]LogSpawn: Warning: SpawnActor failed because no class was specified

@odd iron
Edited : Found the Issue the Input was Focusing on UI for somehow πŸ™‚

brazen sluice
#

When I set a property to replicate in UE, does it replicate all the time or only when it's actually changed ?

#

I'm trying to set an array of String to replicate, and it get super slow VERY quickly

#

Like about a few hundreds strings in my array to replicate and the game becomes totally unplayable..

#

So I added a delay of 1sec to late the game start fresh which works

#

But it gets weirder... It seems the problem isnt the size of data, because the first actor, with an Array of 5000 sync just fine, but the second one, with the same size, is taking forever to come...

#

As if the server sent the replication, and was waiting for something before sending the second one

#

And that something somehow gets slower, the bigger the array

#

But still the first actor is instant to sync with an array as big as any other

#

Can I somehow log what's being replicated to see if something is wrong?

jolly siren
#

why are you replicating all of this?

thin stratus
#

They only replicate when changed

#

The initial replication might already be overkill

#

You usually don't replicate such big arrays, at least not at once

kind wave
#

Did the command for simulating packet lag change from net pktlag = n?

thin stratus
#

no

kind wave
#

Ok thanks, wasn't popping up in my autocomplete for commands so wanted to double check

brazen sluice
#

@jolly siren @thin stratus It's my level, they're generated on the server and then sent to the clients

thin stratus
#

Why does it need to send the whole level?

#

Why not just the values to generate it?

#

If that's all info that is needed then this might need to be done differently

#

Either way you might want to try the same thing in a fresh project

#

just the 5k+ FString replication

desert breach
#

What if I want to override the implementation of RPC in child class ?

#

is this is correct virtual void ServerRPCFunction_Implementation(int32 IntegerParameter) override; ?

quartz venture
#

Hey guys. I have a problem with a multiplayer lobby. All client cards have the same icon and name of the server icon and name who created the lobby, even though each one has different info that they set before. Anyone has any idea to why this is happening? I'll gladly provide more information

gaunt cliff
#

@quartz venture if you're setting the icons via blueprint, make sure to have a default value for the icon variable

#

for some reason, if you don't set a default value for Texture2D object reference in blueprints, changes to it are not reflected

#

Anyone here working with Amazon Gamelift?

quartz venture
#

Thanks for answering. I have indeed a default icon value. Perhaps it is my approach thats causing the problem because im using PlayerState to store the values of each player

#

Each time a player joins I loop through the player array and get the values. it works correctly only for the server

brazen sluice
#

is there a way to convert std::string -> FString -> std::string without loosing the UTF-8 symbols ?

gaunt cliff
#

yes

#

because you're using GameMode

#

to loop through the player arrays

quartz venture
#

im getting it from GameState

gaunt cliff
#

the loop to get player array, is in GameState ?

quartz venture
#

no its in the Widget BP

tropic prairie
#

hey so, im having a problem that only occurs in multiplayer. The first client has a pawn spawn for it but the second client does not. Does anyone have any ideas why this could be happening? I can send any screenshots needed for clarification.

gaunt cliff
#

the "correct" approach to do this, is to use GameMode, when a player joins the game, you use that event to loop through the array of all player controllers connected, and tell them to update

#

@tropic prairie need more information

tropic prairie
#

does this help at all?

brazen sluice
#

commonChunkData = FString(UTF8_TO_TCHAR(compress_string(TcommonChunkData).c_str()));
replaces non latin wiht ??

quartz venture
#

I'm just stupid. I have a function called "Initialize" that loads the player info from a save file into the player state. It was set to execute on server instead of owning client. Thank you and sorry for wasting your time hahah

#

@tropic prairie what kind of a pawn spawn? are they PlayerStart?

tropic prairie
#

I think my problem must have something to do with the pawn. Using different paws with the game mode works fine.

#

@quartz venture Its the NetworkPlayerStart that comes with the First Person example

#

only difference is that I used a cone instead of a cube

#

or rather I made a blueprint from the C++ class

quartz venture
#

Okay tell me the logic you use to spawn your pawns. we can go private if you want

tropic prairie
#

I haven't really set much up, I just have the NetworkPlayerStart and the Game Mode is set to use this pawn as the Default Pawn Class

#

Considering that I'm very new to this, there's a good chance there might be something else that I need to do that I'm just unaware of

quartz venture
#

so you have NetworkPlayerStart and the Default Pawn Class and youre pressing play

tropic prairie
#

yeah pretty much

#

I also have the Number of Players increased, and it's running a dedicated server

quartz venture
#

okay im starting a new project to try and do what you did.

tropic prairie
#

okay, thank you!

shy kelp
#

i have a problem, when i have multiple swords on the field to be equiped only the sword which was equipped first has damage. for example, one of the swords in the field does 50 dmg, the other one does 10( networked btw). If a player pickup the one that does bi 50 dmg first, then another player pickups the sword that is supposed to do 10 dmg, it still does 50 dmg. dmg is replicated. I only have a SINGLE sword bp, which i can edit with instances to specify dmg.

#

I'm raw in networking

quartz venture
#

@tropic prairie okay i just started a project. i did nothing except i set players to 2 and checked dedicated server and started. everyone spawns

#

should i change something?

tropic prairie
#

@quartz venture It only didn't work for me with the custom pawn set as the default pawn

#

Would it be easier for you if I sent my project?

quartz venture
#

sure send it

#

or wait

#

i changed the default pawn

#

to a normal cube

#

and the same thing happened

tropic prairie
#

hmm

#

i'm doing some experimenting now and I'm starting to think it has to be a character instead of a pawn?

#

When I play with the same multiplayer settings and use a character, it spawns multiple characters

#

er, it spawns 2 characters at least. One's below the map and the other's at the expected point. The other 2 clients don't get characters.

brazen sluice
#

For anyone wondering, FString sucks ass, so I'm replicating an array of int8 and I convert it to/from std::string manually, now it works fine

tropic prairie
#

@quartz venture this problem seems to only occur in the editor. I packaged it and ran a test server and then connected multiple clients and that worked fine with the character. I'm going to try it with a pawn now.

#

the problem persists with pawns

#

weird

quartz venture
#

@tropic prairie it seems random. I tried putting multiple PlayerStarts and clicked Play

#

i tried with 4 players as well

#

and 3

#

sometimes all players spawn

#

sometimes only one spawns

tropic prairie
#

thats weird

quartz venture
#

sometimes only two

tropic prairie
#

huh

quartz venture
#

I would say write a code in the GameMode to spawn all players

tropic prairie
#

that's probably a good idea

quartz venture
#

also i noticed something

#

i mean its the same thing that happened to you

#

character works and pawn doesnt

tropic prairie
#

yeah

#

im not sure why

quartz venture
#

it is probably something in the GameMode functions when the map loads. You just need to write your own code to handle spawning

tropic prairie
#

probably

twin juniper
#

anyone ever encountered a bug where you try to simulate multiplayer in editor but client is spawning the pawn, posessing it yet no input can be given. Also it cannot see the servers actions for some reason and stuck there forever ?

#

I am using 4.21 source build and only change I made before it gone crazy was creating a new gamestate and playerstate class and switching the old ones

#

No matter what I did it stayed broken even though I reversed everything I last did as well

tall pine
#

Hi guys,

I ran into this error message whenever I play in MP:

PIE: Warning: Invalid Simulate Options: Body (DeployableMine_2.Sphere Collision) is set to simulate physics but Collision Enabled is incompatible

It works fine in SP though. so I can't enable physics in MP in run-time?

cerulean escarp
#

@tall pine are you trying to do this on a dedicated server?

tall pine
#

yes

#

the code is run on both client and server though, but the server is dedicated

cerulean escarp
#

have you set physics to be enabled on dedicated servers?

rotund sapphire
#

can you turn it off on server?

cerulean escarp
#

iirc it's default is to be disabled on dedicated servers and you have to enable it but I can't for the life of me remember how

#

I tried doing physics on multiplayer once and it was so annoying so I just didn't do it

rotund sapphire
#

yes physics replication has its own little world of wonders

peak star
#

I was able to have an android join a game hosted by PC before, when they were both dev build. i made my first shipping build and I am trying out the same cross platform LAN between them today and my android cannot find the session to join it. Is something different in shipping builds?

tall pine
#

wait, you can set physics to be enabled on dedicated server?

#

Where can I set that?

#

so those warning message I receives is from the server? Interesting

#

those error are from the client side though, not the dedicated server. Also, even in cooked build, I would see the PIE in front

PIE: Warning: DeployableMine_2147480344.Sphere Collision has to have 'CollisionEnabled' set to 'Query and Physics' or 'Physics only' if you'd like to GetMass.
swift cargo
#

i have a stick on my player character. i want other clients on a dedicated server to see when my STICC moves up and down. what do?

#

Sticc movement is made from the mouse input and parented to the camera.

bitter oriole
#

Tell the server your stick position, average it on the server so that it's smooth, then have that result replicated to other clients, and inteprolated again for smoothness

tall pine
#

@bitter oriole : do we still need to set simulate physics on dedicated server? Or is it an older engine thing?

swift cargo
#

When I tell the server stuff, how does the server implement the rotations?

#

@bitter oriole

bitter oriole
#

@tall pine I don't understand the question. Servers don't do anything special regarding physics

#

@swift cargo It doesn't

#

You need to replicate the same logic on the server and send the information you need

#

Which is the camera position I guess

swift cargo
#

In blueprint, @bitter oriole what would it look like and what would you recommend?

bitter oriole
#

Look. What you have is a component that moves depending on where you look at, right ?

odd iron
#

Good morning Guys How can i get all players controller in widgets
i have scoreboard and i want to call all players controller
i tried to get player state -> All players Array and loop its getting all online players but all values same

#

I've repost it here because its related to Multiplayer xD

twin juniper
#

player controllers are the same you shouldnt access that via server

#

they are not replicated hence you cant modify it and there is a reason

#

why would you want that ?

bitter oriole
#

@swift cargo so assuming you have code that moves the stick depending on where you look at :

  • Send the "look at" information to the server
  • Have the server replicate the "look at" information to other clients ("skip owner" will be useful)
  • On every player, just keep doing the stick animation based on the local, or replicated data
twin juniper
#

you can get the all players via gamestate

bitter oriole
#

@odd iron You need to use playerstate, not player controller, for this.

odd iron
#

You mean get Player Array from player state ?

bitter oriole
#

You won't be able to get player controllers at all

odd iron
#

i've tried to do that its working but its duplicating the values

bitter oriole
#

The data needs to be in player states

#

Player controllers don't exist for remote players, at all

odd iron
#

Yupe That what i know but i wasnt know any other fix πŸ˜„

twin juniper
#

its because it is giving it a duplicated name

swift cargo
#

So if I store the data in variable and get the server to multicast the variable it works?...

twin juniper
#

but it is actually not

#

btw any one have any idea why this happens, I asked yesterday but nothing

#

anyone ever encountered a bug where you try to simulate multiplayer in editor but client is spawning the pawn, posessing it yet no input can be given. Also it cannot see the servers actions for some reason and stuck there forever ?
I am using 4.21 source build and only change I made before it gone crazy was creating a new gamestate and playerstate class and switching the old ones
No matter what I did it stayed broken even though I reversed everything I last did as well

#

@swift cargo yes it does

#

IDK why but vertical rotation is not handled by server

#

@cedar badger

#

whoops

#

sorry

#

too many chases :/

swift cargo
#

Lul

twin juniper
#

there would be too much rpc call

swift cargo
#

Still very confused but I'll try it soon anyway

#

I would have to see a blueprint example for me to think

twin juniper
#

why does it happen I want to cry please

bitter oriole
#

@swift cargo It's simple : you have data that originates on one player, you send the data to the server, which replicates it to the other clients. Animating the stick based on the data happens everywhere.

odd iron
#

So Can i use Player Structure Inside the Player State ?

#

i mean as a variable

odd iron
#

but i want to set custom variables when i set it in Playerstate its return null

twin juniper
#

you need to replicate those variables created in player state

#

player state replicating is not enough

#

and set the variables on server not on client

odd iron
#

Thanks @twin juniper and @bitter oriole

#

and player info feeding from controller bp

gaunt cliff
#

anyone here using Amazon Gamelift ?

#

I have been banging my head over the keyboard for two days over this issue with no avail

rotund sapphire
#

i dont think error window gives you accurate reports, but in this case maybe an issue of double including the module for build script may cause something like this. also it's sometimes worth cleaning up project by delete intermediate folders (both in project and project plugs), generate sln and compile everything. also quit editor when compile, hot reload is a mess.

solar stirrup
#

Didn't Server RPCs require the WithValidation specifier?

#

Because my 4.23 project doesn't whine about me not adding it to a server rpc πŸ‘€

#

is that normal?

rotund sapphire
#

It is no longer mandatory afaik. Since 4.23 maybe 22

fleet raven
#

someone should make a script now that goes through your code and deletes all the empty validation functions you were forced to make earlier

gaunt cliff
#

I've cleaned the project, i've rebuilt it, rebuilt the C++ libraries, done basically everything except actually deleting those functions

#

which is alot of headaches

#

so if anyone here using a recent UE4 version with the Gamelift SDK, help would be appreciated πŸ™‚

brazen sluice
#

How many crash reports a day does Epic receive

bitter oriole
#

Millions, most like

rotund sapphire
#

i never send it

bitter oriole
#

I also don't, but mostly because 99% of the crashes I get are in my code

brazen sluice
#

Oh im sending it, taking them down with me xD

ocean geyser
#

considering there is a send and restart and not a don't send and restart button I'm sending

brazen sluice
#

same

rotund sapphire
#

In pie test a delegate fired on client ends up being executed on server version of the pawn implements the event. Is this a known bug?

brazen sluice
#

Anyone else has the doc CSS broken?

rotund sapphire
#

its not quite a multiplayer related topic but yes im also in this game with ya. these folks are so good with managing web stuff, i am truly amazed.

lime sorrel
#

Do you guys have any advice on replicating a large array (around 1000 vectors) over the network without dropping packets or choking the shit out of the server?

rotund sapphire
#

if its a local net stuff just increase the network limits from 10kb/s to something like 1mbit and it should not choke that much

lime sorrel
#

oh shit where can I increase this network limit?

rotund sapphire
#

the're also limits for array size in length and byte those are editor settings you can increase

#

ini settings

brazen sluice
#

Wheeze had the same issue yesterday

#

The way I fixed it is by compressing the levels in 2 way :

  • manual compression by removing redundant data
  • GZIP compression
eternal anchor
#

does steam subsystem handle nat punchtrough for players behind routers for listen server ?

bitter oriole
#

Yes

rotund sapphire
#

you probably cant use it for other purposes other than steaming

#

but webrtc has similar features could be an alternative tho

tall pine
#

Can you switch collision profile in mp at run time for a static mesh?

bitter oriole
#

Yes

tall pine
#

When i do i get this warning

PIE: Warning: DeployableMine_2147480344.Sphere Collision has to have 'CollisionEnabled' set to 'Query and Physics' or 'Physics only' if you'd like to GetMass.

#

It doesn't happen in sp

lime sorrel
#

I can't seem to find these network limit .ini settings @rotund sapphire - This at least doesn't work:

rotund sapphire
#

there will be at least 2 or 3 stages where limiting the net, in different settings you must increase them both

#

i think that (or a similar one) AH post should point out more

chrome bay
#

@tall pine you have to replicate the change somehow. The collision settings won't automatically replicate.

lime sorrel
#

these answers on AH don't even tell me which .ini's they are modifying lol - I'm assuming it's DefaultEngine.ini

rotund sapphire
#

[/Script/OnlineSubsystemUtils.IpNetDriver] [/Script/Engine.Player] these sections also have limitation settings for net you should adjust

#

you can put them in engine.ini

#

I'm assuming it's DefaultEngine.ini
That one actually in basegame.ini so defgame.ini rather, but i think it might just work from engine ini too why wouldnt.

tall pine
#

Hi @chrome bay : i have that code run on both client and server, so i still need to replicate the change?

chrome bay
#

if it runs on client and server then no

#

Well, assuming all clients have run it

#

Which late-joiners might not have

rotund sapphire
#

I think he means he run the getmass on both, but instead he should adjust collision on both is what you asked him to do.

tall pine
#

No, i run the change collision code on both. I inherit the code but it does seem we run physic simulation on both client and server

#

It does hit the breakpoint on the client when i change the collision enable profile

rotund sapphire
#

That's ok then. Could you try run this project using Standalone mode, and disable the "single process mode" in settings?

#

I've seen problems with PIE simulation that doesnt happen in standalone mode

tall pine
#

Ok will try

lime sorrel
#

Sry for being an irritant @rotund sapphire - but this is what my DefaultGame.ini and DefaultEngine.ini looks like (the configs in ProjectFolder/Config/)

#

I just put all the settings I could and put it in both configs and put a couple of zeroes to make the limit much higher but it's not working

rotund sapphire
#

Did you restart editor?

lime sorrel
#

this is what the network profiler looks like, peak bandwidth is around 40-50kbps

#

Yeah I restarted as well

#

and the peak bandwidth is where everything chokes up and it takes the server like 2 seconds to sync up again

#

for other clients

rotund sapphire
#

min dynamic bandwidth is around 40k, also player's replication is still limited to 10

#

try larger numbers and test again it should do it quicker

lime sorrel
#

alright, should the min dynamic be higher as well?

rotund sapphire
#

also, depending on the vector's dimensions you can try netquantized structs for cutting the costs a bit

#

yes why not, it's for testing

lime sorrel
#

It's an array of structs, the struct containing 2 vectors

#

I'm doing all this in blueprint btw

rotund sapphire
#

vector is 3x32bit data, but netquantizers are smaller (less accurate tho)

lime sorrel
#

doesn't have to be super accurate, I'll take a look at that thanks

#

ayy it worked! thanks

#

just raising the numbers I guess lol

rotund sapphire
#

just crank it up

tall pine
#

@rotund sapphire : I still get this in stand-alone

PIE: Warning: DeployableMine_2147480350.Sphere Collision has to have 'CollisionEnabled' set to 'Query and Physics' or 'Physics only' if you'd like to GetMass.

The interesting thing is I only get that the second time that code get called. The first time everything is fine.

rotund sapphire
#

Not much to go on, but that could be a valuable finding for you to understand what exactly happens in code, so you can figure out why things gets messed up. You maybe loose a reference, or reference a wrong comp, perhaps you spawn new comp but execute collision changes on old. Or you're addressing wrong pawn etc :)

tall pine
#

could be. The actor is a mine, and we use pooled actors, so this could be the case. Thanks for the idea, I'll double check

#

although if this is the case, I feel like it should also happen in SP

rotund sapphire
#

is it net safe pooling? do they sync server client pawns to have same guids etc?

#

when you run it single player only one pool exists, but in networked game you're dealing with two i guess

tall pine
#

i'll read through the code, I don't think they sync the actor pool

rotund sapphire
#

perhaps you should use pooling onlyon server and allow client for normal spawn behavior upon replication

#

on that note also make sure you dont spawn mesh on client, but instead just allow the one coming from server to spawn automatically

tall pine
#

oh, so pool on server and just set to replicate so the mesh will spawn on client automatically?

rotund sapphire
#

yes

#

i actually was expecting you dont spawn objects on clients at all but was worth mention to shut this out

#

maybe you're double spawning stuff here and that cause confusions

tall pine
#

but if I do spawn object on client, and simulate physics on both side, that should work right? I mean if I don't set the actor to replicate

rotund sapphire
#

you're breaking authority with that. server must spawn the server authorative object and set replicate on so it will show up on client automatically

tall pine
#

I see. ok, thank you. I'll double check that, thanks for your help

rotund sapphire
#

btw its possible to spawn a client object and pretend its coming from server, i've done this hack before tho its ugly. been managed to modify cmc too so it will accept standing on it.

tall pine
#

i see. I think I need to look at the pooling to make sure we don't spawn actor on client

swift cargo
#

am i retarded?

ocean geyser
#

@swift cargo use a replicated variable, have it skip the owner for replication. in the look up function (the one you have it all set to) calculate your new pitch like you did, then pass that value to the server and have the server set the replicated variable to equal it (so its replicated to other clients and they can see you look up and such). dont multicast, especially in a situation like that lol

swift cargo
#

dont laugh at me

#

im special

ocean geyser
#

lol

twin juniper
#

hey is there anywere where i can find some help

#

with unreal

marsh stream
#

here? in this discord xD

merry pebble
#

Has anyone ever setup quick play? So like, the user clickes and button and it searches through all the sessions found and then joins the lowest ping...?

twin juniper
#

oh ok

swift cargo
#

big brain momment

twin juniper
#

ya

merry pebble
#

Woah

twin juniper
#

i have no idea what ur doing since im new to unreal

#

but sure

#

big brain i guess

swift cargo
#

its something i should have done in 1 minute that took me 4.5 days

#

welcome to hell.

twin juniper
#

oh

#

ik i was a dev in lua before this

merry pebble
#

He's replicating the players pitch so that everyone can see it in a MP game

swift cargo
#

yes

#

the server is setting the movements

twin juniper
#

hmm ok

merry pebble
#

Noice

twin juniper
#

ye

merry pebble
#

Still, how would anyone recommend me goin about setting up a quick match button?

twin juniper
#

so the language you use is blue prints

#

i have heard about that

swift cargo
#

how is a quick match any different from just joining a match?

twin juniper
#

seems nice

#

not coding

swift cargo
#

so you dont have to choose?

merry pebble
#

Let me show you what I have set up...

swift cargo
#

oh no no

#

im not big brain

merry pebble
swift cargo
#

my brain hurts

merry pebble
#

oof

swift cargo
#

is this what being good is like?

merry pebble
#

Wym?

swift cargo
#

am not this epic

#

i wish to be this epic

merry pebble
#

?

swift cargo
#

dont worry about it

merry pebble
#

Lol

#

Alright

twin juniper
#

lol

merry pebble
#

Okay so I have something setup with the Quick search and join, but i dont know if its correct or is its even a good to go about doing it....

#

This is what the code looks like for the button

#

Any opinions? Corrections? Lol, I want this to be as perfect as possible so that when I release this free Mp Template, it all works smoothly. πŸ™‚

twin juniper
#

im not touching that unsolicited link

merry pebble
twin juniper
#

ik its still unsolicited

merry pebble
#

Its a website where you can share your code without sharing your project or sending pictures

twin juniper
#

oh

#

ok

merry pebble
#

Its very helpful πŸ™‚

twin juniper
#

nice

merry pebble
#

Has anyone made a quick match mechanic?

twin juniper
#

hey do u know the fix for this error
its the DX11 level 10 is required to run engine

meager spade
#

how is it?

#

its not unsolicited..

edgy dagger
#

Question : I have the server up and running on gamelift. I Can connect android devices and play with out any issues. I build the same game to ios and join the game and it crashes. If there are no android clients connected it works on ios clients but as soons as an android client connects to the same server it crashes on IOS client, android doesnt crash and server is still good though

#

Does this mean that i have to have seperate servers for IOS and cross play would be impossible on unreal for a Client to server model as of now

meager spade
#

Fortnite has crossplay

#

so its not impossible..

shy kelp
#

Im trying to drop a sword in a replicated function. This code works on the client side, but if another player looks that them, they are still carrying the sword.I'm raw to networking sry.

#

nvm, i learned it

#

i should do more trial and error lmao

split nova
#

Hey, could anyone point me in the direction of making root motion work in multiplayer? I currently can't move as a client when I play because the server is correcting me. I can stop that from happening by enabling "Ignore Client Movement Error Checks and Correction" under the Character Movement component but I am still unable to see the clients movements or orientation so the client just sits still when viewed from the server player or another client. I believe this is because the Animation Blueprint doesn't replicate (from what I've researched). Quite a while ago, I some how fixed the animation replication issue but the speed at which the animation plays was different for the viewer and the player controlling.

meager spade
#

you shouldn't use Root motion animations inside the AnimBP

#

only play root motion networked via Montages

nimble basin
#

Hi, all, could anyone please point me to a good example of persisting game state, player state, and repossessing character on seamless server travel for blueprint?

#

I know to use game instance to do so, but trying to find an example to work from..

violet geode
#

I see that there was a few answers to my previous question on replication, but that part I've already got down and I can see my own anims....now ofc I need all other players in range to see them. Any advice?

solar stirrup
#

So UObjects can only be replicated by their outer

#

Which leaves some issues when transferring ownership of objects from one actor to another (e.g. an item being transferred from an inventory to another).

#

Would it be sane to have one actor that owns all objects and replicates them all?

#

I could separate it per player to have a way to optimise replication frequency, perhaps using the replication graph πŸ‘€

violet geode
#

I have access to whatever I want during this process technically

#

Just trying to understand what it really needs to be

#

Has nothing to do with inventory, that's a separate process pretty much

#

and this whole thing is like 70%cpp 30%bp

#

Just for the ease of plugging in certain things

cobalt whale
#

theres anyone who can help me with an amazon gamelift stuff?. i just want to make a gamemode in blueprint with gameLiftSdkModule->InitSDK();

eternal anchor
#

@solar stirrup or you can DuplicateObject<>

#

that will of course cause allocations it may or may not be an issue though

solar stirrup
#

No allocations would be better but my current system does allocate anyway

#

What about my idea, is that maintainable?

#

also my current system dupes the object already but without using that function haha

eternal anchor
#

yes it will be. But you need to add a way to block replication inside component to non owning actors

#

you don't want your inventory component to replicate to everybody else

solar stirrup
#

that's fine

#

my inventory uses the fast array serializer

#

so it just won't replicate content

eternal anchor
#

it doesn't really chgange anything

#

arrays are already replicated by delta

#

FAstArraySerliazer just make checking for what changed faster (+ gives you nice events)

solar stirrup
#

My player inventories only replicate to owner already ^^

#

So I guess I'll go with one actor to replicate them all route

#

at least, all objects of a specific type

eternal anchor
#

aha so I assume you have separate inventory and equipment componenets with different implementation

solar stirrup
#

yup

eternal anchor
#

or

solar stirrup
#

as simple as ticking a box

eternal anchor
#

or not

#

you can set the same outer everywhere and still replicate it ;d

#

cant*

solar stirrup
#

how so

#

Wouldn't I be able to call ReplicateSubobject on all objects from the outer?

eternal anchor
#

if you have component on player state and player controller and set outer to PlayerState items on PlayerController won't replicate

solar stirrup
#

I meant having all objects outer be a specific actor made to replicate the objects

#

That way my inventories only hold a weak pointer to the item stored inside said actor

eternal anchor
#

i know, that will work (;

#

though in all honestly

#

duplicating item is easier : D

solar stirrup
#

Yeaaaah but it's mildly annoying

#

and doesn't feel as good

eternal anchor
#

feeling good is actually bad indicator ;p

solar stirrup
#

depends haha

#

Duplicating an item just to transfer just feels wrong

eternal anchor
#

my item system works on discreet componets and duplicate items between them

solar stirrup
#

Everyone's got their own implementation haha

eternal anchor
#

I have one base component, with some minor alterations in childs

#

well never really god any problem with it : D

#

got*

solar stirrup
#

that's how i do it too

#

used to work perfectly but I opted to have uobjects for item instances alongside the structs for item slots

#

for more flexibility

eternal anchor
#

similiar setup

#

though at one point I thought about getting rid of uobjects

#

and doing polymoprhic ustructs qith custom replication

#

with*

#

similiar to how ability system handles various replicated things as TSharedPtr<> internally (like GameplayEffectContext)

solar stirrup
#

sounds nice

unreal pine
#

Hey friends! I've got a multiplayer (pure server) game that sometimes doesn't recognize the client moving. The player appears to move on their client, but the server isn't updating it. As the client, they get spammed with the attached message.

Haven't been able to find much in the google. Anyone able to point me in the right direction?

median elbow
#

in a client server setup, should the client also run the construction script on actors?

solar stirrup
#

It will run the constructor yes

#

and it should

#

The Replication Graph only works for actors right, not uobjects?

#

If so, should I make my items as actors and make use of it?

median elbow
#

if i run the construction script on on the server (using switch has authority), the actor is still loaded on the client

#

i'm just having troubles because i'm getting a lot of warnings and i think its because i have duplicate objects

#

its a platform the player is standing on, and if i let the client run the construction script to also create and add the platform, then the client is constantly saying it can't resolve the new location that the server told it to go to

#

but if i don't replicate it and construct on the client, it still loads, but i have a different kind of issue where its telling me that add instanced mesh component is not supported

#

either way everythign seems to be mostly working fine, client is a little jittery though, but i'm getting a ton of warnings constantly either approach i take

#

oh i just realized i get the cannot resolve movement warnng either way

#

ugh

#

i get this constantly when the client runs around

#

until i go to another room

#

interesting, so if i don't level stream, i don't get those errors

#

i only get them after i've streamed in a sub level

#

even though i'm nowhere near that sub level at the time

meager spade
#

@solar stirrup UObjects replicated with Actors

#

so what benefit would you gain?

#

replicate*

solar stirrup
#

Eh not much

#

I just decided to go for something else with uobjects

#

Have them be replicated by one actor but stored in different arrays depending on who they're relevant to

meager spade
#

eh

#

seems strange

solar stirrup
#

Well at least I don't have to dupe them every time because I need the outer to change

#

Only one actor will replicate them

#

I'll just play with net relevancy to avoid replicating them to everyone when it's not needed

meager spade
#

dont need to dupe tho

#

just UObject::Rename

#

to change the outer..

solar stirrup
#

I was told that'd cause issues 😐

#

Besides it also means I won't have to implement ReplicateSubobjects in every actor/component that plays with the items right?

meager spade
#

not sure what these "items" are

#

but then again i don't know you game

#

items in my game are just destroyed and spawned as pickups (if they are world items)

#

then again, they are not even UObjects yet (just a fast array entry, atm)

#

only Weapons have an actor

solar stirrup
#

I wanted mine to be flexible and stateful

#

objects are great for that imo

#

compared to structs

#

so my inventory's slot is a struct that only contains Quantity and a pointer to the item instance (object)

tawny parcel
#

Wanted to confirm my assumption but if I have replicated variables in a single player game, will the game still run any additional "multiplayer" checks for changes? It relates to one of my tools and easily hot swapping from a multiplayer version and singleplayer version

meager spade
#

@solar stirrup in my game, i have WorldInventory which is a replicated fast array, my quickbar just holds the item ID for the item inside the WorldInventory

solar stirrup
#

that works

meager spade
#

this is what my item entry looks like

solar stirrup
#

I store anything related to the item's state in the object instead of a struct

#

that's the main difference i see

meager spade
#

yeah thats what i plan to do for account items

#

but for world items it makes no sense, since they only persist for the gameplay

solar stirrup
#

I just found it very annoying to deal with structs as items

#

i mean i could still do it actually

#

idk what to do :/

abstract bronze
#

hello, Im following tutorial on how to make a local multiplayer game, it is managing to assign different game pads to different players, however, the keyboard input is being sent to player 1, would it be complex to make the keyboard input be assigned to the next player after gamepads have been assigned?

#

e.g. if 2 gamepads, player 3 uses keyboard

cedar finch
#

Just a quick question. It's not possible to easily retrieve a players Steam profile picture in blueprint is it? I'm talking about not exposing things or using plugins. I'm just looking for Yes or No. It's not a big deal lol

cerulean escarp
#

@cedar finch I just searched for a function that could do it but all I could find was Get Steam Friend Avatar

#

so I don't think so

cedar finch
#

Ok thanks for looking. πŸ™‚ I figured It would require some extra stuff. Someone was asking me and I couldn't find anything either. Just wanted to check if anyone else knew. No problemo. πŸ™‚

summer tide
tawny parcel
#

@summer tide Could be movespeed not being replicated or animation states colliding. Did you push sprint when it stops working?

summer tide
#

Pressing W jogs that appears a little faster then regular. When I hold shift to sprint, it does that. So two issues.

#

That happens running in dedicated server with 1 player.

tawny parcel
#

So make sure when you are pressing shift, the movespeed change is set on the server

#

Check your blendspace based on movespeed. It might need to be adjusted if it is a bit faster than it should be

#

The studdering is likely from the client running faster than the server thinks it should. The server will make location corrections based on its known movespeed for that character

summer tide
#

ok let me try

solar stirrup
#

Can you use FArchive to replicate arbitrary data you know the type of?

shy kelp
#

still learning networking, why does the destroy actor (inside death function) only run on the server. It gives client xp and everything, just doesnt destroy the actor, i tried everything

#

everything i know of

twin juniper
#

you cant call multicast from client

#

you need to Server > Multicast

#

also why use multicast if you are just gonna block it with has auth node

cedar finch
#

So I have a bug when using dedicated server. I'm using a muzzle socket on my weapon to shoot projectiles. But when playing on dedicated servers it's as if the muzzle location isn't following the animation. The projectile is starting at the wrong location but is still going in the correct direction. Ideas? https://youtu.be/GVHBcS29ctQ?t=34

"ListenServer vs ClientSide" Mixed Up "Standing vs Crouching" Projectile Launch Location

β–Ά Play video
rotund sapphire
#

skeletal mesh has a setting that prevents animating when not rendered (eg dedicated server)

cobalt whale
#

can i use steam on amazon gamelift^

#

?

shy kelp
twin juniper
#

no

shy kelp
#

why

#

you said to run the multicast from the server

twin juniper
#

yeah how do you decide it is the server

shy kelp
#

isnt event anydamage always server? im confused

twin juniper
#

its not

rotund sapphire
#

AnyDamage is server only indeed.

twin juniper
#

i believe

#

ooh

#

its custom node ?

#

my bad

cedar finch
#

@rotund sapphire I found it. Thank you so much. I totally forgot about that. πŸ™‚

twin juniper
#

I dont normally use abilities built-in so

#

my bad

shy kelp
#

yh

rotund sapphire
#

There is another issue tho, the anydamage will fire multiple times until your character is actaully dead. In that 200ms he may receive more bullets.

shy kelp
#

i can change it with an isValid

#

@twin juniper so umm how do i fix it

#

why cant the clients see the "death"

#

but still get the effects

rotund sapphire
#

create a simple bool instead, IsDead, and set it true immediately there (no delay). You can make this prop to replicate, and use onrep events to fire death sequence etc.

shy kelp
#

thats wut the death function is

rotund sapphire
#

multicast rpc is kinda expensive, an onrep should do it just fine

shy kelp
#

i have an isDead

#

i have both lmao

rotund sapphire
#

additionally, when late joiner comes in game he will see your pawn is alive, because nothing will indicate he died.

shy kelp
#

im doing both and trying it

#

oh

rotund sapphire
#

yeah use isdead, and replicate it so everybody can always know the dude is dead already

shy kelp
#

the repnofity contains a multicast function for death.... now why doesnt this work in the clinet

#

@rotund sapphire sorry for the inconvience, i feel new to ue4 again lmao

rotund sapphire
#

because the code begins with authority check it is running server only

#

connect some stuff to the remote pin, that will play death anims or whatever comes after this

#

this image is not the repnotify