#multiplayer

1 messages · Page 16 of 1

steel fractal
#

i couldve just did everything on the server then marked the variable as replicated so the server knew to update it

sinful tree
#

Nope.

steel fractal
#

damn it

sinful tree
#

Replication only happens one way. Server -> Client

steel fractal
#

yes thats what i mean im wording it poorly

sinful tree
#

Gotcha 😉

steel fractal
#

i butchered it

#

lol

#

but you definitley helped me understand the concept, im gonna test what i think i need to fix

#

yep it works

#

thank you

#

did it here too

#

completely wrong lol

#

aw crap u cant replicate a map

#

im screwed

#

so quick question, i use maps for my inventory system, I beleive maps cannot be replicated so do i have to start from scratch with a new idea?

#

well the replication with RPCs work, but I cant set it as replicated in the variable details panel

sinful tree
#

Correct, maps don't replicate. You might be better off just using individual integer variables for each ammo type. You can still use your enumerator to switch which particular value gets changed/updated.

steel fractal
#

damn ur rught

#

got a lot to redo now lol

#

this works as a work around

#

i think last i read on a forum article is that its kind of working, because i can successfully replicate it to the server

latent heart
#

That looks suspiciously unvalidated.

#

Why doesn't it change the ammo when you change weapon?

steel fractal
#

it does, it just gets the current item in hand and gets the stashed ammo

#

for its type

latent heart
#

Yes, but, the weapon change should be done on the srever too...

#

There would be no reason to "execute on server" if you're already executing the weapon change on the srever.

steel fractal
#

well im trying to finesse a way around this

latent heart
#

One day, I will not typo "srever"

#

Damn it.

steel fractal
#

so i basically im trying to make a copy of it from the server to a repliicated variable in the bp

#

jerry rigging it basically

sinful tree
#

That ends up being that you store it twice on the server though.

#

And you have to keep it updated in two places.

steel fractal
#

ya its not ideal

#

im basically trying to just make it work for now, and when i have more time i have to redo my whole system to not use maps

latent heart
#

It should happen something like:

  • Player requests weapon change to server
  • Server changes weapon if request is valid
  • Server changes ammo type
  • This change is replicated to the client
  • Client responds to the variable changes by changing ui or whatever
steel fractal
#

i do that here

#

sort of

#

but i have the ammo type stored in the base weapon, i just access the item in hand when i want to get the ammo type

latent heart
#

So add the ammo change to that function

steel fractal
#

hmm

#

oh ya i think there was a reason why i didnt it was causing a problem with my shooting

#

the only way i can get shooting to work is if i add this owning client to the end

#

or else Item in hand here returns null when playing online

latent heart
#

So fix that issue !

steel fractal
#

lol now that i know thats an issue and not a solution i will

#

its hard to debig replication

sinful tree
# steel fractal the only way i can get shooting to work is if i add this owning client to the en...

You shouldn't need to do this, ever. If it's a replicated variable, that means you need to set it on the server first. Once the server has the value, the client will get the value, just like how we were talking about the ammo before. If the player has nothing in the "Item in Hand" variable, that means the server is also unaware of the value if it's a replicated variable.

Say for example, you just spawned in the game. You may not have an "item in hand" as the player doesn't start with anything.
This means that the server would have to appropriately spawn the item that you want in the players hand, set whatever pertinent variables are needed, and then set the "Item in Hand" variable.

If you want something to change when the "Item in Hand" variable changes on the client, then make it a "Replicated W/ Notify" replication type, then you'll get an automatically generated function that will get called when then client receive the new variable value, then you an do whatever you want to do with that new reference (like unattaching any attached actor, and attaching the new one)

steel fractal
sinful tree
#

Problem is...

#

Your map find here may be returning false.

#

So none of the rest of it happens.

steel fractal
#

would that be true tho if this print string at the end returns the correct result tho

#

cuz it shows Server: and has the correct name of the actor i want to replicate in it

sinful tree
#

Is the weapon actor itself marked to replicate?

steel fractal
sinful tree
#

How is the Inventory map populated?

steel fractal
#

ahhh

#

very poorly

#

i think even tho its showing up on the server its just not replicating properly

#

its gotta be due to the map

#

could only be like partially supported or something

#

yep its the map

#

honestly idk how im even able to pickup a weapon still everything i did depended on the map

#

but wait

sinful tree
#

Same flow as before...
Player presses input > Send RPC to server indicating you want to interact from the actor >
(From this point on, you're only running on the server so no other RPCs necessary)
Interface on a "pick up item" would likely check if player is close by for the interaction to be valid, and if so, proceed with the necessary code to add the item to the inventory and set the actor that should be in their hand to "Item In Hand".

steel fractal
#

so this is how im going to set item in hand from the server. This is in my base weapon bp

#

i get a reference to the component and set it

#

i used this to debug and i see the issue now. Its updating on the server fine. But for some reason client is null.

steel fractal
#

i also made sure that my base character is the owner of the base weapon as well

hard bluff
#

Hi I'm using a random map generator made in this video https://youtu.be/Gy7Z-bukPJQ but when I launch multiplayer each player has a different level how would I fix this

ENDLESS RANDOM WORLD (Marketplace): https://www.unrealengine.com/marketplace/en-US/product/e9b42224d75b4951a53378a67afca7dd

  • Setup in a couple of minutes
  • Goes forever
  • Use your own custom tiles
  • Custom seed
  • Custom render distance
    • More
      $60 or DM me if you're broke and I can hook you up if you give me credit

Project files (this tut...

▶ Play video
sinful tree
hard bluff
#

How would I go about doing those things I'm sorry I'm very new

sinful tree
sinful tree
# hard bluff How would I go about doing those things I'm sorry I'm very new

Well, replicating an actor is fairly simple. Mark the "Replicates" boolean on the actor in the details on your blueprint. If you spawn such an actor on the server, then it'll spawn it on all clients as well. Just make sure you don't have the clients also generate the map as then you would have 2 different maps overlapping.

#

For the seed generation, you'll probably want to look up more regarding procedural generation.

steel fractal
#

shows up good on server

#

thats all it really is

hard bluff
sinful tree
hard bluff
#

I did

#

I'm sorry if I'm making this difficult

sinful tree
# steel fractal

Really this seems like you don't have replication turned on in your Inventory Component, unless you're using additional replication settings on the Item In Hand variable.

steel fractal
#

holy shit ur a genius

#

everything works now

#

my jawis on the floor rn

sinful tree
#

or at least, I interpreted what you said as you did

#

At least its working now 😛

steel fractal
#

LMFAO i thought u meant the character character because I thought the component would inherit the characters replication

#

ive always been under the impression that was the case.... and iwas so wrong

#

then i clicked on class defaults and saw component replicates i was like WTF

#

anyways thank you so much, i thionk my life will be much easier now

rotund onyx
#

Is there a way to make sure all clients have loaded into a level before starting the game? I have a server that starts as a lobby and obviously the server finishes loading first but I don't want actions to start occurring before everyone is loaded in.

I already have a way to pause the server, I just need a way of figuring out when it is ok to unpause

silent epoch
#

Hello! I'm wondering how to make an unreal game cross-platform -- specifically, how to take my existing desktop app, port it for mobile, but still allow either platform to play together in shared gameplay?

Do you know if there would be a replication issue. For instance, if the mobile map has less foliage instances. Or less textures in the package than the desktop version?

#

I imagine if assets are being drastically optimized, materials used varied for mobile, and changing where / how often assets are placed through a map... then cross platform may not work?

shell forum
#

As for the replication issue, it probably isn’t a good idea to have the mobile user be the host of a listen server…

#

And if you do, then make sure that the optimizations are clientside and won’t have an effect on the actors themselves.

candid gale
#

Asking here as well as It was pointed out this could be a multiplayer issue:
Trying to use UObject::Rename on my item to change the outer seems to give me a net id issue

Non-stably named object BP_Food_Beans_C /Game/ThirdPerson/Maps/UEDPIE_0_ThirdPersonMap.ThirdPersonMap:PersistentLevel.BP_ThirdPersonCharacter_C_1.BP_Food_Beans_C_0 has static NetGUID [19]

I do this:

targetItem->Rename(NULL, originOwner->GetOuter());

so the idea is to change the outer to the actor that contains that item
I added the option to search the contents of an item that serves as a storage, like a shirt that is dropped on ground and it's physically there because it's an actor.
these items have the shirt as the outer ofc, but the moment I pick up the shirt (then removing the actor containing the items, after moving the items data to another container) their outer will point to nothing causing issues with my inventory.
So I figured I needed to update their outer to the inventory these items will reside in.

#

Also, this begs the question, can't I create an UObject that doesn't have an actor that can be despawned or disconnect as the outer, or not have an outer at all?
Like this is intended to be a MP game so players will come and go but the items they interacted with should persist through the world

fathom aspen
candid gale
#

the inventory component has an array of default items to equip the player with

#

at component initialization it just adds these items to the inventory items list, assigns an owner, storage container (shirt, pants, etc), then a slot, etc

fathom aspen
#

Yeah those are assigned static net guids

#

The easiest method to remove that warning is to override IsFullNameStableForNetworking for the outer to return true

#

Though that is just lying to the engine that it's stably named

#

You have to name it manually

candid gale
#

how can I do that?

twin juniper
#

confused about logging in: I'm using playfab to login and the login call in GameInstance right now, but I would like to get the login and authentication results as-is to my PlayerState when I join a server. Replication is a bit difficult with the playfab json objects so I've opted to converting them to strings and back to json, but since I want them in their original form I would like to just pass the login call to the server's GameInstance, however if I am not connected to a server I guess there doesn't even exist a GameInstance for a server, but then again I'm thinking, is there any idea in connecting to a server before you authenticate?

grizzled stirrup
#

There's no need to call ForceNetUpdate after updating Replicated properties that are on an actor that has a NetUpdateRate of 30.0f right?

quasi tide
#

Running into a physics collision issue.

Client shoots enemy. Enemy dies on server, OnReps a bDead variable. In the OnRep, I change the collision to ignore all, except for the environment (WorldStatic, WorldDynamic). It also changes from Collision Enabled to Physics Only. Server, everything works fine. On clients though, they fall through the floor. When I switch it to Query Only, they no longer fall through the floor, however, they now block line traces, even though all of the trace responses are set to "Ignore". Any ideas?

gleaming ginkgo
#

i have a server list that when i join the server with a max players of 2 , but i press find server on all of the players before i join, then i join on one, the others can join aswell even with a max players of 2

steel fractal
#

So I was reading up and I guess you can use an interface to make a server rpc on something you’re character doesn’t own?

quasi tide
#

Interfaces don't support RPC

bitter oriole
steel fractal
#

That’s what I’m reading from the compendium

bitter oriole
#

Read carefully what the guide says

#

The PlayerController is used for the RPC

#

The interface is simply a code organization feature to avoid duplicating the player RPC for every single interactive object type

steel fractal
#

Ohhhhhhhhhhhh

#

I see

#

I thought u had to own the door too

#

But for some reason the player controller allows u to use it

bitter oriole
#

The PC allows you to pass RPCs to the server

#

What happens on the server is up to you

steel fractal
#

I see that makes a lot of sense

#

I mean I could for example do it from my pawn, but I’d have to set the owner of the door as my pawn. The player controller is a way around.

quasi tide
#

You can write this exact same code in your pawn that you own and it'd work

#

The interface method is being called on the server.

#

The first method being called is the "Run on Server" event

steel fractal
#

Ohh okay I thought u had to own the door when doing it outside of the player controller

#

But ur saying as long as I’m running a server rpc on something I own it will work

quasi tide
#

Yes

steel fractal
#

Gotcha. The confusing part was I thought I had to own the door.

quasi tide
#

Nope.

#

Whenever you see "Run on Server", just think, "alright, now I'm on the server"

steel fractal
#

Right I’m basically just doing the same thing but on the server

quasi tide
#

Correct.

#

Instead of opening the door directly, you ask the server to open the door for you.

steel fractal
#

So am I basically running a non visual copy of the game on the server

quasi tide
#

Not necessarily. Server could be another player as well.

steel fractal
#

Ah yes listen server

quasi tide
#

Server is just the "true" version of the game and has the final authority on things.

steel fractal
#

Makes sense

quasi tide
#

If a client doesn't own something, they shouldn't be able to just do w/e they want with it.

steel fractal
#

So older p2p cods one person would be host and if they had mods they could mess with everyone because they were the server

quasi tide
#

Note, Listen Servers are technically not p2p.

#

p2p has no server.

steel fractal
#

Well they’re functioning like a regular dedicated server then, and everyone connects to them

#

I guess it just feels like p2p cuz there’s no dedicated server involved

quasi tide
#

Yeah, that's what a lot of people look at it as. But technically speaking, it's not right.

steel fractal
#

Ya cuz p2p is torrents and stuff

quasi tide
#

But as for the original question, yes. If a player is listen server, they can do w/e they want in the game because their game is the true version of the game that everyone else is playing.

steel fractal
#

Makes sense, something to keep in mind if I actually do anything with this game lol

latent heart
#

That'd be level streaming?

#

Been in UE for ages.

#

The world partition stuff, which is kinda like that I guess and more focused on areas of large maps, isn't in ue4, I think.

feral falcon
#

I'm having trouble with multiplayer in my game. Unreal Engine/Steam related.

Using the appID 480 (default, for Spacewar) we can establish a host but the clients when searching for session is finding a high number of sessions for other projects using 480 as appid. Changing 480 to our own appID, the multiplayer stops working since we can't even get the API to initialize.

LogSteamShared: Steam SDK Loaded!
LogOnline: OSS: Creating online subsystem instance for: Steam
LogSteamShared: Warning: SteamAPI failed to initialize, conditions not met.
LogOnline: Warning: STEAM: Steamworks: SteamUtils() failed!
LogOnline: Warning: STEAM: Steamworks: SteamUser() failed!
LogOnline: Warning: STEAM: Steamworks: SteamFriends() failed!
LogOnline: Warning: STEAM: Steamworks: SteamRemoteStorage() failed!
LogOnline: Warning: STEAM: Steamworks: SteamUserStats() failed!
LogOnline: Warning: STEAM: Steamworks: SteamMatchmakingServers() failed!
LogOnline: Warning: STEAM: Steamworks: SteamApps() failed!
LogOnline: Warning: STEAM: Steamworks: SteamNetworking() failed!
LogOnline: Warning: STEAM: Steamworks: SteamMatchmaking() failed!
LogOnline: STEAM: [AppId: 0] Client API initialized 0
LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
LogOnline: Warning: STEAM: Steam API failed to initialize!

Can anyone help, please?

quasi tide
#

I believe steamworks has docs on this actually.

sinful tree
quasi tide
#

I recall hitting it as well, just forgot what the resolution is.

feral falcon
sinful tree
feral falcon
sinful tree
#

The custom app ID game I imagine.

feral falcon
rocky kestrel
#

Is it possible to dedicated server save all players and their data to savegame file? Im creating multiplayer survival game and I want every server have own player progress. If you join new server you start from scratch.

#

Or server database that server saves players there? What would be best way?

#

I want similar system like Rust

rocky kestrel
#

So in gamemode -> function to gather all data from players and create savegame? I’m new at this:D

#

Feels like it would be slow if it updates for example every 5seconds

fathom aspen
#

I haven't wrote the database part yet, but shouldn't be hard to figure it out

rocky kestrel
#

Thank you!

dark edge
#

just like Minecraft

#

wouldn't scale crazy well but it'd get you off the ground

rocky kestrel
#

Okay thanks!

graceful flame
quasi tide
#

Yes. I don't change that setting at all.

graceful flame
#

Are you changing the collision of the character's capsule collider? The root?

quasi tide
#

Yes

graceful flame
#

Are you implementing rag doll?

quasi tide
#

No

graceful flame
#

I wonder if since the change happens during onRep it takes a few frames (due to server lag) to happen which allows them to fall through the floor. Maybe its better changed with a multicast?

#

or maybe i dont know what im talking about lol

quasi tide
#

This is a state change, as such, it should be OnRep

graceful flame
#

So its like when the character dies you want to ignore all collisions with other pawns and maybe some custom collision channels that affect gameplay, but it seems as if everything is being ignored does that sound about right?

dark edge
quasi tide
graceful flame
#

Maybe do the onRep AND run the same logic again for that owning client?

#

Seems like there's a desync happening

#

So that way you change the collision settings with an onRep but you're also making the same change on the affected client immediately.

quasi tide
#

Example - how is this actually registering a hit with the capsule?

quasi tide
#

OnRep runs when the client receives the updated value.

graceful flame
#

So for my similar onRep bool to handle death called justDied, I change a few things here and there but then I call a server event which calls a multicast event which changes the collision on the capsule and mesh then enables simulate physics so that the dead character begins to ragdoll. Maybe try to implement a similar pattern using a multicast?

#

But mines a multicast because I use a timeline for some visual stuff as well

#

ohhh wait a min, according to your screenshot you are no longer Generating Hit Events.

quasi tide
#

Correct. Because I don't use the Hit stuff at all. If that box was required, they'd fall through the floor on the server and while walking around.

#

It simply is never checked

graceful flame
#

im confused

#

Then shouldn't it be set to use Physics only, no query. The line trace counts as a query, right?

quasi tide
#

When it is set to Physics only, that's when they fall through the floor.

#

Line trace is query, yes. But they are ignoring ALL traces, yet it still registers.

graceful flame
#

because theres no hit events

quasi tide
#

Even with the hit events checked, they still fall through the floor on the client

graceful flame
#

okay so I made a cube, enabled simulate phyiscs and used the same collision settings as your screenshot, it also falls through the floor and gives me a warning.

Invalid Simulate Options: Body (Cube6.StaticMeshComponent0 Cube) is set to simulate physics but Collision Enabled is incompatible

#

If I change it to use Physics Only (No Query Collision) then it doesn't fall through the ground anymore.

quasi tide
#

I'm not trying to simulate physics

#

I don't want that

#

At all

graceful flame
#

So how does the character go from standing to on the ground?

#

an animation?

quasi tide
#

When it is set to Physics Only - they fall through the floor on the client only. Not on the server.
When it is set to Query Only - they don't fall through the floor but they still affect responding to traces DESPITE all trace responses set to ignore.

quasi tide
graceful flame
#

I wonder if you're setting it somewhere else and forgot, if you pause the game and inspect is it using the expected value?

quasi tide
#

That's how I got the screenshot

graceful flame
#

k

quasi tide
#

And yes, I make sure it is the correct World

graceful flame
#

Is simulate physics being accidentally enabled?

quasi tide
#

No

graceful flame
#

I can't recreate the same thing using a cube

#

or a character

quasi tide
#

Registers the line trace, but it is ignoring all line traces.

#

Only on clients though.

subtle raptor
#

hi! i´m trying to replicate the falling animation of the character and i cant!

#

can someone help me?

quasi tide
#

Replicate the is falling var in your character BP. Then in your animBP, just grab that value.

#

You can you make it an onrep var in your character BP, and in the onrep function, update the value in the anim bp

subtle raptor
#

but, unreal engine dont replicate automatically this?

quasi tide
#

Well - you could just grab it locally probably.

subtle raptor
#

in an empty project, the isfalling variable is replicated

#

but in my project don't, and i don't change the character settings

quasi tide
graceful flame
#

Oh the mesh has its own collision settings so that makes sense to me

quasi tide
#

Yeah, but why would it be hitting it when it is on the ground...completely away from the shot

#

That's the strange part. Not that the mesh has collision settings.

graceful flame
#

Its like the mesh is standing but visually its on the floor?

quasi tide
#

Yup.

graceful flame
#

Maybe you need to use root motion?

quasi tide
#

That's what I was thinking.

graceful flame
#

im not sure though

quasi tide
#

Like, it gets stuck in the last position if you're not using root motion.

graceful flame
#

probably by design for some reason

#

its cheaper to just stop working at that point i guess

quasi tide
#

Well, just changing the mesh to match the deadcharacter profile works as well. Don't need root motion.

#

Still a bit silly imo.

graceful flame
#

oh i thought it already was matching

#

So that fixed it then?

quasi tide
#

Yeah. Just not the falling through floor part.

#

Which isn't a big deal to me. As there is a working solution.

pure trellis
quasi tide
#

idk what to say to be honest.

pure trellis
#

I used a landscape, but I don't think that plays a role here

pure trellis
#

for cmc, try to call DisableMovement before setting the collision, I think that fixes your problem

#

in the OnRep / death part

pure trellis
#

Sorry I just read the entire conversation you had with lawlster, you need the death animation and not ragdoll. I guess I can't help then.

#

but if it works on the server side, something must be out of sync. I'd double-check everything

candid escarp
#

Hello people!

Very weird and sudden problem that occurs out of nowhere:
i can host an advanced session and people can join the session, but servertravel [mapname]?listen seems to destroy the session, since clients get kicked instantly and the invite option in steam disappears, also Destroy Session returns fail

This didn't happen a few days ago and appeared out of nowhere I am confused.

shadow narwhal
#

I'm experiencing " SerializeNewActor failed to find/spawn actor" errors when reloading a map in high packet loss situations. The map reloads fine, but some or all actors are missing from the map on clients when they load in. Any ideas?

vivid prawn
#

is there anyway to check for blueprint performance? like how much an actor taking CPU power

hoary spear
#

Well theres the profiler

vivid prawn
#

I try to use profiler, it give me the whole blueprints, not specific actor

#

@hoary spear i kinda want to track how costly is one specific actor

woeful ferry
vivid prawn
#

@woeful ferry okay, I recorded the session with Stat StartFile and Stat StopFile and I used Session Fronted it show the whole blueprint usage

#

also the Ctrl + Shift + , only show me the GPU Visualizer which more on rendering costs

#

in PIE i used Stat Unit it also show me the totall CPU cost

woeful ferry
#

Pre-physics for most of the BP usage

#

There you can see down to the function how much stuff costs

vivid prawn
#

Pre-physics Threads? you mean Game Thread?

#

where do i need to look for it?

#

this section?

woeful ferry
#

Pre physics in game thread yes

vivid prawn
#

I only see worker

woeful ferry
#

Have you uploaded your file

vivid prawn
#

oh okay, i need to select them in EventName so they show up there

#

@woeful ferry okay, thanks for the help, i see them now

grizzled pelican
#

I have an online multiplayer game. I have a client that created its own BP_Character. I possess that character since I manually spawned it in. I want to know if it is locally controlled. it should return true, but is returning false. how so?

sinful tree
#

So you're spawning the character locally on the client?

grizzled pelican
#

i'm kinda new but yes. i am locally spawning it on the client

sinful tree
#

If you want it replicated, mark the character as replicated and spawn it while running on the server. An example place of where you could potentially do that is OnPostLogin in the Game Mode.
You must also possess the character while running on the server.

grizzled pelican
#

i did possess the newly created character but it confuses me since it still says it's not locally controlled

sinful tree
#

This "possess" is running on the server?

grizzled pelican
sinful tree
#

You must possess while running on the server.

#

The possess does not work if not.

grizzled pelican
#

oh. okay. will try it out

#

hm.. so i should have an event raised from the player to the server stating "hey, create this character and possess it for me"?

sinful tree
#

Depends on the set up of your game, but normally the server should be able to handle that itself. Again as an example, in the Game Mode "OnPostLogin" fires after a player has connected to the game and you're given a reference to their player controller. From that point you could spawn a character, and tell the joining player controller to possess it.

#

Game Mode also only exists on the server, so you're guaranteed that the OnPostLogin event is running only on the server.

#

Just a heads up too, if you see this icon on any other nodes, it means that the node needs to be executed on the server in order for it to work properly.

grizzled pelican
#

ooo oki. thanks~

final turtle
#

Hi 🙂 I am trying to replicate an TArray<FVector> using the Push Model. The Push model it self and the Replication of the MeshComponent which holds the array seem to be set up correctly (Replicating other, primitive typed, variables using the push model on this component works just fine). But somehow for the TArray the push model does not seem to be wroking. Is there anything that I have to do differently for array variables? Unfortunatly the documentation on the push model is very limited. It might me worth noting that I am not assigning the array, I am just changing the content of already allocated elements.

fossil spoke
#

Try looking into FastArrays

#

They achieve the same thing

final turtle
final turtle
# fossil spoke Try looking into FastArrays

To my understanding FastArrays exist mainly for efficient and having more controll over Delta-Serialization (At least thats what I used them for in the past). When my array replicates I can be almost certain that all elements in the array have changed. So writing my own struct with Serializer functions that efficiently replicate the whole array would be more appropriate for my use case I'd guess?

split siren
#

If a client has a skin, would you replicate that to other clients via replicated FSoftObjectPath variable?

grizzled stirrup
split siren
grizzled stirrup
#

Well if those props are already loaded then I'd say it's fine to just replicate the info directly

#

But I'm no expert

#

But as far as I could tell, only reason to use the soft pointers / load on demand would be if there's loads of stuff that mostly isn't loaded

#

like fortnite skins

split siren
grizzled stirrup
#

No you'd have an OnRep variable for the mesh in this case, changing it would trigger the OnRep func where you can set the mesh on the clients locally and on server

split siren
grizzled stirrup
#

UStaticMesh*

#

or skeletal if your props are skeletal meshes

#

then when the OnRep func triggers

#
StaticMeshComp->SetStaticMesh(ReplicatedStaticMesh);
split siren
fossil spoke
grand kestrel
#

GAS is disconnecting me when trying to send EventData. Did I miss something obvious? I've dumbed it down and stopped passing any data and still happening

FGameplayAbilityTargetData_CraftIngredients IngredientData {};
FGameplayEventData EventData;
EventData.TargetData.Add(new FGameplayAbilityTargetData_CraftIngredients(IngredientData));

UAbilitySystemBlueprintLibrary::SendGameplayEventToActor(this, CraftAbilityTag, EventData);
LogAbilitySystem: Error: Could not find GameplayAbilityTargetData_CraftIngredients in ScriptStructCache
LogNetSerialization: Error: FBitReader::SetOverflowed() called! (ReadLen: 8, Remaining: 0, Max: 331)
LogAbilitySystem: Error: Could not script struct at idx 0
LogProperty: Warning: Native NetSerialize StructProperty /Script/GameplayAbilities.GameplayEventData:TargetData (ScriptStruct /Script/GameplayAbilities.GameplayAbilityTargetDataHandle) failed.
LogRep: Error: ReceivedRPC: ReceivePropertiesForRPC - Reader.IsError() == true: Function: ServerTryActivateAbilityWithEventData, Object: AbilitySystemComponentFix /Game/maps/UEDPIE_0_devmap.devmap:PersistentLevel.B_DevCharacter_C_0.ASC
LogNet: Error: UActorChannel::ProcessBunch: Replicator.ReceivedBunch failed.  Closing connection. RepObj: AbilitySystemComponentFix /Game/maps/UEDPIE_0_devmap.devmap:PersistentLevel.B_DevCharacter_C_0.ASC, Channel: 3

The key thing it's telling me seems to be NetSerialize [...] failed but I don't know why it would. The struct has NetSerialize but since I've removed all props all it does is bOutSuccess = true; and return true; . And I do have a TStructOpsTypeTraits with WithNetSerializer = true

When testing in singleplayer everything works as expected. I've done it in another project (sending custom payloads via EventData) without an issue just not sure what I missed this time

grand kestrel
#

Got it. Missing call to UAbilitySystemGlobals::Get().InitGlobalData();
Give me a couple months and I'll be back the next time I need to send custom payloads and forgot this again

jade jolt
#

Hey there.

I am having exactly the same issue as described here:
https://forums.unrealengine.com/t/character-movement-is-stuttering-on-client/412572

when activating "component replication" for the skeletal mesh of a character, the character movement of the owned player is stuttering when playing as a client. for the server it looks fine.
turning the replication off fixes the issue, but i obviously want the skeletal meshes of my characters to replicate as i change their visibility or exchange the skeletal mesh as a whole while the game is running (talking about clothes etc)

anyone else ever had this problem or has an idea what i can do?

latent heart
#

You could always use RPCs to change skeletal mesh data.

#

Not a fix, but a workaround!

jade jolt
#

Not sure what you mean - i already run the function with the change of the skeletal mesh on the server and multicast it to everyone?

latent heart
#

It was in response to

but i obviously want the skeletal meshes of my characters to replicate as i change their visibility or exchange the skeletal mesh as a whole

#

If you've already got that working without replication then ignore my suggestion!

jade jolt
#

got the replication running, but it only works properly in all directions (server to client, client to server, client to client) when i activate the component replication for the skeletal meshes. and that introduces this strange movement stuttering even when i did not do any change to the meshes and they are all default

latent heart
#

It's probably replicating transforms and then there's infighting between what you think it should be and what the server is telling you it should be.

half umbra
#

can you help? ;p

#

hi everyone, how can i run levl streaming only on server?

#

@latent heart

#

i want level streaming totally locally

#

when server overlaping box collision then load/unload level for everyone

latent heart
#

Not a clue

fathom aspen
#

Replicating it makes the CMC go brrr

#

Also you shouldn't be multicasting

#

Check it out (from pins of this channel)

fathom aspen
past totem
#

please anyone knows why ? dedicated server spamming this when I login, and then the server won't work (I can move around but no server actions work)

past totem
#

hi, did you manage to fix this issue?

#

hi, did you manage to fix this?

#

hi, were you able to fix this?

solid raft
# past totem hi, did you manage to fix this?

I believe this was a symptom of too much network traffic, but I can't recall. Take a look at the network profiler to make sure you're not getting a terribly large amount of waste/excessive replication

past totem
#

it also says
"Failed to find an existing connection with a matching cookie. Restarted Handshake failed."

paper hinge
past totem
paper hinge
#

nope, I was using google cloud to host my server

past totem
#

okay, thanks

#

hi, did you manage to figure this out?

#

hi, did you figure this out?

quasi tide
#

Are you really just going through everyone and pinging them? lol

past totem
#

It seems like the most logical thing to do.

#

lol

#

At this point the rest are too old tho.

eternal briar
past totem
#

ahh okay. :/

eternal briar
floral zephyr
jade jolt
# fathom aspen https://vorixo.github.io/devtricks/stateful-events-multiplayer/

I don't think I understand the concept of OnReps - btw I am working in Blueprints:
What I have done now is that whenever I add or remove an item from my equipment, i copy that item to an array and I've set that array variable to OnRepNotify - in here I change the skeletal mesh.
It does not work at all on the Server, and for Clients it only works for themselves

pallid mesa
#

replication happens from server -> client

#

if you are setting your onrep'd variable in the client, that'll have no effect

pallid mesa
#

although if you want a server authorative system in which only the host is considered a streaming source then you might want to use volume based level streaming in which u filter for ls and authority

jade jolt
# pallid mesa if you are setting your onrep'd variable in the client, that'll have no effect

it's being set in a function that was called by another function that was initiated by the server, as the whole inventory system is happening on the server already.
so basically
Server: call function "move item" in that specific player's inventory upon drag and drop detected. if it's going to an equipment slot, call a function that handles adding something to the equipment slots. and at the end of that function, i set the onrep'd variable.
since the second function i mention is called by something the server did, I assume thats counts for the onrep as being set on the server still?

pallid mesa
#

well... I'm not sure I understand you, to ensure you are setting something in the server, add a print string right before u set the onrep

#

and be sure the printstring prints "Server: Hello"

#

u can do debugging, but I can't explain you debugging here

half umbra
#

in 5.1?

pallid mesa
#

most likely 😄

#

you can already grab that by downloading the engine from github using the main branch

quasi tide
#

5.1 is supposed to solve world hunger with how many things are going into it.

pallid mesa
#

tbh Duro, it works for me 😄

#

so many new bugs to fight!

quasi tide
#

Oh - I'm excited for it. Like everything I see, I'm like 🤤

pallid mesa
#

"hardcore state of the arting"

quasi tide
#

And there might be a chance that verse sneaks its way in there.

pallid mesa
#

ah yeah, we all saw a boolean swap to true on main 😏

quasi tide
#

Fortnite Creative 2.0 is supposed to release with verse support. Creative 2.0 is supposed to launch later this year. They flip that flag. Coincidence? I think not.

pallid mesa
#

well... NOw... I think that VErse will Make it whenever epic BEgins to upstReam 5.1 (I hope soon)

#

damn alt caps is not working too well today

twin juniper
#

NOVEMBER smartguy2_gif smartguy2_gif

#

I’m too smart for y’all sry

pallid mesa
#

how do you know my birthday? 😄

twin juniper
pallid mesa
#

relax ur going too fast, we've just met

#

anyways, keep it on topic pls XD, don't pretend this is #cpp

twin juniper
#

Yeah let’s move to the general talk channel aka #cpp double_nod

final turtle
jade jolt
# pallid mesa and be sure the printstring prints "Server: Hello"

Sorry if I can't explain this properly 😕
As I said, I am doing this in blueprints only.
So I made sure that the RepNotify variable is set on the server with that print string, regardless of who puts something into an equipment slot (client or server).

However, the RepNotify function only fires when a client equips something, not when the server does it - since i am changing the skeletal mesh in the RepNotify, the server won't do it when itself equips something.
Now I can of course change the servers skeletal mesh without the repnotify and make sure to check if "has autority" is given, but i don't get how to let the clients see that change other than through multicasting.

I guess it has something to do with what's written in that article:

"
OnReps in C++: When changing an OnRep variable in the Server, the OnRep behavior will only trigger on the clients when the value of the variable changes. The Server won’t trigger the OnRep, meaning that we have to call the OnRep behavior explicitly from the Server if we wish to execute it in the Server.

OnReps in Blueprints: When we set an OnRep variable in the server, the OnRep behaviour will be triggered always on the server (even if the value of the variable didn’t change). However, the OnRep behavior will only be triggered on the clients if the variable of the OnRep has changed. In addition, it is not possible to call explicitly the OnRep functions created by OnRep variables.
"

It actually seems that the above is not true for Blueprints anymore and it's similar to the C++ version now

twilit radish
#

It would be really weird if they changed that though. That would break many projects for no reason 🤔

jade jolt
pallid mesa
#

the rep notify behaviour should be triggered in the server aswell for bp use cases

#

so you've rep notified what exactly?

#

an array?

jade jolt
#

yes

pallid mesa
#

okay, let me do a little test for arrays in BPs ~

jade jolt
#

i mean i could make it something else if the fact that it's an array is the issue

pallid mesa
#

tarray replication is a bit peculiar, let's say that

#

but I'm going to do a little test

#

an array of what?

#

actors?

jade jolt
#

in my case an array of structures

pallid mesa
#

you are right, arrays don't trigger the onrep behaviour in the server for BP onrep callbacks

#

gonna give you a little medal 🏅

#

so, if you want to fix that

#

you have to wrap whatever you are doing inside the onrep in a function

#

and call it after u set the function

#

set(function with your behaviour) ----> function with your behaviour

#

the article doesn't cover arrays

#

but probably I should cover arrays 😄

#

since its somewhat peculiar

jade jolt
#

thanks for the info, it's been driving me crazy.
i have this ridiculous system of pieces of equipment that hide certain bodyparts and I am having a lot of trouble replicating that properly.
I am not sure if I got you right though: wrap what i want to do in a function means collapse, right? and that function within the OnRep can than be called by the server?
alternatively just using something else than my array as a variable (a single item instead array would be enough actually) would also make this work?

fathom aspen
#

Yes and yes. For the third question, yes it will work, though it will be set twice on the server, so stick with this approach only for array properties

pallid mesa
#

⬆️

bleak moon
#

Howdy! I've created a grapple hook with a custom physics constraint (physx,) however when I set the capsule component to simulate physics the Character Movement Component loses a lot of functionality due to it having some specialized logic checking if UpdatedComponent (the capsule component typically) is simulating physics.

#

Has anyone come across these issues with physics engine based movement of ACharacter before? Anyone have any suggestions to work around this? I've considered overriding the functions that are checking for physics simulation to rework the logic in those checks. And also considered creating a separate capsule to hook up to the grapple constraint to act as a proxy.

unkempt tiger
#

My code is having some trouble falling into sync when a player joins an existing server with an existing state, but so far I've only been able to test this when launching a dedicated server after packaging in non-PIE environments. What's a good way to maintain a persistent server and have the client join/disconnect via PIE so I can debug it properly? Every time I launch a client, it launches the server with it from scratch

jade jolt
# pallid mesa ⬆️

I still can't get the RepNotify to work as described in your article 😦

So this is happening in my inventory actor component, which is part of my player controller, after I placed an item in an equipment slot. Inventory arrays are also stored on the player controller at the moment.
The last item i added or removed is being handed over to a "RunOnServer" Custom Event called "ServerHideBodyParts".
https://i.postimg.cc/CMrS96VV/grafik.png

This Custom Event is part of another actor component called "EquipmentVisualization" attached to my player character BP, where I originally planned to handle things like hiding meshes, exchanging them and whatever.
It sets the item (type structure) that the event got as a variable called "EquipmentVisSlot", which is set to RepNotify. It's placed on the controller, just like the inventory array.
https://i.postimg.cc/1XFg8xpb/grafik.png

For testing purposes I only do this in the OnRep Function, hiding most of the head:
https://i.postimg.cc/s2CTxy5C/grafik.png

When I equip an item as the player that is server, the following happens - only the server sees the change, although the print string is actually shown for everyone. (server on the very right, clients middle and left)
https://i.postimg.cc/C54RGGQ4/grafik.png

Then, when I equip an item with a client, you can see that the server sees it, the client that equipped the item sees it, but the other client does not.
https://i.postimg.cc/XJRPfFCX/grafik.png

I wonder if there is a general setup on the controller or player character that i missed out on? Then again it partially works. And I already had it working with multicast at some point, but then the "late joiners" issue came up.
And as I was told before, I should not set the skeletal meshes to replicate "WizardCell — today at 15:03 - "You shouldn't be replicating the skeletal mesh component regardless of your needs, replicating it makes the CMC go brrr"

I'll go and grab some food, maybe that bring some new ideas

pallid mesa
#

but hang on im busy now, ill read you in a minute

#

Okay I'm back

#

@jade jolt by looking at your logic

#

I can tell you what is happening

#

controllers only exists in owning client and server

#

thereforce from an authority perspective of your controller

#

when you replicate down variables to the client

#

only the owning client will get em

#

so if you want these changes to be received in every end other than the autonomous proxy

#

you'll need to use another actor channel for replication

#

for example the pawn

#

or the playerstate

#

take a look at cedric's compendium

pallid mesa
#

I give a couple of tips about how to test this properly in PIE

#

TLDR: There's a setting in editor settings that lets you add one extra button to "add" clients to your server, you get a viewport and all the fuss, quite epic tbh

unkempt tiger
unkempt tiger
#

Couldn't find the button at first, but then I did, the UI is confusingly using the same icon as the simulate play button, I could have easily gone through an entire lifetime without finding out about this feature on my own 😅

lone kindle
#

When I kill enemy AI I set collision of the capsule to no collision and the mesh I set simulate physics for ragdoll. This works on the server, but on the client the capsule still blocks player movement and the enemy mesh does not ragdoll. It does move to the same position as the server, but on server is simulating physics, on client it is not.

sinful tree
#

Additionally, there is no need to have the "Server Kill Enemy" event be set as an RPC. The "AnyDamage" event can only fire when executed by the server, so that event path is already running on the server - just make it call a regular event.

lone kindle
#

I love you @sinful tree

vague spruce
#

hi! is there a command line launch option to specify a game mode for the client/server?

fathom aspen
#

yes, it's called game

vague spruce
#

great ty!

fathom aspen
vague spruce
#

yeah i just didnt know what "gameinfo" is

fathom aspen
#

Yeah the description there is somehow wacky

past totem
#

how to know when the player has finished loading into a server?

#

so like I want to make it so the player can't take damage until he fully loaded in

#

cuz it seems like my player is taking damage while in the black loading screen

past totem
#

thanks. I guess c++ only

plucky prawn
#

thats right. you could create a function library in C++ to easily expose it to bp if you wanted

past totem
#

yep

vivid seal
#

so if i declare a multicast delegate like
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FTestDelegate, const bool, FirstParam, const int32, SecondParam)
and then I create an instance of it, can I bind to it using a function that has a different signature (and by that, I want to use a function with no parameters). I assumed I couldn't do that but it's not giving me compile errors

sinful tree
#

It's like a unique ID that relates to that specific actor. The client/server relates that ID to the actor that exists on their end. It's not the full details of the actor if that's what you were worried about.

plucky prawn
#

no you need to set the array to itself if you want it to replicate. changing a single element will not replicate

quartz smelt
#

Is there something besides "Destroy Session" I should be using? Sometimes it doesn't fully destroy the session and forces players to try and join the server infinitely

vivid seal
#

You will not get callbacks per-item in a normal TArray, you will get replication if you add or remove elements (or set the array to a new array). You can use FFastArraySerializer for arrays of structs and get per-item callbacks like you want though if its important.

hard bluff
#

Sorry to post here again I got the seed to work but it only on the sever and it won't work on clients I'm sorry

latent heart
#

Don't apologise.

#

Not for trying and it not working out at least.

frank phoenix
#

Why does my entry map not render on the client (packaged), only the UI shows up. This is before connecting to the dedicated server. Is this expected? I can see some errors related to "Could not open FPipelineCacheFile" could that be the cause? Once connecting to the server everything renders as expected.

latent heart
#

Is the map actually packaged?

frank phoenix
#

@latent heart its included in the List of maps to include in project settings

latent heart
#

That isn't what I asked.

frank phoenix
#

How to check?

latent heart
#

Good question. You can package without using pak files.

#

Might be handy to check!

frank phoenix
#

ok will try thanks for the hint

clear island
#

just curious, when using a dedicated server how are you guys dealing with AnimNotifies? do you process them 100% server side or do you process them on the client for the local player and then send a server RPC and do them on the server after?

frank phoenix
#

@latent heart would it not print out an error - eg "cant find level...", i can see in the logs that the entry map gets loaded. Also the UI works.

latent heart
#

No idea. Maybe there's some sort of initialisation you don't do when it's locally hosted?

sly parcel
#

Hi I have a maze, i want to spawn 4 player characters within the maze. How would you go about randomly spawning the players within the maze boundary and not also get stuck on the walls. I assume you border the location using a sort of bounding box? How about not getting stuck on the walls, like also in the path of the ai nav mesh? Thanks

thin stratus
#

CMC Question (only in Packaged!): When having a runtime spawned Procedural Mesh inside a Runtime spawned Actor. Both not set to replicated and both created the exact same way on Client and Server, standing on it seems to anger the CMC quite a bit.
It prints that it can't resolve the Actor, and that the ServerMoves expire (ClientTimestamp wise).
As well as print on the Client, that it can't resolve the MovementBase.

What's the deal here? Does that Actor need to be replicated?
Does the Component need to be replicated?

dark edge
#

Maybe stabley named or whatever

thin stratus
#

Yeah it's a bit strange

#

This also doesn't happen in the Editor

#

I haven't had much time debugging it yet, cause it's from a tutoring session. So I will have a look at it in two weeks (vacation now).
Will see if I can figure out why exactly this even happens, cause a runtime spawned Cube (Static)Mesh(Component) via an Actor on both ends (even without replication) is not causing it (at least I've never had that issue before).
Sounds more like a specific issue with runtime spawned/created ProcMesh and SplineMeshes, but even that should not really be an issue.
Ah well, future me can suffer through that one.

solar stirrup
#

Had a similar issue with construction script spawned spline mesh components

#

Had to call SetNetAddressable() on them

#

Was whining about it not being addressable

proven grove
#

Hello, since a dedicated server is in charge of hosting a map, how can I start an instance of the dedicated server and tell it which specific map to load? Thanks.

dark edge
dim trail
#

i cant figure out why my replicated variable being shown in my UMG widget is 1 higher than the actual number

#

i decrement it on the server, but the umg widget seems to always be 1 ahead

#

i decrement it on the server

#

then i set the text on the event

#

but it always shows 1 higher in the umg

dark edge
#

@dim trailWhy u no RepNotify

dim trail
#

i will try repnotify

pallid mesa
narrow nacelle
past totem
#

hi, why is my replicated actor not spawning for the client?
Only in packaged 😭

#

I am spawning it on the server, the actor is set to replicated. But the client can't see it.

#

It works perfectly fine in the editor "run as client", but not in packaged on a dedicated server.
It works fine on a packaged listen server.

#

I am starting to lose my mind cuz I can't imagine what I;m doing wrong, just thinking there is some weird ue bug from soemthing I'm doing and I need to find a workaround, but I don't get what's wrong.

quasi tide
#

Make sure you own w/e is calling that server event

past totem
quasi tide
#

whatever

#

We don't know where this code is

past totem
#

I run this before calling the event

quasi tide
#

How are you calling it?

#

What class?

past totem
#

Actor?

#

it's a child actor

quasi tide
#

What class is physically calling this server event

past totem
#

actor, what else could it be?

quasi tide
#

...

past totem
#

BP_P_DOOR

#

😅

quasi tide
#

Okay. But how does this chain of events get started?

#

Is your player interacting with the door directly and calling the server event directly

past totem
#

okay,
the building [NOT REPLICATED] which is placed in the level
gets a child actor added to it which is the door
then when the door gets added I destroy it and spawn my actual door again

#

does this make sense?

#

lol

#

I'v been tryng to fix this for a few days.

quasi tide
#

You have yet to answer my question

past totem
#

not the player

quasi tide
#

What is actually CALLING this function

past totem
#

the server, when the level loads

#

begin play

quasi tide
#

Going to have to show more of your setup then. Because if what you say is true, it should be working. If it didn't, a lot of games would be broken right now.

past totem
#

😭 okay give me some time to wrap my head around this in a way that I can explain

#

a replicated actor that's in the level

#

I call it a replicated global actor I have a lot of replicated functionality on it

#

well no one? it's just part of the level

#

Idk what that means.

quasi tide
#

Had to hide from mods, lay low for a bit 😈

past totem
#

also just so I'm 100% sure, I can't spawn a replicated from spawnActor on a server actor that's not replicated, correct?

#

but why does it need a player controller? this is a dedicated server

#

I literally tested every way possible every option possible

#

It always worked

#

The only case it doesn't work is on packaged, with a dedicated server

#

you mean these?

sinful tree
# past totem but why does it need a player controller? this is a dedicated server

The idea of using "Execute ON Server" events is that you're allowing clients to call that event, but clients can only do so if they are the owner of the object. It's not necessary to mark an event as "Run On Server" if it's something you intend to only run on the server - you just make sure that you're actually running on the server (usually using the HasAuthority node) before calling it.

past totem
#

okay yes let me explain again

gleaming kite
#

What is TRAVEL_Relative vs TRAVEL_Absolute do for seamless travel? The source code just has the comment "/** Relative URL. */" and "/** Absolute URL. */" for both of them which doesnt help much

#

The server travel function also says "If bAbsolute is true and we are using seemless traveling, we will do an absolute travel (URL will be flushed)." But what does that mean in the context of the game?

past totem
#
  1. the building that's in the level [not replicated] spawns this child actor, this actor is the door that's set to replicate.
  2. in the door begin play, if it's client, I deleted the door. if it's server, I spawn a new door in hopes it will be replictaed and delete the old door.
#

do you get what I mean now? I needed to do this whole thing so it will work, but this doesn't work on packaged.. lol

#

😅

#

the asset pack did it

#

I'm trying to re-package again, I think I my last change might have fixed it but I just moved the wrong files, so Imm try again

gleaming kite
#

ah neat, make sense. Interesting that it says "if true is specified for the bSeamlesss parameter, this value must be TRAVEL_Relative." thanks for the info though!

fathom aspen
past totem
livid holly
#

is there a way to temporarily tell the server to stop updating a client's position?

fathom aspen
#

or try StopMovementImmediately

livid holly
#

for an autonomous proxy

fathom aspen
#

There's a setting on the CMC IgnoreMovementCorrections iirc

gleaming kite
#

If I wanted to persist just one property across seamless travel would the best aproach be to pass it in as an options string or should I make an AInfo actor to store this one piece of data (maybe more in the future) and persist that?

#

reading wizards compendium it seems like the options string wouldnt be the best option due to chaining as the server goes to other levels. So persisting an actor would be the best way?

latent heart
#

Use game instance?

gleaming kite
#

I suppose but that would run into issues if I ever bothered to go with dedicated servers and It doesnt really feel like the best way to do it

latent heart
#

Does the option string get passed to clients when the server travels then?

gleaming kite
#

I wouldnt need to pass it to clients, its just to check how many players where in the game before the switch from lobby to game and the game mode waits to start until all of those players have joined

latent heart
#

Then there's really no difference. One just involves converting it to a string and back again.

gleaming kite
#

Well using options strings and relative travel causes the new options to be appended onto whatever you had last time

#

I saw someone here talk about using SeamlessTravelCount > LastCompletedSeamlessTravelCount for checking if all players have traveled yet but im pretty sure that requires a first seamless travel to have happened begore your next seamless. So wouldnt work for players connecting to a lobby and then traveling to a level

latent heart
#

What you need to compare is SeamlessTravelCount >= NumberOfPlayers

gleaming kite
#

I guess i could just use the options string for the initial travel and then use that later

latent heart
#

And find a way to detect players failing to travel. Timeout or network disconnection.

gleaming kite
latent heart
#

Lots of people have written many things, you need to convert their wisdom to your use case. 😉

gleaming kite
#

haha yeah

#

thanks for the help

latent heart
#

20 isn't long enough, I think.

#

It's unreal. Loading complex makes will take a long time. You should test it out locally.

gleaming kite
#

that was just a ball park number but yeah, I will do some testing

radiant nebula
#

Can anyone help me with this? My aim offset is automatically replicated when looking Up and down. But the Yaw is not replicated at all. The Server can see both clients looking all directions. But Clientside only the Client can see its self turning left and right and cannot see the server turning at all

hazy snow
#

can anyone recommend a web hosting tutorial of some kind? i can deploy my server and access it over my local network, but not much success banging my head against aws/google/etc

vague spruce
#

hi. i'm reusing a level for both the menu and my main game. i have two different sublevels with different lighting maps. what is the best way to load the lighting scenario for each individual game mode? i have a menu game mode and a main game mode, but because the game modes live on the server i'm unsure how to tell the client to load the correct lighting map

fallow pendant
radiant nebula
brittle wigeon
#

We have 1 character BP, I'm generating a reference to that clients Player Controller in the character BP so I can access information stored inside the Player Controller BP, I tried 'Get Owner' as the wildcard but it only seems to work on the client, however if I use 'get player controller' and leave the index at 0, it works for both serv and client. Is this right?

sinful tree
brittle wigeon
#

Ah okay so it's irrelevant that it's index 0, there will only be 1 on each player BP

prisma pelican
#

how do you control which character gets spawned other than in the "default pawn", I want to spawn two different characters but it will only spawn same character twice

brittle wigeon
#

You would remove the default pawn under world settings and physically spawn actor selecting which character you want from class and possess

prisma pelican
#

okay ill try that thank you

#

does the character automatically possess on spawn?

woven basin
#

Can anyone answer; in C++ - why do we need to do both a UPROPERTY(Replicated) AND update GetLifetimeReplicatedProps() and add the variable in there?

It seems like double handling? If we declare the variable inside GetLifetimeReplicatedProps() - I dont understand why the UPROPERTY also needs it? Sounds like UE already knows?

(I'm sure there is a reason, just wondering if anyone knows "why")?

sinful tree
#

So one ends up being the "what" as its defined in the .h, then the "how" is defined in .cpp.

woven basin
#

yeah - i guess I'm just confused why we need the .h stuff - because Unreall will parse the .cpp and see all the variables there, so why duplicate the declaration? Or why not put the "how" in the UPROPERTY itself?

Just seems like a strange duplication I guess... not very DRY?

pallid mesa
#

U mean to put the flags and conditions in the .h or something like that?

#

well the getlifetimerepl. has some extra implications

#

there are loads of DOREP overrides

#

in which u can play with the behaviour of your repd properties

#

doing all of this in the H will simply overloead the uprop parenthesis

#

also order

radiant cypress
#

Hey ! I'm using a SaveGame to make the game spawn the right class choosen from each player before joining the Session.
It "Saves game to slot" before joining, and "Opens game from slot" from the PlayerController (in "Owning client" mode) to reach the right class inside it.
But when i'm testing with my friend, it seems that only the HOST's savegame is used, no matter what class the client choose.
Am I missing something ?

sinful tree
#

You'd need to replicate the choice from the client to the server.

radiant cypress
#

This is the only variable in the SaveGame object

#

It is replicated

sinful tree
#

Sorry my bad in wording it. Replication only goes one way. Server->Client. You'd need to call a Run On Server event to let the client tell the server their choice.

radiant cypress
#

Well i think i am :c

#

GameMode "Event OnPostLogin" fires in server, right ?

sinful tree
#

Game Mode only exists on the server.

radiant cypress
#

right

fallow pendant
radiant cypress
#

I make it fire in "owning client" :

#

and here is the "initialize" in the player controller

sinful tree
#

Where is the OC_StartPlayer event located? What class?

radiant cypress
#

OC-StartPlayer is in the gamemode

#

Fired when OnPostLogin

sinful tree
#

Game Mode only exists on the server. That means clients don't have a copy of it, and there is no "Owning Client", only the server.
So then by the time you're calling initialize, you're still only running on the server, so the server save game is loading whatever it had.

radiant cypress
#

Then how can i transfer it ?

#

I thought, by calling an event from each player controller, it would work ?

sinful tree
#

You'd probably have to do a "Run On Owning Client" on the player controller itself rather than in the game mode. Then the player just sends their selected option (hopefully like an enumerator, not an actor class) in a Run On Server event on their player controller, then when running on the server you can proceed with spawning etc.

radiant cypress
#

More simple, where do i have to open game from slot then ?

#

ok so

#

Initialize would be in server then owning client

#

let me try and screen

#

like so ?

sinful tree
#

No.

#

OnPostLogin > Cast "new player" to your player controller > Run On Client event (this needs to be an event on the player controller) > Load file (as you're running on the client) > Run On Server (Inputs the selection) > Spawns the actor and everything else your "initialize" would do

radiant cypress
#

I kind of understand but

#

im confused

#

like

#

in the PC

#

calling directly an owning client event

#

triggers me

sinful tree
#

"Owning Client" is literally the player that owns the object in question. Players own their player controller.

radiant cypress
#

yeah but

#

an owning client event needs to be called from server, right ?

sinful tree
#

Correct.

radiant cypress
#

then why is my screenshot false ?

sinful tree
#

Why do you need to call a server event to then call a client event.

radiant cypress
#

latest screenshot is from PC

sinful tree
#

You're effectively allowing clients to call the S_Initialize.

#

"Run On server" == Allow clients to tell the server to do something,.

radiant cypress
#

yeah but each PC is not the server

#

thats why im confused

#

i feel like i need to make them do a server event to be able to do an owning client event

#

but it is called by the game Mode, so it would be fine i guess ?

sinful tree
#

Things can be running on the server or on the client at any time.
Events in Game Mode, are always running on the server.

radiant cypress
#

is that your point ?

#

ok so it was

#

so then :

sinful tree
#

So calling an "Run On Client" event from the Game Mode ON a Player Controller object, means that you're asking that specific client to do something on their player controller.

radiant cypress
#

then

#

Still in GM

#

then

#

Is that correct ?

sinful tree
#

Up to that point yes, but I'm not certain on the Load Stream Level bit.

radiant cypress
#

i get you

#

i felt the same

#

should also be in pc right ?

sinful tree
#

I have no idea, I've never really messed with world composition/level streaming stuff.

radiant cypress
#

well thing is

#

i tried without

#

but level being big (from the store, not simplemade)

#

made UE crash during test, when joining the session

#

its like its not accepting the loading time if its too big

#

was working with small level

#

But when adding a big map (not even with word partition or anything, just big, but in one piece)

#

and replacing the small map with it

#

it wouldnt work anymore

sinful tree
#

Again, I can't comment on that bit... I'm completely unfamiliar.

radiant cypress
#

so i felt like opening the level after joining an empty level would be the solution

#

alright 🙂

#

But thx for the tips

#

i'll try everything that is new

brittle wigeon
#

Me and my partner are facing an unusual issue where, his connection is slower than mine, if he hosts a game and we server travel to a larger map, I will load in first somehow, and then it will not spawn me a character so I'm just floating, & if I force spawn a lot of the functionality doesn't work as if I shouldn't be there. Is there a way to stop the clients from loading in before the server has?, the fix seems to be me hosting as I load faster

low helm
#

I imagine this isn't about connections, though I could be wrong

#

It probably has more to do with processor speed

#

Maybe his computer is a clunker, struggling to load things up in time

#

Which causes some of the server's normal setup to not be done on time

brittle wigeon
#

Is there a way around it do you think? Otherwise if someone with poor connection hosts a game things aren't going to work correctly

kindred widget
brittle wigeon
kindred widget
#

Why not use the game mode's default spawning functions?

gleaming kite
#

Is there any way to get smooth movement on a platform that moves up and down? Things are fine when other player are still but when they move there is a lot of jitter up and down.

past totem
#

Good morning everybody

brittle wigeon
gleaming kite
#

Do multicast delegate broadcast events work on the client? For some reason they only will fire on the server

kindred widget
gleaming kite
#

Yes but is it possible to call .broadcast() on the client? I have a match state that i use an on rep function to drive logic. For now it just broadcasts a delegate (So each client is broadcasting their own). The broadcast fires but for some reasons the events bound never get called. But if im on the server it works fine.

#

Also i did check to make sure the broadcast and binding of delegates were actually getting called on the client

past totem
gleaming kite
past totem
pallid mesa
#

hey

#

🦆

past totem
kindred widget
#

@past totem I think you got lost. #lounge is over there three doors down the hall on the left.

past totem
#

I am just mentally preparing myself for this day of multiplayer fixes

#

I'm thinking if to ask my question

#

If there is any point

#

Because I think no one will know because I think unreal is broken

#

It's been days

#

No, it's been weeks

#

Some would say months

#

But I still don't know how to fix this issue

stoic lake
#

hi, how do you carry over information from the playerstate when creating / joining a session and or loading a new map?

kindred widget
stoic lake
#

Ok thank you

#

Would you care to elaborate on server travelling

#

not sure how to do that

#

For instance when the host picks a map, have all the connected players follow the host

kindred widget
#

Should be as easy as calling it. Are you Blueprint or C++? I think the game also needs to be set up for persistent level and such too, not 100% on the full implementation requirements.

kindred widget
#

I think you can console it, at least for testing. I don't know if that's been exposed in 5.0. Also don't know if console BP calls work in shipping versions, have never tested that personally.

stoic lake
#

alright thank you

kindred widget
#

I think the console is something like "ServerTravel MyMapNameHere?Listen" if memory serves.

stoic lake
#

does a bp node exist for that?

kindred widget
#

ExecuteConsoleCommand

stoic lake
#

ahh gotcha

kindred widget
#

This also won't work in PIE, forewarning. You can only test servertravel in a Standalone, or packaged game.

stoic lake
#

would running the game like this suffice?

#

or do you need to select standalone game as well

kindred widget
#

That's fine. I don't know if you can test locally. I'm used to running through Steam, which only supports one application at a time of the same type. Can't see my own sessions for example.

#

Null Subsystem might support it though, unsure.

stoic lake
#

Ok, thank you :)

wooden cypress
#

How do I get the controller when doing multiplayer games?

grizzled stirrup
#

You can get the controller of each local player on their machine (via GetController() on pawns or GetOwner() on playerstates) @wooden cypress

#

Controllers exist for all players on the server so using the PlayerControllerIterator in the Gamemode will work

wooden cypress
#

Is there a simple function I could create so I wouldnt have to fill up my bluepritns with repeated code?

grizzled stirrup
#

Get controller into a cast is pretty simple code?

#

You can cache the controller pointer when the pawn spawns if you really want but it may become out of date if you change possession

grizzled stirrup
#

No, the GameMode doesn't have a controller

#

What controller are you trying to get here?

#

Also you are casting from a controller to a controller which doesn't make sense, you only need to cast if you are casting to something more specific like your custom controller blueprint class

wooden cypress
#

I'm trying to replace the GetController here

grizzled stirrup
#

Where is this being called, the pawn?

wooden cypress
#

The blueprint of the character

grizzled stirrup
#

Yeah in that case there's no need to replace it, it'll work without any casting

#

The GetController node is enough

wooden cypress
#

I get errors after starting though

grizzled stirrup
#

what errors

wooden cypress
#

I thought it was caused due to the Controller

grizzled stirrup
#

Right so if you are calling this on tick or something, there may be a while before the controller is actually available on the character

#

So do an IsValid check on the Controller blue pin before using it

wooden cypress
#

isValid returns a boolean

grizzled stirrup
#

There is an IsValid macro alternative

#

Which has a valid or invalid output

#

You can alternatively do a branch from the boolean IsValid node

wooden cypress
#

So this is the full code

#

You are right it is being called every tick

#

Im not sure there is room for a valid check in this though

grizzled stirrup
#

This is a weird way to handle input, have you referenced the example third person or first person BP projects to see how it's usually set up?

#

You can greatly simplify this logic to not have duplicated nodes

wooden cypress
#

This is a 2D project so I started from blank

grizzled stirrup
#

Well yes anyway the IsValid nodes can go right before the SetControlRotation nodes

wooden cypress
#

That worked ty

grizzled stirrup
#

And sorry I misread your graph, I see that you are rotating based on speed and not handling input directly so this is fine

wooden cypress
#

Can you explain what th ewproblem was

grizzled stirrup
#

The controller isn't valid for a few frames right when the character is created

#

It is possessed after the fact

wooden cypress
#

Ahhh

fathom aspen
weary laurel
#

friends, I downloaded the source and compiled it. When I right click on the upproject, the switch does not show the unreal engine version, what could be the reasons?

crystal crag
#

Looking over the lyra project, there is one thing I don't understand about its setup. The experience manager will replicate the experience to the newly connected player and then the experience manager on the client will start to load the assets. Wouldn't you want to do all of that before having the client connect to the dedicated server session?

#

otherwise the client won't have everything loaded when they join the world and things could break right?

#

well "break" was poor way to state it, because that all depends on how you program the game, but it just seems odd I guess that they wouldn't load most assets upfront before the client actually calls join session

proven grove
# fathom aspen Joining sessions is hard travel so you don't get the juicy seamless travel benef...

Hello. Thanks for your compendium, I learned a lot. But I have a question, just to be sure.
If my game is divided into several maps managed by independent dedicated servers, knowing that there is no notion of lobby in my game, seamless travel is impossible in this case, right? A seamless travel is only possible when the dedicated server travels via ServerTravel and brings the clients with it?

twilit radish
fathom aspen
twilit radish
#

Would be interesting if it was possible, but probably not many would use it.

#

Although if it would be really nice for VR if connecting wasn't a hard travel.

#

But again, not the main target group of Unreal I suppose 😛

fathom aspen
#

Their FAQs say that they would like to do it. But I don't think that will be done any time soon.

twilit radish
#

Epic would "like to do" a lot lets be fair 🤣

proven grove
#

Thanks again Wizard. So I guess I'll have to save the general players' data (like their names or their customizations, the data they will have for each maps no matter which one they are on) into their GameInstance. But it makes me wonder about safety, can't they manipulate the data inside their GameInstances with Cheat Engine or so?

twilit radish
#

They absolutely can.

#

The one golden rule with multiplayer regarding authority is: Never trust a client.

fathom aspen
#

Always validate

#

And if you read my compendium to the fullest you will change your mind probably and opt for Subsystems

twilit radish
#

If you want a cheat proof system you will need a backend system that keeps track of player's their data that can be dynamically saved and loaded from your dedicated servers whenever someone leaves/joins. Which is quite the hassle honestly.

proven grove
#

Haha yeah. So in this case I'll probably need a super server above the game servers that knows everything about the players that are currently connected, since the game servers can't interact and share data with each others I guess

fathom aspen
#

I mention the validation part at some point too

twilit radish
#

Game servers could share data directly with each other in theory. But I would say it's a really bad idea to have dedicated servers track player data and not some standalone system. Imagine if someone leaves your game then only the last dedicated server they connected to has their data.

#

If something then happens to that server you have a big problem.

proven grove
#

True.

fathom aspen
twilit radish
#

Not even just that. It's just a big big mess.

#

For example: How do you keep track of where the data is?

#

Backups are also going to be complete chaos.

fathom aspen
#

On disconnects? It's always the server they were connected to.

twilit radish
#

But lets say you have multiple dedicated servers, how do you know where to connect to make sure that the data is there?

#

And what if that server is full?

#

Just soooo many scenarios.

fathom aspen
#

Either that or "trust" the client and validate when they back

twilit radish
#

You can totally have persistent data be secure, but just don't store it directly on the server you host the dedicated server.

#

It should just be a separate system or database.

#

And that does make it a whole lot more complicated though.

fathom aspen
#

The database part is kinda crucial I agree. That's how you validate at least.

twilit radish
#

Assuming we're still talking about the multiple dedicated servers stuff of course btw. If you're making the next Minecraft no one will care about something like this 😛

fathom aspen
#

I haven't covered that one yet. It's notated as coming soon™️

proven grove
#

xD

twilit radish
#

Wizard going to make a popular tutorial, then make one security mistake in there and ruin everyone's life 😂

#

❤️

green moat
#

I'm working on a backend for my game, how would I verify that their request is valid? I was thinking of adding a jwt to each item to match with but I'm not sure if thats a good solution.

proven grove
#

I already have an API that does the authentication/authorization stuff with a dabatase, I'll extend it to keep track of the connected players' data (hopefully there is not that much data xD). Thanks again!

fathom aspen
twilit radish
twilit radish
green moat
#

I don't know where else to ask, google has not been helpful with the keywords I've given it

twilit radish
#

By either storing it on your own backend and verifying they actually own that item or if stored / trusted by a client not being sure.

#

Like I said before, if you let a client decide whether or not they own something then you just can't be sure. Clients can't be trusted if you care about cheating.

past totem
#

I'm spawning a replicated actor but when I try to spawn it at a specific location (at the building's entrance) it won't spawn it for the client (spawned for the server and blocking me from passing but invisible). This issue only happens in packaged with a dedicated server, it does not occur with a 'play as client' in the editor.
Why ? : (
Spawning at other locations works fine, it's just sojmething wrong with that building entrance, any building, not just that one building.

pallid mesa
fathom aspen
past totem
#

lol

fathom aspen
#

I'm on phone

#

Excuse me

twilit radish
past totem
#

again, it works in editor but not in packaged

green moat
pallid mesa
#

xD

twilit radish
past totem
#

I don't know what to do

fathom aspen
pallid mesa
#

dunno yet I injured my left eye xD

twilit radish
pallid mesa
#

might be a pirate soon 🏴‍☠️

twilit radish
#

😅

fathom aspen
#

Epic should pay your healthcare fees

pallid mesa
#

i live in spain

#

no healthcare fees 💃

twilit radish
pallid mesa
#

anyways in my case I'd have to use an onrep to add the pirate patch

pallid mesa
twilit radish
#

But how can a client abuse that? I assume that's server side right?

pallid mesa
#

thing is that the CDO default value in the config is 200

fathom aspen
pallid mesa
#

and peeps didn't take the time to modify the default value probably due to lack of knowledge of what it meant

twilit radish
#

So for shooter game they properly initialised it but projects that cloned the game had a massive hit detection?

pallid mesa
#

by clamping it programatically or with a meta you are ensuring the config cannot go beyond certain thresholds

pallid mesa
#

at 200

twilit radish
#

So shooter game it self just did it in a bad way lol.

#

Great stuff 💯

pallid mesa
#

well yeah and lyra doesn't have any preemptivr measure

#

the followup is probably more interesting

twin juniper
#

If I get the time to

pallid mesa
#

a simple distance check to enable scalability might be sufficient depending the use case

twin juniper
pallid mesa
#

but if u need accurate detection then you need to do something similar to what valorant did

pallid mesa
#

but you also need to ensure location

#

accounting for latency

#

thus thresholding

twin juniper
#

Might maybe do what Fortnite do, they do another line trace on server to ensure nothing blocked the hit again (a newly spawned wall or someone using magic bullet I guess?)

pallid mesa
#

they do distance + blockage

#

without rewinding

twin juniper
#

At least that’s what kaos said a few months ago

pallid mesa
#

for Direction must be direction vector

#

so yaw/pitch

twin juniper
#

Oh ok

#

Anyway, this is the next thing I need to work on, so I might share a few snippet on it when I’ve done it 👍

pallid mesa
#

🦾

#

go for it buddy

#

i need to ask kaos to resume a bit his kaosgame

#

we busy

twin juniper
twilit radish
twin juniper
#

well.. by "took" i meant inspired x)

pallid mesa
twilit radish
#

I mean using the bounding box is already enough leniency I would say xD
But if you were to ever make this hitbox specific it would definitely give issues.

twin juniper
#

did you work on the weapons ?

#

i got the same logic, but i'm stuck on smth atm

pallid mesa
#

I havent worked on his weapon code directly just on tiny details

#

but I cannot read that long text rn

#

im in the hospital

#

x'D

twin juniper
pallid mesa
twin juniper
#

i would not asked if i knew x)

twilit radish
pallid mesa
#

my example is a hello world

#

since we are using bounding boxes and an interpolation method

#

u probably dont need tolerances

#

the conflicting data resides between timestamps

#

also, in valorant it works great

#

and they dont do it based on bounding boxes

#

they do it based of bones

#

😄

twin juniper
#

Do you know how fortnite disable animations on server side ? I mean the whole anim instance

pallid mesa
#

its by default

twin juniper
#

So it's not specific to them ?

#

As everyone say

#

I mean it's not smth they implemented for their game.

pallid mesa
#

no its not specific to them, its a setting in the skel mesh

#

u can run simulations on montages

#

or u can run it always

twin juniper
pallid mesa
#

it's an enum in the skel mesh i believe

twin juniper
#

I wanna look at how it works in the source code

pallid mesa
#

not by memory

twin juniper
twilit radish
#

Fortnite supposedly doesn't even use a custom engine version btw.

quasi tide
#

They do - in that it is ahead of what we have

pallid mesa
#

they do

twin juniper
#

by a dev here

pallid mesa
#

they do have things before we get them

#

😄

twin juniper
#

i'll search for the message wait a min

quasi tide
#

They would be on like, 5.2 while we're on 5.1, for example.

twin juniper
quasi tide
#

Plus of course, they have their own tools they wrote

twilit radish
#

Having it before others is still not a custom engine version in my eyes though.

twin juniper
#

Like features exclusive to them

#

they just test things on Fortnite before we get them

#

Fortnite is like a test field

pallid mesa
#

if that's what you mean

twilit radish
pallid mesa
#

yes, but they do have things they wont release as its too much game-code

twin juniper
#

he was answering me i guess

twilit radish
#

Next Unreal version: Set up your own Fortnite 😛

latent heart
#

There's no fortnite version of unreal because unreal is made to support fortnite lol

twilit radish
#

I mean I really don't mind, at least they use their own product all the time.

grave lynx
#

Hey, is there a way to 'set owner no see' a light component?

candid gale
#

this in C++ mind you

#
// Crate.cpp which extends from InteractableAssetBase
Actions.Add({
    FText::FromString("Destroy Crate"),
    [&](ACppProjectCharacter* player, AActor* item)
    {
        AInteractableAssetBase* itemActor = Cast<AInteractableAssetBase>(item);
        itemActor->SetOwner(player); // Note I tried this as a little hack I saw on the forums, didn't work
        itemActor->DestroyThisActor();
    },
    [&](ACppProjectCharacter* player, AActor* item)
    {
        ACrate* itemActor = Cast<ACrate>(item);
        return itemActor->IsCrateEmpty;
    },
});

// InteractableAssetBase.cpp
void AInteractableAssetBase::DestroyThisActor() {
    DestroyItself();
}

void AInteractableAssetBase::DestroyItself_Implementation() {
    Destroy(); // Doesn't run of course
}
hollow eagle
#

RPC from the character or player controller, then let the server-side call further functions on that object

candid gale
#

That's what I thought, but then that means I have to make every single RPC call I want from a specific actor or actors to be re-routed through the player controller then back to the actor?

#

wouldn't that just get messy?

#

dozens or hundreds of functions from other actors in the player C++ file?

#

I would've thought there would be some sort of workaround

hollow eagle
#

the workaround is that your design shouldn't lend itself to hundreds of functions like that

#

for example, a generic "Interact" function on the player controller and pass in some identifier for what option of the menu was selected

#

maybe that's an option index, maybe it's an FName that specifies which option was selected. On the server you just pass that along to the object you're interacting with and let it decide what to do.

candid gale
#

can I pass lambda functions on an RPC call?

hollow eagle
#

no

candid gale
#

shit

#

would've used it as a parameter to run on the server

hollow eagle
#

Again, just have a generic "menu was interacted with" function, pass the object and what option was selected.

#

server should validate that the player is allowed to interact with that object and then pass the information along

candid gale
#

alright, sounds good

#

thanks

past totem
#

I'm spawning a replicated actor and in the editor on 'play as client' it works great, but on packaged with a dedicated server the actor won't spawn on the client (invisible but has collision)
#multiplayer message

cold moat
#

Hello once again. A quick doubt, as my game is online, keeping important information in the Game Instance isn't really good, is it? I mean, it doesn't communicate between sessions, does it? I'm considering leave important player information on the player character instead. Then I just need to load the information between sessions.

plucky prawn
rapid bronze
#

Depends how important the information is too, what type of info, if you trust the client with it