#multiplayer

1 messages · Page 136 of 1

final bluff
#

ill show an example

#

in this example i am pressing "W" on keys

#

in this next example i am also just pressing "W"

#

So Its not necessarily that " basically when u press W on client u get D action " i think its that "W" is going to move my character in a forward direction of the camera but for some reason the camera has a different spawn orientation than player 1

elfin creek
#

i don't think that the camera is broken i think more like the player controller rotation is the one that is not right.. is the character moving forward based on the direction of the root or the camera ?

#

try to set the player controller rotation after the spawn

final bluff
#

How would i set a rotation of a player controller?

elfin creek
#

u can use the set controller rotation function by draging from the PC

final bluff
#

?

elfin creek
#

what do u use to posses the pawn ?

final bluff
elfin creek
#

drag from it and u should see this

final bluff
#

also tried like this , staright from player controller that is the target of the posses

elfin creek
#

yes exactly

#

get the rotation from the transform u r giving to the spawned unit

final bluff
#

same issue :/

#

Thank you for the help btw!

elfin creek
#

sorry it wasn't so useful 😅

final bluff
pallid mesa
worthy knot
#

is there a command to force set ping to a certain number like there is a command for max fps ?

pallid mesa
#

Within Play Settings ull find network emulation settings to emulate latency within the editor

grizzled stirrup
#

There's also these

Net PktLoss=1
Net PktOrder=0
Net PktDup=0
Net PktLag=75
Net PktLagVariance=0
p.netshowcorrections 1
log lognetplayermovement verbose
tall drum
#

Hey

I am spawning a deferred actor with empty mesh and animation but in SpawnActorDeferred() I am setting a new SKAsset and new animation:

            NewUnit = GetWorld()->SpawnActorDeferred<APTUnitBase>(APTUnitBase::StaticClass(), transform, this, nullptr, SpawnInfo.SpawnCollisionHandlingOverride);
            if (NewUnit)
            {
                NewUnit->Spawner = this;
                NewUnit->Mesh->SetSkeletalMeshAsset(UnitData->Mesh->GetSkeletalMeshAsset());
                NewUnit->Mesh->SetAnimClass(UnitData->Mesh->GetAnimClass());

Spawning work but setting mesh doesn't on client because I have Actor->HasAuthority check before doing the spawn (otherwise it spawns twice)
I was wondering what is the "best" way to set a new mesh and animation for all clients?
For now I am thinking about a RepNotify on the SKmesh

#

I am mostly thinking about other options for replicating not really the "best" cause I think its subjective

grizzled stirrup
#

Otherwise do it on OnRep_UnitData

tall drum
#

thanks!

dawn tendon
#

To use dedicated servers in UE5, do I need to use the Unreal Engine source version?

dark wing
#

just for development purposes?

dawn tendon
#

yeah

#

for now

dark wing
#

or are you trying to like upload it on a server

dark wing
#

right?

dawn tendon
#

Like I am planning to host a server on my pc so my and my teammate can test the game, and later on we will have bought servers

dark wing
#

"D:\UE_5.2\Engine\Binaries\Win64\UnrealEditor.exe" "D:\ue5fps\Phoenix.uproject" test1 -server -log -nosteam

Change unrealeditor.exe to your unrealeditor.exe destination, and phoenix.uproject is your project (uproject) file destination, test1 is the map name

#

create a bat file and add the line to it

dawn tendon
#

and thats it?

#

for hosting a server on my pc?

#

@dark wing ?

#

i can do it with the from launcher build?

dark wing
#

yes

#

thats it

dark wing
dawn tendon
dark wing
#

of course

dawn tendon
#

wait one more question

dark wing
#

first

#

open the server

#

try to join locally

#

default port is 7777 if you didn't change it

dawn tendon
dark wing
#

go to unreal engine, disable separteserverblablablah, and then press ` and type open 127.0.0.1:7777

dark wing
#

but two destinations

dawn tendon
#

so I type that, replacing everything that needs to be, with a space, and press enter

dawn tendon
dark wing
#

join any channel

#

so i can help u

dawn tendon
#

here

#

@dark wing

shrewd ginkgo
#

When I make the videos I watch to make multiplayer replicated doors, they don't work when I make them. Can anyone help me with how to do this?

elder sable
#

Hi, i have an actor that replicate a variable, and i would like to keep the replicated data when the actor is destroyed, is it possible to replicate a variable from another class (like a subsystem) ?

blissful slate
#

I'm working on spawning projectiles from a Gameplay Ability currently and running into a bit of a snag.

I setup a UWorldSubsystem to pool some projectile actors, and then ideally I'd like to just send an event to each player that a projectile was fired.
Clients can enable the visuals, and server can do the hit detection.

I was trying to do a NetMulticast function that then called a function on the subsystem, but client's don't see anything other than their own projectiles.
All other projectiles seem to be hidden.

My goal with this was to not fully have to replicate projectile actors, and instead just the event to fire one.
I'm not sure if this is fundamentally wrong/a bad idea, or if I'm just bumping into a small snag. Any suggestions?

#

https://forums.unrealengine.com/t/programming-subsystems-and-replication/506005

Found this, looks like rpcs directly on subsystems have some caveats.

Epic Developer Community Forums

Programming Subsystems and Replication Article written by Alex K. The engine’s Programming Subsystems provide lightweight and easy to use extension points for core engine classes. When using these subsystems for a multiplayer game or other networked project, these may seem like a good place to include networking related functionality, such as s...

dark edge
#

No game code would talk to the actor directly, only the subsystem

blissful slate
dark edge
#

game state maybe

#

but just have the subsystem spawn an actor and call it a day

grave lynx
#

I'm creating a AI, I'm trying to know is someone is looking him, I created a blueprint service. The value of recently renderer is always false for the client. Should I use RPC here?

dark edge
blissful slate
grave lynx
dark edge
#

just the subsystem talks to its actor for network stuff

#

Do you want clients to fire off projectiles predictively?

blissful slate
#

The logic flow is

Gameplay Ability calls subsystem fire.

Subsystem grabs a projectile from it's pool, and then sends it an init event with some configuration data, and the firing information.

Projectile uses that info to toggle on visuals, and fire in a direction.

On collision, the projectile toggles off visuals and collusion, and if it's the server, applys a GE for damage

dark edge
# blissful slate Not predictively, just triggered from the server. I'm trying to keep from having...

Yeah that could look like:
Gun or whatever (Serverside):
Entry -> ProjectileSubsystem.FireProjectile(Data)

ProjectileSubsystem (Serverside):
FireProjectile -> MyNetManagerActor.MulticastFireAProjectile(Data)

MyNetManagerActor (Everywhere):
MulticastFireAProjectile-> ProjectileSubsystem.FireProjectileLocal(Data)

ProjectileSubsystem (Everywhere):
FireProjectileLocal -> Switch/branch on authority and role etc -> do the thing

blissful slate
#

Ahh gotcha, thanks a bunch for the detailed breakdown. Still green in my multiplayer experience

dark edge
#

If you wanted to predictable fire a projectile it'd just be a question of making some id locally when you fire, which is then matched up when the rpc or replicated data comes back

#

Whether or not that's useful depends

blissful slate
#

Yea, that's in the plan long term.
ID's could also help for a few other things as well. Just getting my initial proof out of the way, and wanted to make sure I could do a whole lot of projectiles without excess spawning, or eating crazy bandwidth by completely replicating it

final bluff
#

Anyone have an idea On why the camera is behaving like this on the client ?

blissful slate
# dark edge Yeah that could look like: Gun or whatever (Serverside): Entry -> ProjectileSubs...

Hmm with this setup, I'm still bumping into the same issue where clients don't see projectiles fired by the server

When I execute the ability on a client, it correctly executes the FireProjectileLocal on both client and server.
But, when executed on the server, it only executes FireProjectileLocal on the server.
I'll toss my code into a txt file and upload that, so i don't break the message length limit.

blissful slate
#

I'm wondering if the client sees its projectiles because the ability executes locally, and on the server. So it executes the function on its instance of the subsystem.

But when the server executes it, it only runs on the server.

Is it possible that the netmulticast function isn't actually replicating out to the client?

thin stratus
blissful slate
thin stratus
#

Depends on the Event

#

GAs aren't and mostly shouldn't be replicated

#

Some arbitrary data probably through some other actor

#

If it's just visual stuff you could use a GameplayCue

blissful slate
#

Each client has a pool of actors for use, I just need to notify each client to use one because someone fired.

thin stratus
#

Right, you are mostly struggling with SimulatedProxies

blissful slate
#

Exactly, still new on multiplayer, gotta figure out the quirks

thin stratus
#

I would probably have used an ActorComponent on the GameState or similar

#

And just Multicasted there

#

While also passing in the "Shooter", so you can check if "IsLocallyControlled" to filter the local player that predicted already.

dark edge
#

Quite the jump lol

thin stratus
#

I mean, ActorPooling and Subsystems aren't really Multiplayer problems in UE

#

If they already have some understanding of that form SP, then they are quite fine

blissful slate
#

Oh yea, I've done gas and subsystems plenty, just haven't needed to do replication.

blissful slate
sinful tree
elder sable
#

I can't use the rep macro with an external object, so i'm not sure what you mean

sinful tree
#

In terms of replication, you need a replicated object/actor and for the property to be marked as replicated in order for clients to receive it. The replicated value would exist only on that particular actor that has that property. You can use OnReps to drive additional logic that could copy that data somewhere else as needed, or use the OnDestroy event on the actor to copy it to where you want.

elder sable
#

Mh i was trying to avoid copying data

sinful tree
#

If you destroy the actor, which contains the reference to the variable, how else would you keep the data contained in the variable if that actor is destroyed other than by copying it somewhere else?

elder sable
#

I don't know that's why i ask :p Maybe with a shared ptr so when the actor is destroyed, the object is still alive

sinful tree
#

Objects (effectively anything in the engine) are the things that contain data. If you destroy the object, the data it contains goes with it.

elder sable
#

I'm trying to do somthing like that :

// subsystem
uproperty(replicated)
UObject* Data;

// actor
uproperty(replicated)
UObject* Data; // ref to subsystem data
// 
DOREPLIFETIME(subsystem, Data)
#

So when the object is destroyed, the data is not

sinful tree
#

Subsystems don't replicate as far as I'm aware. UObjects also do not replicate by default, but can be made to replicate.
In your example provided, if the object that contains these properties are destroyed, they are no longer being referenced by this object. Unless you tell another object to have a reference to those objects, (which isn't copying them directly, it's a matter of copying the pointer to them) then you'd have no way of referencing those replicated objects.

elder sable
#

So a shared ptr would work ?

sinful tree
#

If you mean a TSharedPtr, I'm not sure as I'm not super well versed with them yet, but based on my understanding it wouldn't be necessary to use a TSharedPtr.
An Object will normally continue to exist so long as something has reference to it. If you have a replicated reference, and set something else to also use that reference, you're not copying the object that exists, you're copying the reference, allowing that other thing to have the reference as well, which will also keep the object in memory.

#

I think where you may run into trouble is that if you're not keeping reference on the server to the replicated object, then when that object reference is destroyed on the server, I imagine it would also destroy it on clients even if they have reference to the object elsewhere, unless you use something like TearOff() which is something that Actors have to essentially tell clients to stop handling the actor as replicated.

elder sable
#

It's in a game instance subsystem server side so it's always alive

#

It seems shared ptr are not working with replicated properties, but TWeakObjectPtr works

#

Will try with that and use ondestroy functions if it's not working, thanks for your help !

blissful slate
unborn nimbus
summer tide
#

So I overriden PawnLeavingGame and instead Destroy() i called Unpossess from server. It partially works since it doesn't remove the horse but the human character is still stays on top. I can't remove the rider.

limber cloak
grand kestrel
#

@thin stratus
Is the cost of replicating these is identical:
1.5884483832907
2.0
( @pallid mesa )

#

CMC rounds the acceleration instead of serializing

#

Even though the data size of the float wouldn't change it must suggest something is happening behind the scenes? Otherwise they'd serialize

shrewd ginkgo
#

When I make the videos I watch to make multiplayer replicated doors, they don't work when I make them. Can anyone help me with how to do this?

elder sable
thin stratus
#

Acceleration is using a special Vector Type that does get serialized differently

#

It's a bit more complex in code, but summed up all it does is save each component for the Vector as an Integer after "scaling" it first to preserve the decimals

grand kestrel
thin stratus
#

@grand kestrel Relative simple

#

They use the Move to ... move

#

And if the Server moves with a version that has 1300.1 acceleration

#

And the client moves with 1300.1999

#

It would ultimately cause a different result

#

So if they only send a cut off version to the server

#

They need to ensure the client moves with the same cut off value

mystic estuary
#

Hello, does anyone know how I can change character's mesh relative location on play time? I'm implementing some logic for being knocked down (i.e. the player has to crawl), and I need to move the mesh from -90 to something like -35.

I have a OnRep bool bIsKnocked, and when it's true, I set the mesh offset to -35, but it doesn't work properly. It works fine for local characters, but not for the remove ones. If there're 2 players, (server character is called A, client character is called B) server-side the character A will have the new Z offset, while the B will have the original one (set prior to play time), and client-side character B will have the new Z offset, as well as character A, but as soon as character A starts moving the offset restores to the one set prior to play time.

Any suggestions?

pallid mesa
#

@thin stratus I believe he wants to ask if rounding (removing decimals in this case) reduces the amount of bits the << operator would send.. and i havent looked into this specifically but I think for a normal float it wouldn't... as for FVectors... maybe its serializer does something wild but afaik you are supposed to use the quantized types for that 🤷‍♂️(@grand kestrel for visibility)

thin stratus
#

It sounded to me as if he just didn't understand why they are rounding.

pallid mesa
#

ah no, spoke to him earlier about this

solid river
#

Should a non-simulating-physics trigger box, for example, be a replicated actor?

thin stratus
#

What makes you think it should?

solid river
#

To avoid out of sync. For example, the client computer runs slower, for some reason, than the server does.

thin stratus
#

Is that box moving?

solid river
#

For example, a projectile owned by a client's player has entered the trigger box on the server while it has not on the client because the client computer runs slower (busy doing computation).

thin stratus
#

If the box isn't moving and you don't need to replicate any variables or events in it, then there is no need to replicate the actor itself

solid river
#

There is an overlap event on the trigger box. So I need to replicate it.

thin stratus
#

Overlap happens on everyone anyway

#

As long as the actor exists on everyone

solid river
#

UHT does not complain when non-replicated actors (or actors with bReplicates=false) have unused or useless replicated properties or RPCs.

brisk swift
#

whats the best practice to get the server to see what the client wants, I have replicated a variable so the client sees it but now I need the server to see a variable the client sets, do I use a server rpc?

manic prairie
#

I am having an issue where i want to replicate a USceneComponent that is not spawned on the actor that replicates and i only attach it after its spawned (i have a reason for having it setup this way) anyways i am unable to set a net condition to said component. i am only able to just do ->SetIsReplicated(). otherwise it wont replicate

worthy wasp
manic prairie
#

setting the bOwnerNoSee could work for me too but ideally i would rather just not replicate it to the owning client in the first place

worthy wasp
#

you cannot set this on a component.... not to my knowledge or any searching I am looking for to help you.

frozen wraith
#

So I'm curious as to how I would spawn and possess for more than one client. This is from my GameMode blueprint. I'm sure there's better ways of doing this though! Right now I'm just testing and currently I'm not able to get my second spawned actor to be functional, its there kind of like possessed but I'm not able to move around or anything. Sorry if I've missed something, my head is abit mushy atm 😅

worthy wasp
frozen wraith
#

Second and third image is my SpawnPlayer function btw

frozen wraith
worthy wasp
#

then you are tripping over yourself.... default pawn class is a method to spawn - if it is used then you are going to spawn this every time.

#

you need to remove this if you intend to do custom spawn logic.

frozen wraith
#

oh

#

what should I set it to then? just none?

worthy wasp
#

OR - if you want ot have that used - you need to override the function GM::RestartPlayer() is what worked best for me.

#

i set mine to none - because i have MULTIPLE types of characters the player can play (MOBA style game) - and i still did the REStartPlayer override.

#

mine is a bit complex - but not really that hard... simple lobby system that hte player selects a chosen character class - and that is what is loaded into their playercontroller. when the GM runs REstartPlayer - which would require you to ALSO override GetDefaultPawnClassForController()

I cast ot my PController class - and retrieve this class to use from player selection.

#

inside of GM::GetDefaultPawnClassForController() override

frozen wraith
#

not entirely sure I'm following but will dig into it abit. I'll problably be back if I didn't understand correctly 😁

#

thanks for the help!

rough dock
#

hey guys my character blueprint is really lagging when its on a client while the server isnt. is there a way to see like what part of a blueprint is taking up the most resources or something?

solid river
#

Actors that should not have client RPCs (UFUNCTION(client)):

  • ones that are not replicated actors (bReplicates=false)
  • ones that are never be owned by player controllers.

Is there anything else?

solid river
rough dock
#

nah i dont think thats the case im not doing that anywhere

#

and im using the general movement component which is pretty good for multiplayer

#

well its kind of a big bp that i havent organized but theres no spamming rpcs anywhere

#

its kind of weird because a new pawn doesnt lag like this one so i think i might just try and recreate it and see where i went wrong

final holly
#

guyz i have noob question :
There is an ACTOR on the map and I trigger the interface in it by sending a line trace to this ACTOR.
And this Actor increases the value of another Actor listening to her through the delegate.
The problem is that when one player increases the value by triggering, the other party sees the increase, but when the other player applies the trigger, there is no addition to the increased value.
Note: bReplicates = true; in the construct and actor blueprints Replicates = true;

jade ibex
#

sounds like the server is able to do whatever, and the other player is a client that is not making any RPCs to the server to process anything

jade ibex
final holly
#

So I will change the value via RPC is that true?

jade ibex
#

sure you can

final holly
#

thanks for reply bro Let me investigate RPCs a little more.

rotund sail
#

hmm so if im trying to replicate an inventory system, do i mostly need to replicate the inventory actor component, as most of the UI is client facing??

#

assuming most of the logic goes on in the inventory component

queen mortar
#

I have a problem where client cannot interact with 3D widgets

lyric yoke
#

About replication: I have an Actor (a character) that has an inventory (an UObject with a TArray of UObjects). Is there any builtin replication for this or should I come up with my own code for this setup? I set up both the inventory and the TArray as replicated, but I see the changes in the server while not happening in the client.

sinful tree
lyric yoke
#

I've taken a look to that code, but I don't get the magic behind. Will this find the actor that contains this item as a UPROPERTY?

UFUNCTION(BlueprintPure, Category = "My Object")
AActor* GetOwningActor() const
{
    return GetTypedOuter<AActor>();
}
#

In my case, will it find the Actor (Character) that has the inventory?

chrome bay
#

You need to add it as a replicated subobject of the actor.

#

All that TArray does is replicate a list of pointers to objects. The client doesn't actually have those objects, so they'll never resolve to an object.

#

That article is a bit old now, you don't need a special actor class anymore - just use the replicated subobject list.

lyric yoke
#

So all I need is to override ReplicateSubobjects in the UContainer (UObject that holds the TArray)?

chrome bay
#

UContainer won't work, it's a UObject. Only actors can replicate

#

UContainer could also be an Actor Component

lyric yoke
#

I have an AbstractItem (UObject) and my UContainer inherits that. Isn't there a way I can make this heriarchy work? I want containers in my game to be items as well, and therefore items may be an arbitrary tree structure with an arbitrary depth.

chrome bay
#

Ultimately, an Actor at the top of the chain has to replicate the objects.

#

Replicating trees of UObjects isn't particularly cheap though, it has to be said

lyric yoke
#

Right, I don't know how networking works behind the scenes, I'm guessing UE won't detect subtree changes out of thin air.

#

However, I'm happy to learn more and do this by my own

#

The problem is that I can't even replicate the first layer of items right now, so I can't just go and write the tree traversing or anything

chrome bay
#

The main thing you need to know is that replicating UObject* is only replicating a reference to an object, not an actual object instance in it's entirety. The engine converts those references/pointers to a NetGUID behind the scenes, which is just a number used to lookup the actual object instance that exists in memory on the local machine.

lyric yoke
#

So how it happens that actors do exist both locally and in the server? There must be an instantiation at some point on both machines

chrome bay
#

The problem you've got is that right now, clients don't create those object instances so those pointers resolve to nothing. The only way to have clients creating those objects, is to add them as replicated subobjects of an actor at the top of the chain - that specific setup will tell clients to 'create an object of this class' on their local machine, and then the pointers to it will "magically" resolve.

#

Because Actors are where that system starts - which is why any UObject you want to network has to use the actor system.

#

Components are done the same way, they are replicated subobjects of the actor.

lyric yoke
#

Right, so the actor has to have a flatten list of all the tree items, and any item in this tree must be added to that list at some point

chrome bay
#

Objects that exist in the content browser or which are pre-placed in maps can be resolved by their FName, so those don't need to be spawned dynamically.

#

Essentially yeah

#

Reparenting those objects to different actors is also extremely error prone, the same reason you can't easily move components between actors in network game either.

#

It's very not-trivial to transfer a replicated UObject to some other actor, which might factor into the design a bit

lyric yoke
#

so removing it from a list and placing it on a different list won't work?

chrome bay
#

In theory it should work, but it does often create a lot of issues

solar stirrup
#

You'll have to handle race conditions

#

And change the outer of your UObjects

#

Which isn't exactly a walk in the park stability wise

chrome bay
#

Yeah, changing the outer is where things get really messy, since by name they are no longer the same object. Lots of stuff breaks

lyric yoke
#

nice

solar stirrup
#

I've managed to do it but I had to handle it in two or three different locations to make sure the outer also changed for the client

#

Since outers aren't replicated

chrome bay
#

They did improve it I think, like replicated subobjects will actually get created with the same outer as the server now - but that's super recent, maybe since 5.0 or Iris stuff started not sure

#

But yeah, that was a ballache for a long time

solar stirrup
#

On creation sure, but I don't think renames are replicated

chrome bay
#

Not to disuade you but inventories that rely heavily on UObjects for item representation are usually a bit of a non-starter for MP

solar stirrup
#

I basically have to maintain my own replicated lists on top of the subobject list and use them to sync up outers on clients

#

UObject for Inventory is how I do it, but my inventories hold a fast array of structs for item instances

#

Means I can easily transfer inventories between actors, without copying arrays of structs heh

lyric yoke
#

Okay, so what I'm thinking right now

  • UContainer and UAbstractItem (UObjects) will only exist in the server.
  • I will create an actor to represent the item (UAbstractItem) and I'll create an actor component for the inventory (to show a widget to the client)

Then if a user grabs an item I will destroy the actor that represents the item, and I will place the UAbstractItem in the UContainer (this is serversided only)

solar stirrup
#

"easily" as in once you get all the edge cases handled and pray to Sweeney long enough, it'll probably work fine

chrome bay
#

Yeah, my approach was fast array of structs which point to data assets - with an optional 'live' instance if you want it, but you gotta handle the networking yourself.

quasi tide
#

That's pretty much how I do it as well

solar stirrup
#

I have data assets for item templates, and the data asset has a function to create an instance of the item that's stored in a struct

chrome bay
#

yeah, same 😄

solar stirrup
#

struct holds primary asset id for the data asset, an fguid, and a TMap<FName, FInstancedStruct> for arbitrary data relating to the item instance

chrome bay
#

transfers aren't that trivial for me but I don't do them often so not too bothered about that

solar stirrup
#

i love instanced structs

lyric yoke
solar stirrup
#

yep

#

item template holds name, meshes, etc

#

anything that doesn't need to be replicated since it just describes the item and exists on every client already stored in the disk

#

And my item instances simply have an FPrimaryAssetId to point to what item the instance was made from

lyric yoke
#

oh so this struct replicates? I was thinking on having this struct in the server, changing the mesh, and replicating the mesh

solar stirrup
#

item template is a UPrimaryDataAsset

#

No replication

#

the struct is an instance, doesn't hold meshes etc

#

Only instance specific data - i.e. how much of the item is stored in the instance for things like stackable items

solar stirrup
#

struct

#

unique identifier for primary assets

#

I load my data assets on game startup and keep them in memory

#

soft pointers only in it so I don't kill my memory usage

lyric yoke
#

Right, so you know what assets to use in each item type (like what mesh to render)

solar stirrup
#

yep

lyric yoke
#

I'm sorry I'm pretty much new to UE in general, I need to read more

solar stirrup
#

no worries, that's what this server is for

lyric yoke
#

Your structs, are purely written in code or can you assign assets using the editor? The way I have it right now I can see what I'm doing and I would like to keep that if possible

#

For example I have made a spawner that spawns in a radius and I can see what will it spawn (in this case a gold coin)

solar stirrup
#

it's the data inside that changes per item

#

FInstancedStruct supports blueprints so you can do it there too

lyric yoke
solar stirrup
#

two items = two different item instance structs

#

it's the data inside the struct's TMap<> that changes

#

I just mean that like all items use the same struct class

lyric yoke
#

So you may have a key for the amount in the map, or for the mesh, etc... And when you have to create a new item you would build the structure with every element in the map again

wispy veldt
#

Is there anyone here who can help me troubleshoot a repnotify issue ? I have a door that when interacted with by a client sends a server rpc call to open the door. If the door can be opened, a repnotify bool is sent to clients to run the open door function. It works for players in the server at the time of the repnotify but new clients don't get the updated value so the door is closed for them. When they interact with it, it opens the door for them and closes the door for everyone else who it was open for.

sinful tree
wispy veldt
#

I'll post a couple of screenshots of my setup.

dark parcel
wispy veldt
#

First one is the on rep notify function, second is the interaction

#

The 'testing rep notify' doesn't print to newly connected clients, and the door doesn't open even though it's open for everyone else already connected. If somebody interacts with the door, all currently connected clients do get the print message though and the door opens/closes accordingly.

chrome bay
#

They will only call the RepNotify if it differs from the default/serialized value for the actor.

wispy veldt
#

It is different

#

The default value is false (not open). The server changes is to true (open) when a client interacts with it.

#

So shouldn't the new client get a 'true' value ?

chrome bay
#

They should yeah. If you simply print the value of Is Open, do they actually receive the value?

wispy veldt
#

No

#

It doesn't print anything

#

The repnotify itself isn't even being called on new clients

chrome bay
#

Ah, make sure they are ticking

#

What I meant is, print the value of Is Open on tick, to make sure its actually being received first

wispy veldt
#

Yeah I can do that

chrome bay
#

You're not setting the value of Is Open anywhere but that RPC right? Like from some setup during begin play or anything?

wispy veldt
#

Nowhere

#

Only the server sets it on interaction

#

I'll post the results of my on tick print in a few. Had to step out to get some food.

#

hmm on tick it's printing twice for some reason. At first connect (as host) it prints false all the time but then when it's open it's printing one true and one false.

chrome bay
#

It'll be printing one for the Server, another for the Client. Sounds like the value isn't replicating

wispy veldt
#

oh even on clients it will print the servers value?

chrome bay
#

Clients will print the local value

wispy veldt
#

clients are doing the same thing the server is doing

#

one true one false

chrome bay
#

How many doors you have? One?

wispy veldt
#

More than two

chrome bay
#

yeah so all the ticking doors that inherit that BP will be printing the value, which doesn't make it easy to debug

#

Need to identify them somehow

wispy veldt
#

I think there are four right now. Let me remove the other ones for now

#

I knew that too, wasn't even thinking of it.

#

okay only one door now. Let's see what it does.

#

Hmm, it's printing true on the connecting client too

#

as soon as they connect and the door is open it prints true. The repnotify doesn't appear to be triggering though (or at least, the stuff inside of the repnotify function)

chrome bay
#

Hmm, RepNotifys in BP are particularly crappy. Maybe it's a BP thing. Try calling it manually from BeginPlay or something.

wispy veldt
#

try calling what from beginplay?

chrome bay
#

the OnRep function

#

Or at least doing it's logic

#

This shouldn't be neccesary, but Blueprint networking is buggy af

wispy veldt
#

I don't think you can call onrep function manually.. at least if you can it won't let me

chrome bay
#

Ah, probably not in BP then

#

This should just work at the end of the day, but BP networking/onreps having this sort of issue doesn't shock me

#

They're a bit of a hack at best

wispy veldt
#

omfg... I am an idiot..

#

I set my interact input action up, but never set a trigger on it, so every time you interact it triggers multiple times. I think it was throwing off the variable for the server as once I switched it to 'pressed' as the trigger (so it only fires once), it seems to have fixed it..

#

I am not sure why everything else was printing correctly but maybe it was just happening too fast.

#

well that's embarassing...

#

Seems to be good to go now. Thank you for helping Jambax

rotund sail
#

its probably a stupid question but im new to replication and sort of struggling with implementing my own logic. Basically i want to send a request to the server to do some inventory logic and then do some more logic based upon if theres room in the inventory

#

my question is then: is it possible to pass input parameters to the server from the client and how would i do so?

fossil spoke
#

You can send whatever you like through an RPC

#

void MyServerRPC(int32 SomeExampleIntValue);

rotund sail
#

I see, i was trying to use the custom events replication settings to no avail but i guess RPCs are then the answer. cool.

fossil spoke
#

Custom Events in Blueprint become RPCs when marked as such.

rotund sail
#

hmm really

fossil spoke
#

You should read the Network Compendium.

rotund sail
#

probably yeah lol

fossil spoke
#

It is the first Pinned Message

rotund sail
#

kk

#

cuz yeah this is failing me rn

fossil spoke
#

That image is far to small to make out any detail

rotund sail
#

u have to click on it to see it, its full res.

fossil spoke
#

Full res is still tiny

rotund sail
#

nvm then lol

#

I can't figure out how to pass variables in still

#

i call this Server Add Item function and pass in some values but they return as junk

quasi tide
#

You call it like any other function

#

It could be junk that is being passed into it

rotund sail
#

eh im probably just misunderstanding the multiplayer architecture because im calling that from a client to execute on the server to no avail

#

like it calls from the character BP

sinful tree
#

Is the thing you're feeding in something that is replicated from the server to begin with?

rotund sail
#

I believe so, let me double check

#

Ah no it wasn't, but i've now set that var to be replicated. Hmm. What else could there be, it seems to be similar behaviour.

#

Im almost certain the actor owns the inventory component (as its attached to it). So its not that.

sinful tree
#

Just marking the variable as replicated doesn't mean the server has the value associated. Replication of variables is only one way, from server to clients. If you're spawning something on the client and attempting to reference it on the server, you wouldn't be able to.

#

You can pass values to the server in an RPC, including references, but when using references in the RPC, it must be something that has been made net addressable - for example, spawning a replicated actor on the server will usually result in that actor being spawned on clients as well, and clients can pass along a reference to that actor back to the server without requiring a replicated variable referencing that actor - you just need a way to get a reference to that actor and send that reference back to the server and the server will know which actor it is you're referencing as it was made net addressable when it was spawned.

#

Another example would be say, using a reference to an asset of some kind, like a blueprint class, or a data asset. These things aren't necessarily spawned, but you can pass these to the server, and in the background it's actually sending along the path to the asset - the server will then associate that path and assign a network addressable ID to that asset making future calls to that asset a bit more efficient as the path information no longer needs to be sent each time its referenced.

rotund sail
#

Well i can pass in the variable here and it reads on the client, but it doesn't get passed to the server?

#

but the item actor does

meager spade
#

ItemObject if that is just a normal Object

#

will not replicate

#

and client will never know about it

rotund sail
#

its a uobject

meager spade
#

you cant replicate UObjects (with Blueprint alone)

rotund sail
#

ah okay there we go

#

good to know

meager spade
#

UObject replication needs to be done in c++ via an actor/component

#

via ReplicateSubobject function

rotund sail
#

hmm that might be tricky but let me see what i can do

#

the actor component bit anyway

grand axle
#

Hello, would anyone be able to direct me to a good tutorial for a "online Brawler" type game. Specifically the correct way to impliment accurate physics between server and client

dark parcel
dusty void
#

Having this issue where my GUIComponent can detect my character being LocallyControlled but my HealthComponent can't, idk if it's smth to do with me calling it in the onrep of the healthComponent, please ask for anything else if you need, ty

solid river
#

Is it ok to use replication notification (to changes to a trivial property) to trigger all clients to play visual effects instead of using netmulticast rpc?

(Ab)using RepNotify:

// ...
{
  UFUNCTION(Server, Reliable)
  void ServerRpc_Fire();
 
  UPROPERTY(ReplicatedUsing=RepNotify_VisualEffectParity)
  bool VisualEffectParity = false;

  UFUNCTION()
  void RepNotify_VisualEffectParity();
}
void APlayerCharacter::ServerRpc_Fire_Implementation()
{
   VisualEffectParity = !VisualEffectParity;
}
void APlayerCharacter::RepNotify_VisualEffectParity()
{
   UGameplayStatics::SpawnEmitterAtLocation(...);
}
// others...

Using NetMulticast:

// ...
{
   UFUNCTION(Server, Reliable)
   void ServerRpc_Fire();
 
   UFUNCTION(NetMulticast, Reliable)
   void NetMulticastRpc_VisualEffect();
}
void APlayerCharacter::ServerRpc_Fire_Implementation()
{
   NetMulticastRpc_VisualEffect();
}
void APlayerCharacter::NetMulticastRpc_VisualEffect_Implementation()
{
   if(!IsRunningDedicatedServer)
     UGameplayStatics::SpawnEmitterAtLocation(...);
}
// others...
solid river
#

The frequency of the changes to VisualEffectParity must be keep smaller than that of net replication.

manic prairie
#

how do i use replication on animation instance?

solid river
manic prairie
#

it is

#

for my case rep notify is perfect

manic prairie
#

what is the differance between repnotify and replicatedusing?

solid river
#

Be careful because if you changes the property fast enough, only the last change will trigger repnotify. 🙂

manic prairie
#

nvm i am dumb

solid river
manic prairie
#

yeah i noticed i thought it was syntax and not a name

#

brain dead moments

#

@solid river as for your question i think rep notify is better since replication is faster then rpc calls

#

and from what i know as a general rule of thumb none gameplay critical stuff shouldn't use rpc's

#

so effects are better with rep notify if possible

solid river
#

Playing visual effects can also be triggered via physics simulation events and it does not need rep notify. It is the most efficient I think.

manic prairie
#

that is even better

#

if you already have stuff replicated its good to take advantage of the information they replicate to do as much as possible

#

obviously without comprimising something important

solid river
#

If you have a bullet, which approach do you prefer?

  • A: Using a replicated bullet spawned only from server.
  • B: Using a non-replicated bullet that is spawned from each machine in response to netmulticast rpc called from server.
#

Here is the more detailed story.

A replicated player character P1 on a client calls its UFUNCTION(server) ServerRpcFire().
The player character (only) on the server then executes ServerRpcFire().
I split into two cases:

Case A: Using replicated bullet

  • ServerRpcFire() spawns a replicated bullet B (only) on the server.
  • The bullet is replicated from the server to all clients.

Case B: Using not-replicated bullet

  • ServerRpcFire() calls UFUNCTION(NetMulticast) NetMulticastRpcFire() only on the server.
  • NetMulticastRpcFire_Implementation() then executes on all clients and server.
  • Each machine spawns non-replicated bullet.

The following applies for both scenario after the bullet hits another replicated player P2.

Code in the bullet's hit event does the following:

  • on all machines except for dedicated server, play its explosion effect and destroys itself.
  • only on server, deduct certain points from P2's UPROPERTY(ReplicatedUsing=OnRep_Health) Health.
  • (only) on all clients, replicated P2's OnRep_Health() updates health status.
  • only on server, call P2's UFUNCTION(Client) ClientRpcShakeCamera().
  • (only) on P2's client, shake P2's camera with blood spill.
#

It seems to me the case B is more efficient because replication used in case A is not cheap.

manic prairie
#

in this case rpc might be better but you have much more fine grain control on net updates and other stuff with replication + destruction should replicate too so you wont have to over complicate your code. you could also like before use a repnotify for when to spawn the projectile on the client (some kind of boolean is firing or something then you have a toggle fire function that is called from the rep notify depending on your gun (so basically its like an rpc call but without using rpcs which is better in my opinion. if you find regular replication too expensive you could always use push model and just mark the isFiring variable dirty when needed)

#

@solid river

strong junco
#

Is there a way to make stun or slow abilities using the ASC and CMC? If I change the movespeed using a Gameplay Effect then I get terrible rubberbanding since ASC and CMC are not synced

#

My current idea is to delay the slow effect so it has time to replicate. So if it is initiated at server time 0 then I'll apply it at server time 300 on both server and client

upbeat estuary
#

Potentially stupid question: I'm trying to spawn a different type of default pawn in PostLogin when a new player connects. I would like to not spawn any pawn when someone already placed a pawn in the world and set auto-possess to the respective player.
Can't really find a nice way to do this, as
a) the pawn itself asks the PC to possess it in PreInitializeComponents
b) for some reason using TActorRange<APawn>(NewPlayer->GetWorld()) in PostLogin returns only 1 Spectator Pawn, so I can't really check if any of the pawns have auto possess enabled.

#

Does anyone have an idea what could work here?

worthy knot
thin stratus
#

For the removal you might need to give the client some time

#

Also you will want to handle those effects manually in the cmc by listening to apply and remove of GEs and then converting them to something you can manage in the cmc by hand

#

It's not super straightforward sadly

thin stratus
upbeat estuary
strong junco
thin stratus
#

Are you sure the pawn is actually in the world?

thin stratus
#

I don't have the code at hand

upbeat estuary
#

It's dragged in the scene, and the auto-possess works fine afterwards too

thin stratus
#

Neither was it mine so I won't share it exactly

upbeat estuary
#

but for some reason I only get a SpectatorPawn

thin stratus
#

Not sure tbh

upbeat estuary
#

okay maybe my debugger is just being weird

strong junco
#

oki, thank you @thin stratus . I'll try to get the start of the slow/stun working then by listening to apply and removes of GE, and then think about the removal of it once I reach that point

upbeat estuary
#

Hmm nope, TActorRange<APawn>(NewPlayer->GetWorld(), APawn::StaticClass(), EActorIteratorFlags::AllActors) only gives me a spectator pawn - which isn't even in the scene. Almost seems like it's called too early somehow.

thin stratus
thin stratus
upbeat estuary
#

Same result - however, if I use GEngine->GetWorldContexts()[0].World() instead of GetWorld(), it seems to work.

#

Quite interesting, I think I probably just cannot call it before Super::PostLogin

solid river
#

Pickup actors must be replicated?

tame kraken
#

Hello guys, can someone help me?

I'm facing the difficulty in that I want to use the On Rep notify event when a variable gets replicated, but I don't get this event run for the host or server, and it ruins the whole logic.

How do I accommodate or do a work around for the host when working with the On Rep notify?

sinful tree
solar stirrup
tame kraken
# sinful tree If you're working in C++, you'll have to call the OnRep function manually on the...

I'm using blueprints.

I'm doing a simple mechanic where:

player enters -> set their player ID based on an integer -> set their team ID based on the % of the integer -> update everyone's UI to add those new players .

what is the best way to do this?
Now I am using the On Possess in the player controller and speak with the Game State, but I get the issues with the server that it doesn't run the On Rep notify for that player information

#

I would appreciate in general what is the best practice when it comes to speaking with every player's UI like this because I have suffered with it

sinful tree
#

I'd say avoid using arbitrary IDs when referencing players as it makes things extremely difficult to manage. Every player has a PlayerState and this is the unique thing about each player you can use to identify them, and it is associated with their controlled pawn (accessible to all other clients) and the player controller (accessible only by the owning player) making it easy to determine which player you're working with when you have reference to their pawn or controller. When a PlayerState begins play, that playerstate is also added to the GameState's PlayerArray, so you have an easy means of getting a listing of all players currently in the game.

So then if you want to have everyone's UI updated when someone joins, your best bet is to use a combination of the GameState and the PlayerState.
On the GameState you can create a couple of event dispatcher that has a PlayerState as an input, you can call them OnPlayerJoined and OnPlayerLeaving.
On Begin Play of the PlayerState, you can have it get your game state and call the OnPlayerJoined dispatcher with reference to self as the playerstate.
On Destroy of the PlayerState, you would have it call your game state and call the OnPlayerLeaving dispatcher, again wtih reference to self for the playerstate.

This now gives you a generic place (the game state) to know when a player is leaving or joining. You can have your UI elements bind to the event dispatchers on the gamestate in order to add or remove elements based on that PlayerState joining or leaving the game.

In terms of the Team ID, you're likely better off using a different system for determining the team, like looping through the Player Array on the gamestate and getting count of how many players are on each team, and assigning the joining player with the team with the lowest members. This too should of course be an OnRep which you can then have your UI update based on the value changing, which you may want to use event dispatchers for as well.

tame kraken
burnt hinge
#

Can i multicast straight from interface event?

sinful tree
burnt hinge
#

i wanna support dedicated so probably server to mc as usual

mystic estuary
#

Hello, is it possible to get the old value to the OnRep, but the blueprint one? In C++ we can make void OnRep_MyValue(int32 OldValue), but in BPs it automatically makes void OnRep_MyValue(). Am I missing something or it's just impossible to do?

dark parcel
loud pike
#

Hello, wondering something about dedicated servers, are there any platform that sells a cloud solution for a unreal 5 dedicated game server (that can have inside it sessions of 12 players) but also scales the price on the quantity of use on this server. For exemple if I only have 1 guy playing for a month I pay 20 dollars but if I have 500 I pay 1k dollars?

#

Basically I don't want to pay 1k if only 1 guy plays on the server

thin stratus
#

That's more or less what stuff like PlayFab offers

#

The servers there cost a set price per time and you'll have to see what you need and what you can fit on one of the servers in terms of quantity of dedicated servers.

loud pike
#

Does it automatically adjust the amount of servers if I need more?

thin stratus
#

In theory yes

#

They spin up new fleets and keep them idle

#

And spin them down if not needed

loud pike
#

And the price adapts then

thin stratus
#

Yeah

#

But it's not cheap either way

loud pike
#

That sound really nice thanks!

thin stratus
#

20 dollars is probably not gonna be a thing

loud pike
burnt wadi
#

How can i make sure to only send this server rpc only on locally controlled characters and not simulated proxies?

if (IsLocallyControlled() && GetLocalRole() == ENetRole::ROLE_AutonomousProxy)
    {
        ServerRequestWeapon();
    }```
if i remove the ENetRole check then in editor where there is 1 server and 1 client 3 weapons are spawned, 1 on server and 2 on client, I am imagining the extra weapon is from simulatedproxy?
#

right now i am calling this in begin play

thin stratus
# loud pike Aw lol

They have a free tier iirc. So you can try it out and see what specs you need to host a few dedi servers (with different ports) per cloud server

#

And then try to calculate what it would cost eventually

#

But it's usually a few hundred per month, even for just a handful of servers iirc.

#

And you would want to deploy Linux servers cause Windows is even more pricey

loud pike
#

I think I'm really looking for something modular and scalable really, I don't mind paying 1k of there are a lot of players

thin stratus
#

BeginPlay might be too early for the is locally controlled check to work

#

You would want to wait until the client knows it's possessed

#

E.g. via OnRep_Controller

#

It's questionable though why you need an RPC for that

#

You could just override possessed on the server side and use that to spawn the replicated weapon

#

Unless the server needs to know what weapon by clients choice or so

burnt wadi
#

No nothing like that i just didnt know what to override to make such calls so i used begin play

#

Sorry but what is the function called where i should do such calls?

thin stratus
thin stratus
#

I usually use possessed to make sure the client is full in control of the character before giving out a weapon

burnt wadi
thin stratus
#

I don't know the exact name

#

OnPossessed or PossessedBy

#

Or just Possessed

#

It's the "callback" server side when a pawn gets possessed

#

You can just override it similar to BeginPlay

burnt wadi
#

Understood I will find that function and do it in that then will let you know how it goes!

thin stratus
#

No need for an RPC then though

burnt wadi
#

Yup yup

burnt wadi
#

doesnt this class exist on both client and server?

thin stratus
#

First of all, the function is in the Pawn, not the Controller (the one I mean)

#

And second, because that already only calls on the Server, what would you want to RPC for?

burnt wadi
#

Ohh ofcuz yeah that makes sense

#

understood now

burnt wadi
#

Thanks you for the link! i almost went on hunt in character and pawn class lol

tame kraken
thin stratus
#

What are you trying to do

#

@tame kraken

#

The quoted message is a bit long, any tl;dr?

tame kraken
# thin stratus What are you trying to do

It is about setting information for each player and having this information communicated to all of the players' widget blueprints.

player 1 joins -> assign to them ID 0 -> assign them to either team 0 or 1 based on whether they are an even or odd number -> set their icon in the widget blue print.

then player 2 joins -> assign to them the next ID -> assign their team ID -> set the icon in the widget blue print.

now player 1 should see their icon and player 2 icon. player 2 should see their icon and player 1's icon... and so on, the more people join, the more it will be updated

thin stratus
#

Yeah that's a bit annoying

#

Cause you have a LOT of race conditions

#

You basically need to have callbacks for any kind of data that can change via OnReps

tame kraken
#

yea I'm now following this implementation with using on reps.

I have now set up this system by using the begin play of the player state, but that calls my On Player Joined dispatcher as many times as there are current players hha.

I will try to do the process in the On Possessed in the player controller instead

thin stratus
#

In Theory, it should be enough to

  • Create Widget Entries on BeginPlay of the PlayerState
  • Destroy Widget Entries on EndPlay of the PlayerState
  • When creating the Widget, get the current Values of the PlayerState and update the UI
  • When creating the Widget, bind to EventDispatchers for any Value that can update
  • When destroying the Widget, unbind from the EventDispatchers again
#

OnPossessed doesn't make sense

#

Cause that's Server only

burnt wadi
#
void APanoCharacter::PossessedBy(AController* NewController)
{
    Super::PossessedBy(NewController);
    if (!IsLocallyControlled()) return;
    APanoverseGameMode* PanoverseGameMode = GetWorld()->GetAuthGameMode<APanoverseGameMode>();
    if (PanoverseGameMode)
    {
        PanoverseGameMode->RequestWeapon(this);
    }
    GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Red, FString("Possessed By"));
}```
Does this look fine or am i doing something wrong? @thin stratus  
It getting called 3 times according to that debug and tho i only have editor set on 2 players on listen-server mode
tame kraken
thin stratus
thin stratus
burnt wadi
#

ohh i meant to check for getlocalrole() i thought it works something like that

thin stratus
#

If you have 3 Players, each of them has an Instance of the PlayerState of the other 2 and their own.
So locally, for Player 1, BeginPlay would call 3 times. Once for its own and 2 times for the other two.

#

In total you get 9 calls, 3 per client, 1 per PlayerState per Client

thin stratus
burnt wadi
#

ok 🥹

thin stratus
#

I'm not sure why it would call more often

#

You might want to check if the Controller pointer is valid

#

Maybe it calls with an invalid controller at the start

#

And side note, for better readability of your code, stop those one liner ifs :P

tame kraken
thin stratus
#

Each Player wants to see 3 Widget entries if there are 3 players, or not?

tame kraken
#

yes, one for themselves and 2 of the other players

thin stratus
#

So then I would consider that a feature

thin stratus
#

Client1: PlayerState1 (Client1), PlayerState2, PlayerState3

Client2: PlayerState1, PlayerState2 (Client2), PlayerState3

Client3: PlayerState1, PlayerState2, PlayerState3 (Client3)

Per Client you get 3 BeginPlay calls, one for each of the PlayerStates

#

If you end up with more than 3 Widgets, then check where the additional calls come from

#

Keep in mind that there are Idle/Inactive PlayerStates when Player's leave the game.

tame kraken
#

the problem I'm facing is that the game state assigns the teams -> update info -> replicates them and calls the widget updating multiple times

thin stratus
#

Which might call BeginPlay again

thin stratus
#

One is to create the 3 Entries

#

And then inside each entry you would listen for Updates to the values

#

The Team assignment shouldn't create widgets or?

#

Or are they in different lists? (which I didn't know)

thin stratus
tame kraken
#

the game state assigns the teams, and the team information gets replicated and in the on rep notify we call the widget for updating

thin stratus
tame kraken
#

the widget will create a new widget blueprint for the icon of the player and put it in the respective size box according to their team

#

maybe in this case I shouldn't make the variables replicated since they're already kind of replicated by the player state

thin stratus
#

Right, so they need to be in Team Slots, which I didn't know

#

I would then do that differently

#

I would have either Team Arrays

#

Or even a Team Actor

#

(I like creating ATeamState : public AInfo actors to mimic APlayerState etc.)

#

And then have an OnRep on the Team Array

#

And update the Widgets from that

tame kraken
#

I see it as the main problem is about the begin play of the player state is getting called as many times as there are clients.
I just want it once, when this client has entered.

we will assign it a team and after this assignment we will update the UI's

burnt wadi
thin stratus
#

Per player

thin stratus
#

There is no reason for this to call more than once

#

Maybe it calls for 4 different characters?

#

Maybe you have 2 characters that are auto possessed and then you spawn new ones or some joke like that?

#

You also want to destroy the weapon on UnPossessed

#

(if valid)

#

otherwise you have floating weapons

tame kraken
#

no it doesn't.

now i'm the host -> I create the session -> begin play gets called once.

but when I join the session on the client -> I get begin play for the server and the client.

while it should just be the client who has just joined the game

thin stratus
#

That's not how BeginPlay works

#

BeginPlay calls for every actor when it gets spawned.

burnt wadi
#

Ok i will try that thanks 🥹

thin stratus
#

When your Server starts the Game, there is only one PlayerState

#

So 1 BeginPlay call

#

When the Client joins, the PlayerState is spawned on the Server, so the Server gets a BeginPlay call for the Client's PlayerState

#

And the same time, the Client receives 2 replicated PlayerStates, their own and the one from the Server

#

Both calling BeginPlay

#

Which totals to 2 BeginPlay, one per PlayerState

tame kraken
#

ah ok.

maybe then I can make on player joined to be on authority only

thin stratus
#

Sure, but then only your Server will create the Widgets

tame kraken
#

the widgets are created in the on possessed for my case

thin stratus
#

OnPossessed is also Server Only

tame kraken
#

yes I do run on owning client

thin stratus
#

And per Character, not even per PlayerState

tame kraken
#

do you recommend I create the load out widget in the player state begin play?

thin stratus
#

Idk, depends on what the Loadout is where the info is stored

#

But using OnPossessed + ClientRPC isn't even the same

#

Cause the ClientRPC, on the Server Character, will only call on the Server

#

And if you handle the Widget in both, the Server would create a Widget twice for the same character

tame kraken
#

hmm, I haven't thought about it to this extent :D.

thin stratus
#

If you only need the Widget locally, you can use "OnControllerChangedEvent", which calls for Server and Client, and there you can do the IsLocallyControlled check to limit it to only the owner

quasi tide
#

If you are in C++, the player controller has an AcknowledgePossession function you can override. Which is something UE calls on the client when the PC possess a pawn.

tame kraken
#

I come from the background where I used to make everything in the character blueprint, but now I'm trying to diverge a little bit to use the other classes

#

so I'm still not sure about the best practices on where we should do what

thin stratus
#

You did read the Compendium I assume?

tame kraken
#

yes I think so :D.

#

skimming

thin stratus
#

hmk

winged vault
#

when joining with client in dedicated server, spawns 2 pawns for all existing clients
Eg: I have 2 players in the server and a third one joines. The third one spawns 2 pawns for each of the previous existing players.

dark edge
crude quail
#

switching to a replicated property, could someone verify this is the right approach?

    UPROPERTY(ReplicatedUsing=OnRep_IsDead)
    bool bIsDead = false;
    UFUNCTION()
    virtual void OnRep_IsDead();
```cpp
```cpp
void ABaseAiCharacter::Die()
{
    bIsDead = true;
    if(HasAuthority())
    {
        OnRep_IsDead();
    }
}
void ABaseAiCharacter::OnRep_IsDead()
//...
quasi tide
#

Yeah, pretty much. But I prefer to wrap that in a SetIsDead() function.

#

So Die() would just call SetIsDead(true); and then that same logic is applied.

#

And the OnRep_IsDead() function handles the actual actionable stuff that need to happen when the stuff changes.

winged vault
#

This is the Join session and then I just launch the new map which has a player start

mystic estuary
#

Hello, I'm making an AI character that's supposed to do a jump on spawn, and in order to predict the spawn flow I'm using the OnLanded event, however it doesn't seem to be called on clients. After some tests I found out that it's not called on non-owning clients, i.e. if there's a player client character, it'll receive the OnLanded as well as server, while other clients won't receive it for that particular character.

So, is there some work around to predict the land event client-side?

#

The only working (yet dumb) work around I found:

final holly
#
void ATestActor::Interact()
{
    if (HasAuthority())
    {
        ActiveSwitchCount = ActiveSwitchCount + 1;
        OnRep_ActiveSwitchCount();
    }
}
#
void ATestActor::OnRep_ActiveSwitchCount()
{
    if (HasAuthority())
    {
        SwitchCountRenderer->SetText(FText::FromString(FString::SanitizeFloat(ActiveSwitchCount)));
        GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Cyan, "From Server:"+FString::SanitizeFloat(ActiveSwitchCount));
    }
    else
    {
        SwitchCountRenderer->SetText(FText::FromString(FString::SanitizeFloat(ActiveSwitchCount)));
        GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Cyan, "From Client:" + FString::SanitizeFloat(ActiveSwitchCount));
    }
    
}

void ATestActor::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    //Replicate ActiveSwitchCount.
    DOREPLIFETIME(ATestActor, ActiveSwitchCount);
}
#

server works properly

#

but client does not affect

fathom aspen
#

It's probably because the client interaction is not happening server-side?

quasi tide
#

I assume you're just trying to call "Interact" on the client?

final holly
#

So when I using Interfaces shoul i do something special on interface for replication

quasi tide
#

Interfaces don't support RPCs

final holly
#

oooo thats badd

#

i love interfaces

quasi tide
#

You have to call a server RPC or client RPC and then inside of that you call the interface method

final holly
#

thanks for reply guyz

#

one more quick question

#

if i chose collision for interaction rather than interface with line trace

#

then able to support RPC

sinful tree
final holly
#

i mean in tutorial he is using sphere collison for interaction and works
but i prefer line trace with trigger to interface

#

Ok guyz thanks again for replies

raw thunder
#

Hello everyone,
I am having an issue with my clients controllers not facing the PlayerStart rotation. I tryied to set FinishRestartPlayer in AGameModeBase with no change.
NewPlayer->ClientSetRotation(NewControllerRot, true);
NewPlayer->SetControlRotation(NewControllerRot);
They are always facing the (0,0,0) rotation, even if the values of NewControllerRot are correct.
The Pawn is spawned in the right direction but not the client controller (on server I don't have the issue)

I saw multiple forums on this issue with no explanation, can somebody help?

frank pecan
#

is it safe to use Add Movement Inputs from external actors? I'm just trying to work around using add force to be more multiplayer friendly but i need a slight black hole affect that pulls players inword, but doesn't completely override their current movement

latent nest
#

How can I fix the rotational issue that is happening here, and the sprint mechanic?

dark wing
#

So join any channel and ask for help, because no one can help you like this

dark edge
#

It's not enough to just replicate the changing of max walk speed

dusty void
#

Having this issue where my GUIComponent can detect my character being LocallyControlled but my HealthComponent can't, idk if it's smth to do with me calling it in the onrep of the healthComponent, please ask for anything else if you need, ty

uncut atlas
#

Are there extra steps to creating a cross-platform multiplayer game other than having to compile on each individual system? From what I understand about network programming is that different end systems can send data over the network to each other and should be able to read the data. So a server should be able to read data from different platforms and also send data about the game state. This makes me assume the only requirement for cross-play is having to compile the game on each system.

fossil spoke
uncut atlas
#

Ah that's cool!

fossil spoke
#

There is very little these days in the way of stopping a Player on PC from connecting to a Server with a Player on a Console.

#

At least with UE.

uncut atlas
#

Thnx!

fluid prawn
#

I always thought it would be a pain in the ass to setup

fossil spoke
#

Not as of yet no. But theoretically I cant see much that wouldnt cause it to work fine.

#

Especially if you are using EOS

#

Epic have done a lot of work to get the engine on that level, to support Fortnite for example.

fluid prawn
#

Well it's good to hear that it is possible. Honestly the first time I've seen people talk about cross platform multiplayer. Thought it would be voodoo. Indeed I can def see the framework is already in the engine because of fortnite.

dark parcel
#

Would be really nice to have Epic tell us what to do with Listen server when it comes to CMC tickPose

#

Now I'm contemplating wether to do dedicated server or to override CMC tickpose, I feel like there will be repercussion for overriding that

grand kestrel
#

Why do you need them to tell you that

dark parcel
#

A bit frustrating that it doesn't work out of the box 🫠. Also don't know what's gonna happend if I stop calling tick pose. It's there by design so switching it off may produce issues

#

@grand kestrel what do you end up doing on Ur end, if u r doing multiplayer

finite goblet
#

Is iris production ready yet?

hollow eagle
#

no

grand kestrel
dark parcel
#

@grand kestrel #multiplayer message
Listen server sees other client anim jittering due to tick pose()
But client see other client fine

#

pretty much out of the box, listen server with cmc is not play worthy

grand kestrel
#

I have no issues with it on listen server myself sorry, so I can't really comment
Lyra/Paragon/Maybe Fortnite style TIP produced issues due to the mesh smoothing
Distance matching has issues with fluctuating latency and ofc you need to replicate the acceleration similar to how Lyra does it

dark parcel
#

The issue can be replicated without doing anything. Simply playing any Unreal template in steam will produce the jitter effect (Pie is fine, even with emulated lag)

quasi tide
#

I haven't dealt with this myself either, though I've seen others report about it.

#

And yes - I've even done playing with my team across Steam. People from halfway across the world included.

dark parcel
#

🤔

quasi tide
#

So I'm always confuzzled about the issue personally.

dark parcel
#

You guys use listen server I assumed?

quasi tide
#

I'm indie - so yes.

dark parcel
#

I see 😔 , I will take a video when I can

dark parcel
#

I tested with 3 computers. Client see other client fine. It's just the listen server that suffer 😦

#

im gonna do online solutions today but I heard cmc has changed ever since. Gonna try to make sure none of the TickPose get called

stone hawk
#

hi, when a user closes the app after they are in session, that session still remains for maybe 10 minutes or more. if i try again to find, it finds session but tries to send packets for 60 seconds before timing out ( connection timeout) . how can we avoid this ? like, i can't find a event (to add destroy session node) that fires if user force closes the app or next time the player logs in and tries to find, they should not find it ( i put valid session or valid index, they both are coming true) -- until session resets itself - that is after 10 minutes or above .. how to solve this ? thanks for answers

upbeat estuary
# thin stratus Never used actor range. usually use actor iterator

In case you are curious: It seems to be a World Partition thing. (Auto) Possession and the whole PostLogin Spawn flow works as expected in all classic Levels, but the ones with World Partition Streaming enabled make it weird. I guess it makes some kind of sense, but is annoying to deal with.

sullen plover
#

So I'm trying to destroy an item that's picked up, but however it only happens when triggered on the server, not the client

#

When the server player does it it's destroyed just fine, but the client cannot do it

plucky prawn
#

if i start a session as a listen server then use the open console command to change maps, does the session persist?

thin stratus
#

Session maybe, connections not

plucky prawn
#

ye i expect the connections wont. is there a way to check if the session is still good?

thin stratus
#

In C++ probably

plucky prawn
#

ok ill check it out. maybe advanced sessions has something

thin stratus
#

Same check that Epic does when you get denied creating a session cause one already exists

thin stratus
#

At least not in Multiplayer

thin stratus
#

UE is Server Authoritive

#

Client's can only do local stuff that has no affect on others, or send a ServerRPC in a Client owned Actor if they want the Server to do something

#

Picking up an Item should happen on the Server with maybe a prediction system in place to counter the ping.

thin stratus
#

Not sure if that works if the game crashes, but might work for ALT+F4 cause UE handles that manualy

crude quail
#

Is it not possible to use USTRUCTS as replicated properties?

USTRUCT()
struct FDeathInfo {
    GENERATED_BODY()
    
public:
    bool bIsDead = false;

    FVector KillerOrigin = FVector(0.0f);
    bool bHasKillerOrigin = false;

    void SetKillerOrigin(FVector Origin)
    {
        KillerOrigin = Origin;
        bHasKillerOrigin = true;
    }
};

    UPROPERTY(ReplicatedUsing=OnRep_IsDead)
    FDeathInfo DeathInfo;

This was working as a bool, but it is now no longer working as a struct

latent nest
winged vault
#

create session - invalid player state I get this error on a dedicated server. Why does the game instance need player state?

#

I have no clue what is going on

sullen plover
#

But oddly enough, when I have the client try to pick up the item but then pick it up in the server, the item is destroyed but UE then complains about a null object reference, which doesn't happen if the server picks it up first

crisp shard
#

where is the most efficient place to have all 2d sound or music /ui sfx? the widgets that the player is interacting with? or an audio component on the player controller?

shrewd ginkgo
#

When I make the videos I watch to make multiplayer replicated doors, they don't work when I make them. Can anyone help me with how to do this?

shrewd ginkgo
#

If you have any multiplayer codes for door can you send ss from event graph

#

or can you explain in detail

crisp shard
#

lol well what do you currenlty have working?

brisk swift
#

what can I do if something works on a listen server with client but clients dont work on their own in editor

fathom aspen
#

That's a very broad question, that thing will need to be investigated and fixed

modest coral
#

hi anyone knows anything about dynamic sky ? and the error if use cel shades? i having a error on the shades not replicated on client side

vivid seal
modest coral
#

or how can i call the sky here ?

#

options and tips to solve are also welcome , i think to make my own shade or just use another sky for the day night shift . it sucks as my demo was almost out but this delays it oh well anyone want to party up Dm me

crude quail
modest coral
#

it seems the cel shaded use , the light source , but dynamic sky don't use light source it has its built in . its why its a replicated error but i understand all my question our out of anyone's levels

meager spade
#

@modest coral This is not the channel for this, and if you have a question, feel free to DM a moderator. Please keep this out oF these channels.

white smelt
#

Hey guys i have this problem, does anyone know a good documentation on server rpc? im trying to pick up an item but only the server can pick it up. the clients cant interact with it

fossil spoke
#

@white smelt Read the Network Compendium linked in the Pinned Messages

fossil spoke
#

Its literally the first pin

white smelt
#

2017 is this updated?

dark edge
dark parcel
#

Anyone manage to get ping from Steam Session?

drifting heath
#

What's the best way to send a USaveGame* object to the server from the client? Is my only option to send all the information individually?

// What I want to achieve:
Server_RestoreCharacter(/* USaveGame* */ SaveGame);
// What I am doing currently:
Server_RestoreCharacter(
  /*FString*/ SaveGame->CharacterName,
  /*int*/     SaveGame->CharacterLevel,
  ...
  );
unkempt tiger
#

is there a type I can use to send a compressed float, just like FVector_NetQuantize to send a compressed vector?

fathom aspen
#

Probably make your own type struct that wraps a float and implement net serialize for it. I assume the engine already have helper methods to compress them

sinful tree
#

If you want to make it a bit more managable, break it up into a structure, and maybe make substructures

drifting heath
#

Yeah, that's what I was worried about. Since the USaveGame is an object made on the client, I know I can't send it to the server. Just trying to avoid a Server RPC with 10+ arguments lol

#

Ahh, good point!

#

Yeah that works perfectly; Just using a struct for the scattered data like name, class, level, etc.

struct FCharacterRestoreData
{
   FString CharacterName;
   int CharacterLevel;
   float ExperiencePoints;
   ...
}
dusty void
#

I've been having issues the past few days with an issue where my health component can't detect my character to be locally controlled but my gui component can, they're both being called in their respective beginplays, they're both set to be replicated, and i have no other idea why this could be the case, can anyone help? thank you and ill give anythign else if needed

sinful tree
#

BeginPlay may not be the best place to be detecting whether or not the actor is locally controlled.

dusty void
#

I just did it in TickComponent and still not getting anything from Health Component

#

Do you know what could be the issue?

dark edge
#

do it on begin play like you did with your gui component

dusty void
#

oh bruh

#

What does happen when I set the Owner early?

#

it does work tho tysm

dark edge
#

but I know almost nothing about C++ side of things

limber cloak
#

Hello, when it comes to multiplayer do SubLevels make it possible for a game like albion online to have private dungeons? If yes, where can I learn this?

limber cloak
limber cloak
limber cloak
#

try and tell us more

kindred gazelle
#

Hey gang,

Is there any chance there's an easy way to force a replicated variable to replicate to the client without needing to change that variable? I've got an array that is replicated and I'm finding that the BP node "Set Array Element" actually won't replicate to the client like "set" does.

I'm currently using an RPC which passes through the server's value to the owning client and sets the replicated variable on the client. That works, I'm just wondering if I should be doing it another way because this feels gross. Any pointers appreciated!

limber cloak
kindred gazelle
sinful tree
kindred gazelle
# limber cloak I don't think you can, I might be wrong. If I were you, I would try alternatives...

I'm making a custom prediction system. I track the changes of replicated variables and store them in array, then I make predictions and store them in an array. When adding a new change to the server array, I check that index in the prediction array and if there is a mismatch it fire an RPC and correct the incorrect prediction. Packet loss was really bugging me and this system fixes that. This issue actually has no repercussions when it comes to prediction since it is immediately corrected, but it's annoying me because when serialising to disk (always locally), it uses the replicated variable rather than the predicted variable.

I just wanted to know if I could say to the replicated variable "hey, I know you think it hasn't changed but could you check anyway?"

kindred gazelle
sinful tree
#

Alternatively, if this is within a function, you could make a copy of the Inv Stacks array in a local variable, modify the copy as needed using the set array elem, then setting the inv stacks array at the end of the function.

kindred gazelle
#

I'm doing this, which works... it just feels wrong

kindred gazelle
sinful tree
#

So um... Testing on my end...
This does indeed call the OnRep function of the array, but only on the client. The server doesn't call it like it usually does in blueprints.

kindred gazelle
dusty void
#

i did do what you said yesterday inside my character class and it id dprint that they were locally controlled tho :3

#

i did also move it to begin play instead of the constructor as well

kindred gazelle
white smelt
#

MegaFunk

#

why is it still doing crashes

nova wasp
#

first of all you don't probably don't want to call DOREPLIFETIME macros anywhere but GetLifetimeReplicatedProps

#

which is a thing that gets called once(?) to set meta data the replication backend needs to store

#

your issue is likely trying to pass a none direct field uproperty into DOREPLIFETIME

white smelt
#

i dont do it didnt know all my others is working fine this way

#

i had get lifetimereplicatedprops before that

#

like you did say in the beginning the array starts with nothing in there.

nova wasp
#

the issue isn't the array having nothing, the issue is you trying to put a member of a property in there

white smelt
#

so is NuN i think how can we fix this

#

i tried to go only Inventory but it didnt work

#

now it does what is going on

nova wasp
#

see you in 2 minutes when you post again with actual context I guess...

#

oh nevermind, nice

white smelt
#

i thought only the entries need to be replicated since its the only thing in there

nova wasp
#

DOREPLIFETIME( UMyAwesomeObject, fieldname);

#

you could use something else to store and replicate the data and have your component actually handle what it does with it on both machines?

white smelt
nova wasp
#

Is it even marked replicated?

white smelt
nova wasp
# white smelt

are you actually using DOREPLIFETIME or are you still calling GetLifeTimeReplicatedProps twice for some wacky reason

white smelt
#

you where right actually

#

i did not create this array tbh

#

someone logged into my computer and made all that for me. (i wont say a name) although it was nice of him. i dont understand none of the shit in there and have to figure it out

thin stratus
#

The internet is full of surprises

nova wasp
#

are you paying people on Fiverr to make your replicated game? uh oh

white smelt
#

is it okay if i leave it in protected?

white smelt
#

i did not ask he just made it

thin stratus
#

If you need/want it to be protected, then yeah

#

I mean, that's a question you gotta answer yourself

white smelt
#

im doing the replication but the tarrayserializer got created by him

white smelt
thin stratus
#

No, that has nothing to do with gameplay

#

That's c++ related

white smelt
#

then protection shall be good

thin stratus
#

You can google that though, cause it's very fundamental to C++

#

And yes, in theory it's better to have protected or even private members than public

white smelt
#

everything coding i learned with GPT

nova wasp
#

GPT is a compression algo that avoids swear words... it can't help you ask things you never knew to ask

white smelt
#

sometimes it gives shit results but i feel like its a better and faster way of learning. sometimes docs. but people that code hate to write

#

so they keep it short

nova wasp
#

also chances are it will not even give accurate info for anything but extremely surface level unreal stuff... there are no shortcuts to actually doing stuff unfortunately

white smelt
#

ive being doing cpp for below ~2 months

#

i think im doing fine for what people put me through with their crazy ideas in #cpp

#

i wait creating a vehicle since that is like really complex i researched and stay away from it for couple months

#

but thanks guys for the help i havent slept the night and tried to get it to work

nova wasp
white smelt
#

this goes forever

nova wasp
#

that's because you never actually made a working fastarray item and container

nova wasp
#

I would suggest starting with a raw replicated array for now just to get going

white smelt
#

markarraydirty in here

nova wasp
#

you could even pass over the data in RPCs to represent changes instead of replicating the array

white smelt
nova wasp
#

okay, then actually read the documentation and in-engine examples for fast array replication

white smelt
#

i have it dirty here

#

inside the struct so it should work fine

nova wasp
#

I'm good dude... I can't help from just random snippets of this fast array

#

kind of putting the cart before the horse... doing some more basic stuff would help you a lot to reason about stuff without needing help

white smelt
#

just a dumb question but since its a struct i dont have to replicate it right

#

its already replicated inside the inventory

nova wasp
#

is it a property?

#

uproperty I should say

white smelt
#

Functions

nova wasp
#

how I got my fastarray working (for the most part)

  1. follow the steps in FastArraySerializer.h entirely, while comparing with existing engine code
    2 checking out FLobbyPlayerStateInfoArray or any of the other pairs of FFastArraySerializerItem/FFastArraySerializer etc
white smelt
#

its the normal one not iris right?

nova wasp
#

I will say actor components can send RPCs if they have a stable net name to resolve the RPC over the network

white smelt
#

i inherit these things dont i?

nova wasp
#

this is not a normal virtual function thingy

nova wasp
#

there are probably other examples of fastarray items+serializers online

#

for some guidance: the functions are not overrides here and it just tells you that:

white smelt
#

or did you create an enum and struct library>

nova wasp
#

yep, it is replicated inside an actor

#

you should really do some basic unreal multiplayer stuff first

#

FastArraySerializers are kind of a pain and just winging it here is going to make it much harder

white smelt
#

im replicating it

#

the structure gets pulled from my struct.h

nova wasp
#

that's cool, you still need to actually make a working fastarrayserializer that does all of the stuff detailed in the stuff I just sent you

nova wasp
white smelt
#

i think the guy that made it, did the right things man

white smelt
white smelt
#

it should be okay but you can have a look over it

nova wasp
#

not interested in DMs especially if you still seem to be avoiding the advice I gave already

white smelt
#

i just send you the files if you keen looking if its constructed the right way. it should be working

#

i send you 2 .h 2.cpp they both interact

#

the ArraySerializer is in structs.h

nova wasp
#

teach a man to fish, etc

white smelt
#

if i where to put all my stuff on here, everybody could just make what im working on

nova wasp
#

I guess I'm in the superposition of not wanting to read 2000 lines and not being able to help with 3 line screenshots without context

thin stratus
#

Generally, if you need help with something, especially code related, you gotta share as much information as needed.
And sending unsolicted DMs is against the #rules after all.

nova wasp
#

What a lot of people do is obfuscate the names of their project etc from the snippets

thin stratus
#

Yop, that's what I do. But I also kinda know how much I need to share to not make my clients angry

#

Despite that, it doesn't really matter if someone shares a few lines of code. There is a lot more to gamedev after all.

#

And the whole "I don't want to share my stuff" part is what makes all of us having to reinvent every freaking thing

#

But well, I'm heading back to Godot and work on my pet project

white smelt
#

i share a lot here

nova wasp
#

I mean, they did share it with me and I just ignored it for now

How about this @white smelt :

1, do all 6 steps in FastArraySerializer.h
2. check some in-engine examples of FastArrays and try to compare them with your own. Try to check out what they do every time they add/remove/set items in the array

and if that doesn't work ask me tomorrow/some other day and I'll try to look it over... I would also suggest trying to pare down how many lines are in the snippet as well and renaming things you don't want other people to see

I'm definitely not a fast array expert though so YMMV

white smelt
#

i did send in the parts of code that are related to the issue

white smelt
#
//Adjust the count for the item
                    EntryIt->PreviousCount = EntryIt->Count;
                    EntryIt->Count = NewCount;

                    //Mark our last stack added too, so we have something to return.
                    LastItemEntryAddedTo = *EntryIt;

                    //Adjust Count now we have merged some stacks.
                    Count -= AmountToAdd;

                    //Mark it dirty so it can be replicated
                    MarkItemDirty(*EntryIt);

                    //Finished merging all items, as count is now 0, so no need to continue iterating
                    if (Count == 0)
                    {
                        break;
                    }
                }
            }
        }
    }

its mentioned in the code

#

thats the end of the AddEntryFunction

#

?

#

what is that about

#

where can i see engine implementation then?

nova wasp
#

I clicked ignore, sorry

white smelt
#

thats in here man

nova wasp
white smelt
#

in this chat

nova wasp
#

lol, did it like soft block you or something? I don't want that

#

some spam protection thing?

#

oh well, anyways

#

in your fancy IDE just find stuff inheriting from FFastArraySerializer

#

in my case I have some already from Lyra (a good source of example code here)

#

but the engine has many more as well

white smelt
#

well maybe if someone has time in the mean time check it.
if you dont want to dont do it im not forcing you.

#

also i dont use lyra

nova wasp
#

that's cool, I didn't tell you to use Lyra

#

in this case it's more to serve as an example

white smelt
#

i dont have no examples in my ide

#

they all come with lyra

nova wasp
#

you need to download the engine source in the launcher

white smelt
#

just package it

#

the second time is faster

whole drum
#

But its a little bit slow, to package it and share the files etc..

white smelt
#

source is 200gb

#

maybe building is going to be faster

nova wasp
#

but unfortunately symbols for debugging are indeed huge in the binary

white smelt
nova wasp
#

learned about what?

white smelt
#

i was thinking source source

white smelt
nova wasp
#

chances of me helping you won't go up if you just try to imply I don't know what I'm talking about 😅

white smelt
nova wasp
#

usually new people start on a binary build and skip getting binaries, sorry

white smelt
#

when people usually talk about source its from github

nova wasp
#

"source" can mean either the binary's source + symbols or the full "source build"

white smelt
#

anyways

#

change of topic

nova wasp
#

you don't need a source build to search for simple examples of a fast array...

white smelt
#

you learned about it 2 days ago

nova wasp
#

learned about what? binary builds?

white smelt
#

ufffff

nova wasp
#

I've been telling people to download symbols in here for years moon2SUFFER

#

don't become like me lol...

#

if you mean 2 days ago being your problems I guess that's true? I didn't understand, sorry

white smelt
#

for my aprox 2m~ cpp im really good

#

thats an advanced topic here the arrays

#

and instead of tellin me off maybe try to help

#

or just dont participate in this disscussion

#

after all im looking to learn, im young freshly started c++

#

my eyes are young aswell and reading code you or me is completely different thats why i ask for advice in here of well developed people where the majority is trying to help

#

and when i can help someone i help

nova wasp
#

If you want professional help ask in the job board

white smelt
#

you are completely missing the point what this discord is for

nova wasp
#

also NEVER feel bad about having gaps in C++ knowledge but a lot of the qeustions you ask make me think you could use learncpp.com or something to help have the foundations to read anything else

#

and by anything else I mean: being able to just read engine code to figure out how to use stuff

white smelt
#

if this is your problem me asking stuff about specific topics im sorry

#

just dont reply to my questions

nova wasp
#

I think you won't find many people in here who like vague questions lol

white smelt
#

i have being through this header 2 days ago still

#

its not like you made me discover it

nova wasp
#

I mean, I could share one I made I guess?

white smelt
#

the problem here is it seems correct

white smelt
#

one thing i could think of if its really not the Array it could be cause by the way i set up my pick up logic, which i highly doubt cause its cleanly set up

heady copper
#

Hey guy what’s good

#

Am curious about something please

#

Is match making same thing as hosting a match session?

#

Or it only applies to dedicated servers and not listen servers

white smelt
#

matchmaking is more a tool that creates or unlocks a server if a specific amount of players are looking for a game instance

thin stratus
#

Matchmaking is a lot of things. And it really depends on what you need it to be.

white smelt
#

normally you use third party stuff i think like play fab

thin stratus
#

Most people think about matchmaking as a "I press 'PLAY' and the Game matches me with other's of my skill level and lets me join a Server." System

#

But in theory that can also work with one of the player that got matched being the ListenServer host.
That however allows for cheating by the host.

#

I think oldish CoD lobbies were done like that

#

Steam also has some matchmaking API calls, but I never used them or looked into them

#

It's not necesserily the same as the PlayFab matchmaking

#

Also in general Matchmaking has nothing to do with the hosting part

dark parcel
#

No easy way to get session ping without being inside the session? :3

dark parcel
white smelt
#

does this look like bad practice? this is in my BaseItem class and it sends/calls the function in the players inventory component

#

count 1 is debugging purposes and always adds one item per pick up

nova wasp
heady copper
dark parcel
thin stratus
#

They handle hosting, scaling and matchmaking for you, but it costs a chunk of money.
Not that hosting this yourself would be any cheaper.

#

In general, if you don't have a lot of money to throw at this, you will want to rethink your plan

heady copper
#

Am utilizing it

white smelt
#

play fab gives you 2 cores and an amount of hours for testing tho

thin stratus
#

Sure, but ultimately you have to pay

heady copper
thin stratus
#

No

heady copper
thin stratus
#

You can try it, but all it does is rely on existing Subsystems, like Steam.

#

It won't host Servers for you

#

You still have to host the Servers or use ListenServer, which will allow cheating

#

So if any part of your game is competitive or you want to do stuff where people unlock things by playing, that will all be cheatable

dark parcel
#

`No server fees, or any external service costs!

Kronos is built on the Online Subsystem framework of Unreal Engine. The Online Subsystem is an interface that provide a common way to access the functionality of online services such as Steam® or EOS. This means that Kronos can support a wide range of online platforms, that allow hosting sessions without any cost!`

white smelt
#

i would go play fab if the game is worth it

thin stratus
dark parcel
#

Yeah that's why no cost 😄

#

the host is the server

thin stratus
#

Overall, any kind of game that requires this should not be developed by a single dev or small studio

white smelt
#

wow

thin stratus
#

You say "wow", but you do know "Gamespark" or whatever they were called was just like PlayFab and they died the same way PlayFab can just vanish from one month to another?

nova wasp
#

here's my shitty fast array I made a while back, I tried to have it serve as a single thing to send over transforms for tons of stuff but it didn't work out well as it ran up against replication rate issues that I found hard to control

white smelt
heady copper
dark parcel
#

Any of you guys that uses steam able to get Session ping?

white smelt
#

this is Iris

nova wasp
#

happy??