#multiplayer

1 messages · Page 282 of 1

fossil spoke
#

This would be a time to override that

#

So you dont accidentally destroy that Pawn

#

Overriding that functionality is not unsafe

#

Its normal to do that

#

For certain circumstances

#

Like the one I mentioned above

#

Yes

halcyon ore
#

Seems so.

#

Actually, I've miss-lead you, and myself.
I don't actually see anywhere the DetachFromControllerPendingDestroy actually destroys the pawn?

#

That says "knowing it will be destroyed soon"
But, itself doesn't actually destroy.

#

Hence the confusion of your pointing out said function when debugging with a breakpoint.
Gotta find the exact line that calls destroy.

fossil spoke
#

You want APlayerController::PawnLeavingGame()

halcyon ore
#

Yeah.
I pointed that out.
So, its making me think your not actually using your C++ class, and still using base UE

fossil spoke
#

Which is called when the PC is destroyed

#
void ABLPlayerController::PawnLeavingGame()
{
    // Not calling super here is intended - we leave it up to each pawn to decide how it behaves when the controller is destroyed
    // Super::PawnLeavingGame();
}
#

This is ours

halcyon ore
#

Yeah.
Double check your controller parent.

#

Still has me sus, none the less. 😛

nocturne quail
#

not sure why in a standalone game the timer never stops...

FIRST TIME ENCOUNTER THIS ISSUE WITH TIMERS

void AWeapon::FireRifle_Internal() // called by server
{
    GetWorld()->GetTimerManager().ClearTimer(WeaponFiringTimer);
    GetWorld()->GetTimerManager().SetTimer(WeaponFiringTimer, this, &AWeapon::TryAutoFire_Internal, FiringInterval, true);
}

void AWeapon::TryAutoFire_Internal()
{
    if (bStoppedFiring)
        return;

    UE_LOG(LogTemp, Error, TEXT("=== TryAutoFire_Internal ==="));

    CurrentAmmoInClip -= 1;
    SpawnBullet();
    BulletCounter += 1;

    if (CurrentAmmoInClip == 1)
    {
        GetWorld()->GetTimerManager().ClearTimer(WeaponFiringTimer);
        BulletCounter = 0;
        bStoppedFiring = true;
    }
}
#

but if I play as client, it works fine

nocturne quail
#

solved, was related to bots, they were starting the timer but not exiting it 😄

verbal dust
#

When I spawn an actor it always spawns at an offset from where it is on server for the client

#

no matter if the rpc is called from client or sever

dark edge
verbal dust
#

Ah you helped me fix it in the blueprint thread.

crisp shard
#

default values set in classes are "replicated" as in their intial set values are available to the clients, right?

halcyon ore
#

Not by network/ replication means, but yes.
The client knows of them.

crisp shard
frosty harbor
#

Anyone knows if there's a way to prevent CMC from affecting local player's camera? When doing crouching / uncrouching it's performing it instantly regardless of ping on the players camera, however, when the server actually performs the crouch / uncrouching the camera does another adjustment (even though I'm already back to where the camera was meant to be in anyways).

This is especially noticeable if you crouch / uncrouch instantly, because locally it happens right away but the "crouch" hasn't even arrived to the server yet even though you've already done crouch + uncrouch locally, so there's a big correction visually. If the player actually stays crouched for say 0.5s then there's no corrections at all but if it's an instant crouch / uncrouch then it triggers a big correction

#

Separating it to run crouch/uncrouch on the owning player only doens't even work either because this always sends the event to the server rpc regardless of happening locally or not

sage lance
frosty harbor
#

its different, lyra is a 3rd person,im doing a first person game, my camera is a lot more sensitive to tiny changes. Mine also works in multiplayer its just that I want to finetune it not get the issue I mentioned above

halcyon ore
#

What am I missing for replicated sub objects? 😛
Owner Actor:
Replicates and Replicate Using Registered Sub Object List
Replicated Object:
(Image)

I see stuff talking about a ReplicateSubObjects function, but its comment says its un-used when using the Replicate Using Registered Sub Object List bool.

#

I spawn the actor, construct the object, AddReplicatedSubObject, and the server will print its on rep function call, so the object is created/ valid, and has the correct outer.
and, if I disable Replicate Using Registered Sub Object List, it throws the ensure about it being disabled, so what am I missing?

#

I also tried adding the replicated object to a replicated TArray, thinking maybe the var is needed to actually replicate, and the adding to the sub object list, just allows it.

halcyon ore
#

NVM, figured it out.
I messed up a bool check for my testing function.
So, it added to the sub object array, then removed it, instantly. 😛

plain latch
#

Has anyone here used AInfo for their inventory? I'm refractoring my inventory system and I've almost got it working, but I'm stuck on some client side stuff. I use an inventory actor that I spawn with an Inventorymanager component on the player controller, and to pass it around I use an interface. The system actually works for all net modes, I can add and remove fast array items, but the inventory pointer returns null when I go to fetch it for UI. Whats a good way to spawn AInfo classes?

#

If it helps, I spawn my info class the exact same way the Lyra Team Creation component does. (Waits for the experience, checks for authority, then spawns it inside a WITH_SEVRER_CODE block)

thin stratus
plain latch
#

Yeah let me check. I was worried it had something to do with the player controller only being relevant on the server and owning client

thin stratus
#

That shouldn't matter, unless you pass the PC as the Owner and set the AInfo to share relevancy with it.

plain latch
#

Oh wait a minute I didn't actually pass anything in as the owner in the spawn params. That might have something to do with it

#

My idea for this is that the InventoryManager can be placed on any actor and it will just handle the creating it, then I can just pass it around like I would an ability system with an interface

#

So I might have to do some extra stuff for a player

thin stratus
#

Shouldn't matter. Not passing an Owner just affects Ownership an thus RPCs and Replication of properties.

#

The Actor should still replicate. You should just print/breakpoint the UI functions and your Actors BeginPlay to ensure they call in an expected order.

plain latch
#

I'll do some tests. I tried to nab it directly from the character for a print string where it also returned invalid, but the item granting still worked. I might've just done something wrong on the blueprint side there. Gonna look through my UI and that

#

Okay its looking more like a race condition. Might have to do something like an inventory ready gameplay message or something

#

The inventory manager itself is valid but the inventory actor isn't

#

I delayed the call a bunch and it still didn't show up. Silly question but is there some other REPNOTIFY macro I need to call or something in the OnRep function? Gonna mess around with DOREPLIFETIME too

plain latch
#

OnRep_Inventory is never getting called. I think I'm never setting the pointer on the client. Here's how I'm currently creating it

#if WITH_SERVER_CODE
void UTestInventoryManagerComponent::ServerCreateInventory()
{
      UWorld* World = GetWorld();
    check(World);

    FActorSpawnParameters SpawnInfo;
    SpawnInfo.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
    //SpawnInfo.ObjectFlags |= RF_Transient; // We never want inventories to save into a map.

    ATestInventory* NewInventory = World->SpawnActor<ATestInventory>(InventoryInfoClass, SpawnInfo);
    checkf(NewInventory != nullptr, TEXT("Failed to create inventory from class [%s]"), *GetNameSafe(*InventoryInfoClass));

    // This may be the problem! OnRep_Inventory is never getting called. I don't think this pointer is getting set on clients!
    SetInventory(NewInventory);
}
#endif //WITH_SERVER_CODE
junior timber
#

How can I implement microtransaction with steam and unreal engine 5.7
I am using advancedsession plugin for multiplayer. Is there any blueprint method to do it?
What should I look into?

halcyon ore
#

@haughty ingot Just to keep it in the correct section.

I looked it up.
How would this go with FastArray, thats is delta map based?

Does it like "work" with it?
Cuz, If I need to break it into bunches, but what if the values change while the bunches are being sent?
Data error/ miss-match?

haughty ingot
#

For the initial bunch

halcyon ore
#

Right, but given it happens in chunks (over time)
What if the data is changed, while being sent?
Won't the deltas be out of sync?

haughty ingot
#

It's kinda up to you to verify that, you could use the Dynamic replication condition to make sure that changes don't come through until after. There's a lot of edge-cases, but it's just a way to get a big bunch over

halcyon ore
#

I see, ok.
and, just to be sure (since it sounds like you've done it)
Google says to send these bunches through normal RPCs, or is there a more intended way, or reliable source of info?

haughty ingot
#

You could send a packet if you really wanted to, but an RPC is the easiest way.

halcyon ore
#

Well, thanks for that.
I didn't realize you could custom batch variable replication, and keep the actual var working like normal.
(I of course knew of batching, but I always thought it would make normal var replication have issues.

Still gotta do like 30% cursed stuff.
Cuz, of course var replication condition is everyone, or no one.
So, I need a middle man actor, for targeted player replication. 😛

haughty ingot
halcyon ore
#

Correct, with COND_Custom.
Which has no context of person, and the UE page for it doesn't speak of anything for per controller/ person replication.

#

So, while.
Yes, dynamic.
It becomes a send var to everyone or send var to no one

#

One thing I did think of was Using the sub-objects netgroup replication type.
Doing some cursed ass like internal batch indexing.

But, I wasn't sure which method was more cursed, or not. 😛

halcyon ore
#

Thats for sub-objects.
Not for just variables.

The sub-object method is more "cursed"
Compared to the more "correct" batching a Fast Array struct on its initial replication like Elliot suggests

nova wasp
#

for just individual variables you are going to need to make engine changes afaik

halcyon ore
#

I was just gonna attach an actor, and use the is relevant for function on it.

#

I can barely understand the network code, for UE, so ain't no way i'm gonna make engine changes for that.

nova wasp
#

also you can just replicate stuff down to individuals without any fancy anything by just using the player controller or actor components on it

halcyon ore
#

Won't the nature of Fast Array delta stuff, throw replication at every player either-way?

#

(when changes occur to the Fast Array I mean)

nova wasp
#

afaik there is not going to be a way to have nested replication conditions unless the things replicated by the fast array are object references that choose to not show up and even then I would very much say you probably want to have 2 fast arrays instead there lol

halcyon ore
#

No, its not a nested thing.

nova wasp
#

inside of what?

halcyon ore
#

Not sure I follow.
The CURRENT setup is a Fast Array in an inventory component.

My proposed working setup is a comp as a sort of "manager", but an attached actor has a Fast Array var on it, so I can use the is net relevant for function.

nova wasp
#

relevancy seems a bit overkill as it will have to constantly check them afaik, no?

#

but I don't know if net groups work well in old replication either

halcyon ore
#

But, net groups are replicated sub-object only.
Which leads to the same "issue" I will have.
Too much replication data in 1 network bunch, because UE doesn't batch sub-objects, like it does individual actors.

nova wasp
#

define too much replication data

#

is it concerning to tell users about data they should never know about here? that could make sense if the goal is to hide things

halcyon ore
#

This is for an inventory system, but with far more data storage, then I think most games do.
So, overall quality, individual stat quality (6 stats), quantity, some bools, string, and probably even more.
Those are just the basics.
Of course, not every item will use all of these, but it will very quickly hit the 65k limit.

nova wasp
#

have you ever bandwidth profiled this?

#

also why is a string even being sent...

halcyon ore
#

I profiled a couple.
Never enough to cause any issues.
But, I know the bandwith of a "basic" item, and a "complex" item.

A string is sent, for a custom name, if so desired by me, or the quality system. (Like I said, very data filled)

nova wasp
#

"if so desired by me?" is the string entirely arbitrary at runtime or is it something tied to a specific asset or object

halcyon ore
#

Arbitrary to whatever I want at runtime.

nova wasp
#

the important thing to think about here is INFORMATION I guess

#

for example if the string it uses can be derived from a simple ID you don't need to send a giant buffer of characters

#

In Iris you can kinda abuse this by using exported names I guess but not in regular replication

halcyon ore
#

No.
Its entirely arbitrary to whatever I may need it for.
I could rename wood to what the heck, for all I care.
Granted, I would never go that goofy.
But, it is just a string that accepts any value thrown at it.

nova wasp
#

please consider what I wrote there by "derived"

#

if you are the one who defines what the string is it's just in the game

#

so arguably you could make a dataasset or something per type of item, or even a custom asset etc

halcyon ore
#

I'd need to think on it, now that you give me that context.
I guess its just my want of being "direct"
I'd hate to be goofy as hell, and be like this says id 5, and go to another asset to find out wtf id 5 is.
When I can just type out cool wood, and know.

But, thats valid for the string usage.

nova wasp
#

but if it truly is just arbitrary it might be easier to just slam a string in there... I will say I have not really measured shorter strings bandwidth in detail mostly because I have not ever had to send one though so it might be fine

nova wasp
halcyon ore
#

Are you suggesting I make individual data assets, for each "custom name".
I guess that would work, just seems kinda goofy.
But, it would solve the whole I don't wanna have to look up id 5

nova wasp
#

it depends on how many unique things there are

#

arguably if there are like 5 unique items it could just be an enum lol

halcyon ore
#

Oh, defenitily not 5. 😛

nova wasp
#

making a way to represent unchanging information about the item as a smaller handle (an asset object here) is something I find difficult to justify not doing in a serious project

#

arguably it could be the display name does change based on the instance info though, but even then passing down which type it is by asset would let you ask the class what name it should have based on current instance-specific data and not need to waste bandwidth sending basically a chat message for an inventory

halcyon ore
#

Perhaps you miss-understood.
The items do have a base name, such as wood, that is defined in the class, and not replicated over the network.
Unless, you do understand it as that.
Its just that there can also be a custom name that overrides the base name, that I want.

nova wasp
#

so the class is already sent?

#

is the custom name something that requires localization? how often does it change?

#

if it's rarely changed and just for a prototype thing it's probably fine, I am going to test out real quick how expensive small strings are to send

#

it might be that these aren't large enough to be concerning

halcyon ore
#

In theory it would be localized, so that its localized.
but, I haven't thought about localization that much.

Its one of those wants with my game.
While, yes I could define 15 different types of wood.
It seems more logical to make 1 wood, and custom override its name to however it was retrieved.

#

Rather then handle annoyances of item class conversion, or stacking different classes, and handle that.

nova wasp
#

even gameplay tags would be better here honestly...

#

you can't localize a raw string afaik

#

unless you have a local string table to hash over each time a new item shows up (oof)

#

to the FText

#

I have no idea what item class conversion has to do with this

halcyon ore
#

Yeah, I do current have a Gameplay tag thing setup.
For the quality system, and such.

#

Also, BTW
This is my current item network info setup:
A couple more are planned, but I haven't quite locked in what I need/ do want.
Still been working on the basics of systems, and getting them working.
Been going good, just reviewing some stuff, for better/ more correct ways to do it.

Class - item class
int64 - item ID
Fstring - custom name
CURRENTLY fstring array, but now planned to be GameplayTag array - dynamic keys
int32 - dynamic values

nova wasp
#

even smaller strings here nearly take up the entire packet bunch

#

if these are sparodic it won't matter I guess

halcyon ore
#

Yeah, thats about what I got.
Adding a basic 15 character string, brought my items from 58.2 bytes -> 73.2 bytes

dark edge
#

Been watching some stuff on Iris, so it doesn't rely on actors and actor channels?

nova wasp
#

iris internals barely even know what a uobject is

dark edge
#

Does this make replicating internal state of subsystems a bit easier?

#

feels like it might

nova wasp
#

its 1 cvar to turn on iris and try it I guess

boreal bison
#

what are the best optimizations to implement for spawning a lot of AI enemies (~100-200 at absolute max) for a multiplayer game in the style of something like Megabonk? the AI would only need to slowly move towards the players at first, maybe play a montage to perform a melee attack. I'm reading a lot about the CMC being fairly heavy, tick frequency, and stuff like that, and i know there are some related assets on FAB but I'm not sure which ones are worth getting, if any, and in general what optimizations allow a game like Marvel Rivals to run a multiplayer PvE mode that spawns hundreds of zombies at a time

chrome bay
#

Still early days in that regard

nova wasp
chrome bay
#

There's just a lot of recent, regular commits mentioning this stuff - so heed caution I guess

torn hull
#

Hey, can nested child components replicate in Blueprints? I’m having an issue where my sphere interaction collision is set to replicate, the actor itself is replicated, and the DefaultSceneRoot is replicated too. But when I disable the collision on the server, it doesn’t work on the clients. The collision is still active on their side. It only works if I do this using a rep notify, but I thought that if component replicates, I wouldn’t have to do that.

kindred widget
#

See? The code you're calling affects the BodyInstance.

void UPrimitiveComponent::SetCollisionEnabled(ECollisionEnabled::Type NewType)
{
    ECollisionEnabled::Type CurrentType = BodyInstance.GetCollisionEnabled();

    if (CurrentType != NewType)
    {
        BodyInstance.SetCollisionEnabled(NewType);

        EnsurePhysicsStateCreated();
        OnComponentCollisionSettingsChanged();

        if(IsRegistered() && BodyInstance.bSimulatePhysics && !IsWelded())
        {
            
            BodyInstance.ApplyWeldOnChildren();
        }

    }
}```

Body instance is not replicated.
```cpp
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Collision, meta=(ShowOnlyInnerProperties, SkipUCSModifiedProperties))
FBodyInstance BodyInstance;```
torn hull
compact flame
#

Im having a bit of an issue.. Im trying to make a kind of aiming system, but when I do the regular RPC setup it jitters on the client so Im trying to get it to do it on both client and server separately so that client looks smooth (It will use the servers rotation after so its just so it looks smooth on client)

#

Im prob doing it way wrong lol

#

Nvm figured it out

bright summit
compact flame
compact flame
#

lol

crisp shard
#

i created a bullet pooling subsystem for guns and im trying to figure out the best method for spawning visuals (or really where/how to handle the hits). i currently do have damage being applied inside the subsystem, which would be fine if that's all i needed, but i'd like to handle hit VFX as well that are not related to dmg and more just visual of the bullet (like a bullet trail and an impact vfx regardless of what it hits). i can't do a multicast in the subsystem as far as i can tell,so im trying to figure out where/how would be the best method of handling the impacts outside of the subsystem

#

how about... a component on the game state????

crisp shard
#

@kindred widget my b, and no rush on this ping, figured since you suggested it, you may have an answer here.

i have made the cpp subsystem, and am not sure how to handle the hit's / visuals (hit and trail, so both). i have the whole thing pretty much working but just not sure how to handle the impact of the bullets from a visual POV, as you can't make a multicast from the subsystem, so curious of what would be the standard practice to handle the visuals / hit VFX for simulated clients?

snow matrix
#

Hello guys, I hope you are good, I am making a prototype of a cooperative game and I am encountering this problem. Does anyone know why this is happening?

#

Basically, when I rotate the character in the server window, the window vibrates, while when I rotate the character in the client window, the character rotates without problems. I think it's some kind of motion prediction and correction movement issue, but I don't understand it since the server itself is doing the rotation, so there shouldn't be these kinds of problems

#

Here is the code

#

I've been looking for solutions and even tried writing the code in the player controller, but the problem persists. So I was wondering if anyone has any idea what it could be. Thanks in advance for your help.

#

Btw in the OnRep function, I'm rotating the capsule component like this

vapid fog
#

Anyone using a lyra base, or otherwise, and upgrade to 5.6, have an issue where a host will ServerTravel to a new map, and clients will attempt to connect during travel, get refused, and then reload the default map?

I know what changelist is causing the issue, but I want to understand the root issue more clearly.

nova wasp
#

I might have to check to see if there's anything in here I should update to

nova wasp
#

also if you need relevancy for example to not send to a user when something happens reaaally far away

vapid fog
#

To be clear: I have not tried reverting the change myself to see if that's the issue for me, but the symptoms are the same.

#

And it happened when we updated from 5.5 -> 5.7. So similar engine update.

crisp shard
# nova wasp also if you need relevancy for example to not send to a user when something happ...

yea good questions, and good point about the relevancy, as i didn't think that far yet, but they are bullets from guns, so hard to really judge, but considering it's one of the more common weapon types, i'd say semi frequent? but could be very frequent, so potentially many shots at once, could be sniper where there is a cooldown, but could also be a machine gun where there are many bullets at a time.

currently i just made two* delegates in the subsystem and was thinking to bind to "on fired" and "on hit" (the two delegates) in the gamestate for the visuals (and potentially damage as well, but i probablay will handle that straight in the subsystem still, as the hit impact VFX are then different and i can do that stuff on the character that got hit) the bullet trace VFX would be fired every shot ideally (unreliably). could proabbly do this many diffetn wways but still new to cpp and super new to a custom subsystem so not sure of what might be best. the point about relevancy might be the most critical for just reducing any unnecessary events for irrelevant players. but doing on game state has me a bit wary as i wouldn't typically do something like this there, but it did seem like a suitable spot due to it always being available, and i wanted to avoid putting it on the charcter or anything like that. if the bullets were actors (which they aren't they are just data structs (new method i learned yesterday in here)), then i would have just done it in the bullet actors, but because they aren't im still thinkign through best places to handle the addtioinal logic

vivid siren
#

Does anyone know of a good place to see some ballpark "good" values we should be aiming for when it comes to network profiling stats?

When I see stuff like the average size in bytes being 200-300 for my pawns and 0-10 for generic items, i have no idea if that is good or bad. And when i see stuff like some actor having a Rep HZ of 60-70, I have no idea how to interpret that.

vapid fog
# nova wasp it kinda depends to me on how often they receive the info, how many there are, ...

What seems to be happening is that the server initiates travel (this is ServerTravel, NOT SEAMLESS) which disconnects the clients and tells them "Hey, we are traveling to a new map!" and then BEFORE THE SERVER CAN FINISH TRAVELING TO A NEW MAP the clients attempt to connect, the server refuses them because its still on the old map, and so the client says "Oh well, heading back to main menu."

#

I have no idea why this worked before the changes in 5.6. But something clearly changed. Error handling? Maybe the depreciated socket address resolution stuff? It's unclear to me.

nova wasp
# vapid fog What seems to be happening is that the server initiates travel (this is ServerTr...

can you try to catch when the client first sends the "let me travel bro" request? or does the server not queue it up for later. This is a part of networking I am mostly clueless about so apologies if I gave the impression I have a strong idea of what is going on here... I was hoping it was just a clear difference in what Lyra is doing on their side but this is more fundamental to the connection it seems

nova wasp
#

I would say in general the net update hz per-actor is something you can quickly tweak and observe how much it reduces quality just in the editor

#

generally speaking the idea is to send things that are important first at the best speed and reduce or remove things to send that are farther away. The player might not need to care as much about an actor updating 2000 miles away from where they are

vivid siren
#

Yeah i'm currently in the process of setting up a custom system to dynamically adjust things like the frequency of net updates, priority, and whatnot, but then i realized i don't even know what my target benchmarks should be lol

#

would be great if epic provided some example .nprof files for us to ponder

nova wasp
#

use repgraph (outdated and deprecated) or newer iris filters/prioritizers if you want something built in

#

be warned iris stuff is newer and more experimental but it is kinda purpose-built for doing stuff like that

#

@vapid fog do you change ServerTravelPause by any chance?


[/Script/Engine.Player]
; These numbers should match TotalNetBandwidth
ConfiguredInternetSpeed=200000000
ConfiguredLanSpeed=200000000

[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxInternetClientRate=100000000 ; note that this is absurdly high lol, I don't think you want to do this in a real project but I think the defaults are too low
MaxClientRate=200000000
InitialConnectTimeout=10.0
ServerTravelPause=2.0
#

also note here I increase the default bandwidth rates a lot lol

vivid siren
vivid siren
#

(i know you're talking to someone else about that, i'm just curious)

nova wasp
#

I don't know why the pause is reduce from 4 to 2, I am looking through random ini diffs to find out why

vivid siren
#

server travel has been my enemy recently, because i can get our project in a stable state (4 player co-op, physics based pawns), but things always seem to break down after a server travel

vapid fog
sage lance
#

NOW THATS QUICK

#

xD

vapid fog
nova wasp
#

It can change per net driver as well

vapid fog
#

Going to check the other ini files.

#

ah.

sage lance
#

yeah its not there by default but the default is like 4 seconds or something

vapid fog
#

BaseEngine.ini has it at 4.

nova wasp
#

I doubt simply delaying will help here I guess but just in case this is a place to investigate

vapid fog
#

Well, the delay would BE the problem. Since the client is trying to connect before the server has even initiated travel.

sage lance
vapid fog
#

So, this will reduce the issue, but is unlikely to solve it entirely. The reason is because my client is throwing a socket error: SE_ECONNREFUSED.

Now, that's interesting because its only ever used in one place relevent for my setup. In FSocketEOS::SendTo.

    // Check for sending to an address we explicitly closed
    if (WasClosed(DestinationAddress))
    {
        UE_LOG(LogSocketSubsystemEOS, Warning, TEXT("Unable to send data to closed connection. DestinationAddress=[%s]"), *Destination.ToString(true));

        SocketSubsystem.SetLastSocketError(ESocketErrors::SE_ECONNREFUSED);
        return false;
    }
#

Which means that its trying to send to the socket that it already explicitly closed, and not using the new socket its opening (or perhaps the new socket is also getting closed).

vapid fog
#

Or the new net driver is trying to use the same socket or something?

#

This is all lower level than I'm used to. So still picking up how it works.

quartz smelt
#

Hey all! I'm having a timeline move an actor. The movement is replicated but the more clients are connected to the server, the faster the timeline ends? Any idea why this might be

nova wasp
quartz smelt
nova wasp
quartz smelt
#

With just a quick google search I now understand, haha thank you Im so silly

quartz smelt
#

@nova wasp Ay bro youre mad clutch, just adjusted it and it's all working. IDK how I didn't think about frame rates

halcyon ore
#

Surely, I'm missing something basic. 😛
Trying to setup a basic Fast Array test, that uses delta replication (I had previously setup a FastArray, but turns out, it didn't use deltas at all, or its related functions...

This is my .h file: (this is on a replicated actor component)
Super stupid basic.

USTRUCT(BlueprintType)
struct FEntry_Int_Test : public FFastArraySerializerItem
{
    GENERATED_BODY()
    
    UPROPERTY(BlueprintReadWrite)
    int32 Test_Int = 0;

    // Overriding PreReplicatedRemove and PostReplicatedAdd (optional)
    void PreReplicatedRemove(const struct FArray_Int_Test& InArraySerializer);
    void PostReplicatedAdd(const struct FArray_Int_Test& InArraySerializer);
    void PostReplicatedChange(const struct FArray_Int_Test& InArraySerializer);
};


USTRUCT(BlueprintType)
struct FArray_Int_Test : public FFastArraySerializer
{
    GENERATED_BODY()

    UPROPERTY(BlueprintReadWrite)
    TArray<FEntry_Int_Test> Items;

    UPROPERTY(BlueprintReadWrite)
    UObject* Owner_Object = nullptr;

    // Custom NetDeltaSerialize implementation
    bool NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParms)
    {
        return FFastArraySerializer::FastArrayDeltaSerialize<FEntry_Int_Test, FArray_Int_Test>(Items, DeltaParms, *this);
    }
};

template<>
struct TStructOpsTypeTraits<FArray_Int_Test> : public TStructOpsTypeTraitsBase2<FArray_Int_Test>
{
    enum { WithNetDeltaSerializer = true };
};

Then, a function that I run on a timer, to just have data change.

void UComponent_Fast_Test::Random_Entry()
{
    FEntry_Int_Test Entry = Actor_Array_Int.Items[FMath::RandRange(0, Actor_Array_Int.Items.Num() - 1)];
    Entry.Test_Int = FMath::Rand();
    Actor_Array_Int.MarkItemDirty(Entry);
}

A normal on rep gets fired off, when I change the value.
But, not its custom replicated functions for add, remove, change?

nova wasp
#

iris or normal replication (only changes the parent fast array iirc and maybe the function in delta, this is fine if not on iris)

halcyon ore
#

Normal

nova wasp
#

struct traits are wrong

#

you want to trait the fast array itself, not the item afaik

halcyon ore
#

It is.
Its targeting my FArray, not my FEntry
Sorry, that my names are all over the place.
I kinda expected this to work, and then I actually fill in data, and make it logical.

nova wasp
#

ah, got baited by the nearly identical names

halcyon ore
#

The only replication event, that works is the PostReplicatedAdd, when the actor becomes relevant.
But, when the data changes, the change function doesn't fire.

nova wasp
#

you are copying in the item to mark dirty

#
void UComponent_Fast_Test::Random_Entry()
{
    FEntry_Int_Test& Entry = Actor_Array_Int.Items[FMath::RandRange(0, Actor_Array_Int.Items.Num() - 1)];
    Entry.Test_Int = FMath::Rand();
    Actor_Array_Int.MarkItemDirty(Entry);
}
#

do this instead

halcyon ore
#

I'll give it a try.
I thought I got it correct, cuz it yelled at me when I forgot to MarkDirty the item, I assumed it would do the same, if I did it wrong

#

Bruh.
Of course it was that simple. lmao

nova wasp
#

most ides will have a little warning when you copy something accidentally (or intentionally, not really a warning)

#

easy mistake to make though... I do that a fair bit

halcyon ore
#

I guess Rider don't care. 😛

nova wasp
#

Rider adds a little arrow that indicates a copy occured here

#

it's not really possible for Rider to know why you copied it and if you wanted to on purpose

halcyon ore
#

Oh, I thought you meant it would throw a full yellow warning.
Not this tiny little icon. 😛

nova wasp
#

arguably the MarkItemDirty impl could ensure upon the address being outside of any array allocator's range but idk if that fits well

#

yeah, that's there telling you what happened

halcyon ore
#

Well, thank you.
At least it was simple.
Now I can actually continue work.
Still getting used to reference, copy, especially when dealing with BP, where its like a fake reference or something.

#

I was under the impression copy/ reference stuff was between functions.
Not internal inside 1 function.

I guess from my BP experience that makes no sense, in hind sight, cuz BP specifically gets ref, or gets copy based on function use.

nova wasp
#

FFastArraySerializerItem stores 3 separate integers for tracking state

#

you should definitely try to pay attention to things that have "out" variables etc

#

which is something passed in as a mutable reference

#

MarkItemDirty modifies the state of the passed in item

#

and you also would not really see the change in the array item if you only made a copy on the stack have a random number

#

unless passing in the item would also copy it and try to re-add it to the array (that would be weird)

#
// its assumed the array is not empty here, of course
    const int32 RandIndex = FMath::RandRange(0, Actor_Array_Int.Items.Num() - 1);
    Actor_Array_Int.Items[RandIndex].Test_Int = FMath::Rand();
    Actor_Array_Int.MarkItemDirty(Actor_Array_Int.Items[RandIndex]);

also could just keep it as array[i] instead but I also kinda like having local refs if this is harder to read

#

edited to make it a bit more correct but you get the idea

halcyon ore
#

Yeah, of course.
I just wanted a quick little test bed, to make sure it works.
So, just threw names, functions, etc together. 😛

nova wasp
#

also whenever you auto Thing = GetThing() auto NEVER tries to make a returned reference a reference

#

you must define it as auto& to get that

wintry forge
#

Can you nest a FFastArraySerializer inside another's FFastArraySerializerItem?
E.g. I have a gameplay tag stack that inherits FFastArraySerializer. And I have an instanced item that contains it, which is a FFastArraySerializeraItem used in my inventory List which is a FFastArraySerializer.
I see Lyra seems to use subobject replication for the same thing, but I was wondering if I could get away with just using structs

meager spade
#

oh i mean if its in a diff outer

#

then yes

wintry forge
# meager spade oh i mean if its in a diff outer

So it'd at least still get serialized properly? Will it get delta serialized?
And since I have your excellency, would a UObject array for inventory items that have instanced properties and replicateSubObject (kinda like Lyra does) be better?

meager spade
#

this is all personal preferences, in our inventory we dont replicate the UObjects for inventory items (we build them all locally from the replicated fast array)

halcyon ore
#

Quick curiosity check, while unable to be at my PC.

Does Fast Array delta stuff work with by default with others structs inside the entry?
Or, can it not correctly delta structs?

crisp shard
# crisp shard yea good questions, and good point about the relevancy, as i didn't think that f...

Coming back to this, and to summarize the current state:

  • gun fires “bullet” from subsystem pool of data driven bullets

This was for performance of having many bullets at once etc. happy with that part

The issue: I don’t know how to do a multicast event from this without having to create some sort of external actor to handle it because the subsystem has zero way to support a multicast so I have to delegate it out to something

I attempted the gamestate (a component on GS) and it works perfect except an issue someone else brought up which is that every time a player fires no matter where the event happened the game state is going to relevant therefore the events will always happen even when they “shouldn’t” as they would be out of range and have no need to see it.

My only thoughts are to do this on the character but I just see that as a cop out move as i know it’s always going to be valid for the time of the shot. I’d put it on the gun but while a bullet is in flight it’s possible they unequip the weapon making it invalid and won’t fire those events (which are purely visual). Damage I wouldn’t mind having on game state or game mode even still that event would be “fired” for anyone regardless of their relevancy for it.

Long winded but yea trying to figure out what alternative options I have in my case. Using a global visual manager actor would give me the same issue as the game stare as far as I can think but yea any thoughts would be great

crisp shard
#

i suppose the character is really the best place unless someone stops me

crisp shard
#

im putting it on the character and no one is going to stop me!!!!!!!!!!!!!!!!!!

#

unless someone wants to chime in

#

i lied that's dumb and going to give same issue

crisp shard
#

going back to the gamestate until someone saves the day with new info

crisp shard
#

im prob going to keep ranting on this until i find a solution, but again, how can i get these data struct bullets to have replicated visuals associated with them?

you can't multicast from the subsystem, so that's out

a delegate on gamestate or character, would fire for everyone that is bound to that meaning unneccesary amounts of events being sent, so thats out

what other option is there? how is anyone using a subsystem for object pooling and getting any sort of visual when the bullet or projectile is in the air?

this is seemingly is way more difficult than making the actual subsystem in cpp and i dont even know cpp like that , so i have to be missing something or there must be a better apporoach for this

dark edge
crisp shard
#

you shared an example the other day of yours, so what are you doing to mediate the issue?

#

i've thought to use an interface as well for this, but idk again just seems like im doing too much to get the same result, but i do like the bullet pooling , and it does work, but no visuals

halcyon ore
#

1 actor to mediate the issue of 500 actors seems perfectly valid.

crisp shard
halcyon ore
#

No
1 managing actor for replication.
Cuz subsystem can’t rep

#

Since he said “replicate through”

crisp shard
#

but i have the game state, the character i could use if that was the case. unless im missing the benefit of doing it in a seperately generated actor

halcyon ore
#

That works then.
But an actor helps for a closed 1 purpose system.

crisp shard
#

i'd also have to figure out relevancy with that actor, cause woudnt i need to set it to always relevant or move it around so that it would replicate the visuals to the proper players? like say it spawns this actor at 0,0,0, and player is 1000000 away, i would assume it wouldn't fire for them ?

halcyon ore
#

Hmmm
Unsure then.
Maybe he meant individual managing actors per player (only relevant to owner, and set owner to the 1 player)
Either methods work at the end of the day.
Just an idea of how people like to design stuff.

crisp shard
#

seems like the only option to eliminate all other issues but i haven't tested yet, so i'll see soon

#

actually, scratch the "shot fired" event, that's unnecessary as well, for the subysytem. i'd just need the "hit" event really, and tbh, it's ONLY for hit VFX, cause i could just do the damage directly in the subsystem event

crisp shard
#

@kindred widget im pinging you cause you suggested this. how would i get visuals to work with this bullet pooling, cause there are no easy solutions as far as i can tell with this subsystem method. i.e. getting the simulated proxies to see visuals of the actual bullet, where it actually is

#

prior i had a attached visual to the bullet (it was an actor prob was less performant) but this showed where the bullet actually was. doing this on the local client is simple because i can get the niagara data directly at once, but the server i can't, i have to send it after in a multicast, and if i were to just fire the subsystem bullet event via a multicast, then it would be 'late" becuase the server already fired and has to replicate info back to the simualted clients

nova wasp
#

and maybe niagara data channel for spawning the vfx

crisp shard
#

which is, via the subsystem, i can't get the visuals to match the actual bullet without getting the math that is in the subsystem itself. so server event could fire, but the multicast would give simulated clients a false visual. i.e. they'd get damaged, THEN see a bullet visual fly at them

nova wasp
#

of course you still need to know about the initial fire on clients

#

not sure where I did not say they need to know about that

#

I suppose your question was more about the networking than the raw rendering then

crisp shard
#

im a bit twisted up as i've tried many things. it's really that the subsystem has no easy way of communicating directly to other clients, so if i were to tell the clients about the intital shot, i'd need the correct math of where that bullet is going

nova wasp
#

how complicated is the bullet simulation

crisp shard
#

prety sure it's like just fake phyics math

#
const FVector CurrentPos = Positions[i];
const FVector Gravity    = Data->GravityAcceleration;
const FVector NextPos    = CurrentPos + (Velocities[i] * DeltaTime) + (Gravity * (0.5f * DeltaTime * DeltaTime));
Velocities[i] += Gravity * DeltaTime;
nova wasp
#

so I would say sending the bullet position in realtime is possible but difficult unless you timestamp each new piece of bullet information (or in aggregate)

#

so one simple thing might be to send where the bullets start and their direction + what kind of bullet they are (to derive their velocity, or just the entire velocity raw if that is arbitrary)

crisp shard
#

i do have all of that in a DA in the gun itself, different for each gun, so that i would have, outside of the subsystem

nova wasp
#

subsystem/interfaces here are not really relevant as that's just a way to organize code... you could arguably make the subsystem spawn manager actors for each world cell or something but I actually think the idea of these being on the character (or a character's actor component) is a smart idea

#

any object can replicate if you want to suffer enough but we want to stick to actors and their components here to avoid complex ways of doing things that aren't nice

#

wrapping the way you ask the weapon to fire in an interface or whatever is fine, but interfaces are just a nice way to add common functionality to things and not really going to change how the actual data is sent around by unreal

bright summit
#

I need to test my game on separate game instances, using AdvancedSteamSessions. How can I connect to another game -nosteam option? open 127.0.0.1:17777 do not work. (I checked, this is the port for a server).

UE 5.6

nova wasp
#

@crisp shard
I think my general reasoning about how to make this work well depends on multiple hot takes:

The main thing here is balancing "knowing exactly what happened" about the bullets with the reality that sending ALL of the information might not be worth doing or necessary depending on a few things

I think of this as 4 distinct things I guess that all have different reasons for mattering:

  • about the start position and state of each new bullet
  • knowing about the "results" of the bullet hitting something, knowing about the visuals of where bullets that hit things that don't matter (perhaps bullets that miss damaging something are not as important as ones that hit players)
  • bullets hitting players that or damaging them (does it matter to know about that in each individual case or just the results?)
  • about the state of the bullet "in flight" (can something stop them? can they change direction or state?)

hot takes:

  • if there are A LOT of bullets firing very quickly it might no longer be reasonable to send each one as an invidual "event" of something firing. in that case a "burst counter" is definitely kinda mandatory and should work fine even for slower things imo

  • sending like an rpc per fire event is going to sound weird on clients as the timing of the audio (and maybe visuals) should just be done locally imo as you really just can't rely on rpcs to happen at a certain rate
    as you can tell there is a trend here of more bullets = being better to fake by running visuals locally for multiple reasons. Nobody will notice you firing 2 more bullets from a 40 round magazine I think

  • If bullets fire VERY slowly or are "important" to know the true location of it might be better to just have atomic information about the state of one bullet in time. This would mean you want a sort of singular "I fired this" and some kind of way to track that object with some id, index or separate object if it's really darn important to have it adjusted in realtime

  • if you onrep the positions of the bullet moving through space you are in for a difficult time to basically smooth the position of each frame. It would need a timestamp or frame index from the server to make it not basically vibes based when this arrives or you could just have it be "close enough" and only change the local fake one when it diverges a large amount

Locally simming the in-flight bullets and only having the result of them hitting things that matter be the result of replication on those objects seems simple to me and is what I think many games do

Also I think not having it on the weapon itself is not a bad idea... you do not want to be still firing a weapon you swapped away from. One advantage of this though is that sending it to that weapon means the weapon can derive the firing info based off of what kind of weapon it is I guess.
Arguably the client could just locally go "actually I don't care" about the incoming firing info OR the item swap could just wait until firing is finished but the more separate replicating objects and properties you have to more timing can be offset from one another and things will overlap in weird times.

nova wasp
bright summit
nova wasp
#

Also I guess sending when the bullet fires and having it sim locally will of course depend on a few things about how you derive it locally. For example sending just the "the character fired now" will make it rely on the character's local view rotation on each client which will make the result wildly different but could be totally fine if generally speaking you can't rotate quickly

Sim proxy rotation is often smoothed out over time to not look weird (but arguably the smoothed result and the most recent rotation can be separate values)

#

however if you always use the most recent value and then have them fire the gun while turning you will see a sort of "wagon wheel" of rounds going in directions where the rotation stayed the same over N frames until the next onrep of the view rotation

#

Also if it helps being able to "buffer" the results of this information locally will let you get away with a LOT of smoothness that would otherwise be difficult. For example if you know the bullet went from

A ---------> B

from the server over the course of a 10th of a second or something you could just visualize interpolating between those two states with hermite interpolation

The disadvantage is that the client must know about and both these states which can only be known after both have happened, which adds inherent delay to what they see

#

extrapolating afterwards based on the most recent info and simming locally is possible too when you don't get new info, this is basically 90% of how cmc sim proxies work

crisp shard
# nova wasp <@769234399367397386> I think my general reasoning about how to make this work ...

reading through everything and the "burst counter" doc as well (which seems to be the move for sure already).

to respond in order to your messages above as well:

  • subsystem was meant to be solely for bullet pooling, i didn't know it was essentially a black box that i can't really interact with it's internal states easily (i can send events, etc, but not in a way that im used to), and i like the idea of handling things via a char component but yea what to choose depneds on your later questions
  • definitely agree that i am not trying to replicate anything unnecessarily or make anything more complex, in fact was trying to do the opposite
  • was mainly thinking of the interface only because i knew i could then at least have the relevnacy of the character that fired so that it would replicate like any other character replication var would and be relevant accordingly, but again only thought of that as it was the only method i could conjure to get out of the subsystem and back into a class that i know of

some things to mention about my chars and how much i care about x,y,z etc.

  • characters are 2d sprites, so rotations are going to be wonky no matter what (in other words, i am not a stickler for something being "off" lokking when it comes to the characters)
  • i want to have an accurate "hit" event regardless of it hitting a damagable actor (and when i hit anything damagable, thats actually handled in the actor / player that gets damage, so i dont really need to do anything hitfx related from the bullet itself, although, i did have both prior (standard hitfx + bloodvfx/damage vfx)
  • not sure what would count for alot of bullets, but it's not a call of duty game, so i dont imagine THAT many bullets at once, most guns are single shot, like sniper (and it has a cooldown), but most dont have cooldowns
  • doing the firing locally (per your one message) would be ideal to me, i just dont know how i'd trigger it with the current appraoch

running out of room so hold up

nova wasp
#

I guess a rough idea of the per second amount of bullets in the worst case would help

crisp shard
nova wasp
#

the pool here is not really important for networking, we don't need to care about the memory representation or how these tick when simmed locally for the networking part... it could be the actors asking the subsystem for a new pooled object whenever they need one or whatever

#

you can have an onrep of an integer spawn a whole new actor, it doesn't mean the object that has the onrep has to implement what the actor does

crisp shard
# nova wasp <@769234399367397386> I think my general reasoning about how to make this work ...

the "locally simming" is most likely what i want to do, just not sure how i'd do that with the curretn approch.

and yea i didn't want to do the callback/logic on the weapon as you could possibly dequip the weapon while bullet is mid flight, and that would case an issue postnetially, so i did think to just opt to use the character itself for handling any callback type events like a hit event for visuals (where i could safely multicast or handle damage)

#

accuracy, despite me wanting to have the bullets line up, is more about making sure the visual of the shot impact is directly happening when damage would happen, getting a proper tracer to follow the bullet is extra, but it was something i had working , but is was significnatly easier to setup, given it was an actor and i could attach a thing right to it

nova wasp
#

the collision is just... a scene query from where it was to where it is going (or is now)

#

if it helps there are many games that are co-op that simulate damage locally

#

for example Destiny and souls games

#

so you can arguably get away with damage for the local player being on their client (if you don't care about potential cheating here)

#

that way there is no desync ever with the visauls of the bullet hitting them and doing something

#

or being simple to dodge even at high latency

crisp shard
#

well i'd still want server auth damage, i only really am prediciting the shot / impact / vfx

nova wasp
#

how fast do these move

crisp shard
#

it does look a bit strange when you hit a palyer at mega lag, as you'll get a hit effect, THEN get the damage hit effect

nova wasp
#

so is this a pvp game or not

#

I missed that

crisp shard
#

maybe less

crisp shard
nova wasp
crisp shard
#

so all my visuals and damage i need to rethink on how to communicate from that subsystem out

#

that's really the big problem / confusion im having

#

which is where the interface or delegate idea came up

#

delegate was bad tho, as it's a subsystem, so everyone is going to get that event, which i dont want

dark edge
nova wasp
#

once again not sure I see the reason the subsystem or interface is important here, you can put this in a static array for all it matters as long as unreal replication is on a replicating property

dark edge
#

or just run them locally everywhere

nova wasp
#

multicasting for hits here also has multiple purposes... to tell the users that damage happened to them or others and visuals
those can be separate things with different reliability as needed (and you can just send multiple hit events in a buffer at once if needed)

crisp shard
dark edge
nova wasp
#

yeah, that would work

#

in that sense the subsystem is just a simple way to talk to a manager actor or a specific actor for an area... I don't think it is useful to replicate a subsystem here

nova wasp
crisp shard
dark edge
#

starting with the subsystem is great because its lifetime is tied to the world, so it can spawn an actor to replicate through that shares that same lifetime, just all automagic

crisp shard
nova wasp
#

it being on character or a per-character weapon manager component thing is nice because it means relevancy Just Works™

dark edge
crisp shard
dark edge
#

a sniper shooting across a valley might not be relevent but their bullet hitting next to your head sure would be

#

I just replicate it all, my maps are huge but ranges are long so there's not much saved in not replicating

crisp shard
#

ok real quick, from the subsystem, how would i communicate to the character? (without an interface or delegate)

crisp shard
crisp shard
nova wasp
#

yeah I'm super confused as to why we need a subsystem at all here

crisp shard
#

the subsystem is for pooling bullet's that all it is

#

it's an object pool

dark edge
#

should be just an array of data structs but sure yeah

nova wasp
#

then have the things that actually create the LOCALLY SIMMED bullets talk to the subsystem... it doesn't matter

dark edge
#

do you have a projectile problem that this is solving? how many bullets in flight are you expecting?

crisp shard
crisp shard
crisp shard
nova wasp
#

given the speed of the bullets being more than 3x the speed of sound if what they said earlier is accurate the lifetime of a bullet in-flight will be very short unless we are shooting real damn far away

crisp shard
#

i feel like i should share the code exactly as it is, so we understand what's happening

crisp shard
nova wasp
#

no that's honestly... pretty realistic real life bullet speed

crisp shard
nova wasp
#

not trying to make it sound funny there, you can make them whatever speed you want

crisp shard
#

lmao no i got you, i thought it was funny tho, cuase thinking of it as 3x the speed of sound is hilarious

dark edge
#

Subsystem:
TArray<FProjectileStruct> Projectiles

FireProjectile(FProjectileInitialState InitialState) -> Projectiles.Add(InitialState)
Tick(float deltatime) -> for each Projectile in Projectiles-> update -> process hits

nova wasp
#

but them being very slow would mean we have a longer lifespan for each thingy, which would mean the total number of active things would increase drastically from people firing at things and the bullets taking a bit to finish hitting something

#

honest these are so damn fast that close-range you don't even need to simulate a separate thing

#

they would hit in the same frame at most server refresh rates

dark edge
#

The nice thing about this approach is that it devolves into hitscan if a proj is fast enough

#

same path

nova wasp
#

but a ticking manager is still a good idea as you can get fancy and do all traces in parallel :U

dark edge
#

just lives for one tick

nova wasp
#

yep, it's just resolved after the tick and that's it

#

generally speaking you will want to handle firing before the array is ticked though

#

that way results are immediate (in a frame sense)

crisp shard
dark edge
nova wasp
#

it would happen as the result of a scene query hit result hitting something

#

depending on what it hit you can do whatever

dark edge
#

I just handle hits locally, only actually applying damage for the server's view tho

nova wasp
#

it could be the person firing gets info, the thing hit, whatever

#

and yeah given this speed

#

I think players wont really be dodging bullets touhou style

dark edge
#

My project has up to like 5 second flight times so makes a bit more sense here

crisp shard
dark edge
nova wasp
#

you will want the visual hits to happen relative to the players though! so you probably want a "damage vfx" send about the hit result on a character

for example you hit the head, you don't want to have it just pop out of existence anywhere... you want vfx coming out of their head locally based on it really saying I hit the head bone

dark edge
#

I don't have prediction so it's a lot simpler, shouldn't be much divergance at all

nova wasp
#

it will desync by nature if they are moving quickly as animations and their character pos are generally locally smoothed but it's better than not seeing the vfx on the real bone imo

#

it's possible when you play the game in turbo slow motion or watch a replay that things will look slightly off but imo it wont matter

dark edge
crisp shard
dark edge
crisp shard
# nova wasp it's possible when you play the game in turbo slow motion or watch a replay that...

yea things looking slightly off is fine, i think my issue was considering how to communicate out of the system i have, as i just want to be able to do the logic i want, but have the subsystem just handle the bullet pooling and "spawning" of bullets, as well as handlin the hit of course, which would need to fire a hit event of some sort to somewhere/someone, wethere i direcdtly do damage or i do an event where i take the hit result and then do damage

dark edge
#

everyone is in the future on their own screens and sees everyone else in the past

crisp shard
nova wasp
#

hits on the ground don't matter much and can just be locally simmed

the server seeing something got hit damages that thing, and the result of the hit is sent as their hp changing and a cue or whatever...

it might be wise for locally simmed bullets that hit players to not make bloof vfx or even pass through them and only "true" authority hits be what makes blood vfx for sim proxy -> on sim proxy

you can have the local player predict damage vfx and verify it but this risks frustration if you reject a lot

dark edge
#

for an FPS I'd actually do clientside hit detection with server OK'ing it

nova wasp
#

and to be clear

dark edge
#

"I hit that guy at this location at this time"
"Aight bet, lemme check"
"Hey everyone, yeah he hit"

nova wasp
#

you DO NOT need to go crazy and have the server simuate the entire pair of bone animations... you can literally just compare if the two positions can be traced between against static objects and that both players were roughly in the area at the time

#

which is what I would do, you don't need to be valorant lol

crisp shard
crisp shard
nova wasp
#

having "fancy" verification of hits that go back in time and rewind is complcated and involves ALL game state being rollbackable and that is something that is a lot more complicated than 2 fvectors lol

crisp shard
#

i just want it to do what i had doing really, and if the new method means i cannot do the tracer like effect (bullet trail) as accurate, then that's fine, i mean i could even just sim the niagara effect with the same math as the bullet via the NDC, which seemss totes fine in my head

nova wasp
#

accuracy for what part?

crisp shard
crisp shard
# nova wasp accuracy for what part?

accurate as it, where the bullet is, but it doesn't need to be exact exact, i just would like the trace to be like the actual trace , so that you can kinda see where the bullet came from

dark edge
# crisp shard i just want it to do what i had doing really, and if the new method means i cann...

So sorta on this topic, any thoughts on how to replicate my 1D physics system? It's architected like this for reasons:

BaseDeviceSubsystem
DeviceASubsystem
TArray<DeviceAModel>
DeviceZSubsystem
TArray<DeviceZModel>

There are many of these. Right now I'm thinking of making a replication proxy actor per device type A - Z, but curious if there's any thoughts on a simpler way to do it.
I don't need to replicate much state at all. For example, for a regular car drivetrain and controls, the only state I'd want to replicate would be the control state (throttle, brake, steer, aim direction), the current gear (since it's discrete), and that's it. The final physics state (position and velocity) is handled through physics replication. The entire sim runs on all machines, but as long as the inputs, outputs, and discrete intermediate states are replicated, it'll converge to being in sync.

nova wasp
#

for starters what is a device's state stored as?

dark edge
#

There's lots of intermediate state like the steering angle, current engine rpm, driveshaft rpm, etc, but that is all stable and derived from the inputs and outputs.

nova wasp
#

ideally the replicated state is a reflected type like a ustruct

#

so there's no need to have 2 separate bodge things that have to be changed every time you add a float

dark edge
#

each subsystem handles all of a device type in the world.

#

kinda like a half-assed ECS

crisp shard
dark edge
#

If a vehicle is made up of all continuous state things, not discrete, then replicating the inputs and outputs would be enough.

#

it's the discrete state that gets tricky

nova wasp
#

what does do the to the simulation that is different than the client's version

is the result differnet or the entire state?

dark edge
#

By discrete state I mean things like whether or not a gun fired or a gearbox shifted, those are driven by continuous state (control signals), so there's situations where the gun could have fired or gear shifted on server but not on client, even if they are all running the same sim

#

It's like analog electronics sorta

crisp shard
nova wasp
#

a character is a lot less complicated than an arbitrary chain of thingies here imo

#

but the idea is similar

crisp shard
#

yea and pretty sure it's based ocmpletely on mover if remember correctly

dark edge
#

The final movement isn't the problem, I got that synced up fine

#

it's just a bit funny when your car is stuck in 2nd on your screen but driving like it's in 3rd because it IS on the server

nova wasp
#

it depends to me on why the simulation of the gearbox would diverge

dark edge
#

if signal > theshold

nova wasp
#

is the signal based on local input of the player

#

or it interacting with the world outside of it

dark edge
#

replicated input but yeah, not necessarily per player, it's all just a web of stuff

#

could be 2 players inputs added together, could be the result of a rangefinder, could be anything

#

Could have 10 players on one vehicle all "voting" on the steering angle, anything goes

crisp shard
dark edge
nova wasp
#

that would add inherent round trip delay to all results of the local state

dark edge
#

Nothing is predicted so everything has that delay

#

fine for giant contraptions

nova wasp
#

oh, it's all entirely auth based? okay

dark edge
#

yeah all auth

#

Replicated inputs -> Big web of stuff -> Replicated final movement

nova wasp
#

in that case it seems like the client needs to know only about

  • the shape of the system and its parameters (which likely do not change often)
  • the input from things outside the system
  • the result in basic terms which you already have of course
dark edge
#

I want to opt in SOME of the big web of stuff to be synced

#

since some of it is sensitive. Say the shift signal only made it to 0.99 on my screen but 1.01 on the server

#

server would shift, my view would not. I need to sync that

nova wasp
#

what refresh rate is required to reach that intermediate state accurately on all sides

#

if this is not a fixed ticking simulation it is entirely vibes based

dark edge
#

Dunno, could be anything.

#

Someone coulda made a looping oscillator that adds to their inputs to make the vehicle nice and random, no clue

nova wasp
#

I can see why players need accurate info about the system to reason about wtf happened

dark edge
#

It's like analog Redstone

nova wasp
#

but I wonder if they need 1:1 accurate info or if they only need some info

halcyon ore
#

Quick curiosity check, while unable to be at my PC.

Does Fast Array delta stuff work with by default with others structs inside the entry?
Or, can it not correctly delta structs?

Like can I just stick my already made struct in it, or do I need to do some cursed conversion between Fast Array struct, and normal struct?

crisp shard
nova wasp
dark edge
#

I'm trying to figure out how to just hard sync certain properties. I could probably make a net manager actor per subsystem that needs it.

halcyon ore
#

Ohhhh
It’s the array elements being delta’d
I always thought it was individual vars inside of it.

nova wasp
#

regular tarray replication always sends the entire array (which is fine for small things)

#

In iris this is not true anymore (thank god lol) but you still don't get the convenient per-element callbacks without a fast array

nova wasp
#

that way for example if it peaked at 1.0001 you send that range and what it returned to after a split second

dark edge
#

That's what I'm wondering

nova wasp
#

it depends to me on how inspecting these values works locally

dark edge
#

If this was actors I'd just have that integer be replicated and call it a day

nova wasp
#

no, that will not work here

dark edge
#

No i mean if everything was actors

nova wasp
#

regular property replication = you WILL miss intermediate positions of a state that changes over time

#

property replication is about the latest state being eventually the same value, it does not send in-between values at 100fps

dark edge
#

That's fine for the current gear

#

I'm not talking about replicating the gearboxes inputs

#

I'm talkign about replicating the integer Gear

#
USTRUCT(BlueprintType)
struct FSLMDeviceModelGearbox
{
    GENERATED_BODY()

    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SLMechatronics")
    int32 NumForwardGears = 5;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SLMechatronics")
    int32 NumReverseGears = 1;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SLMechatronics")
    int32 CurrentGear = 0;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SLMechatronics")
    float FirstGearRatio = 5.0;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SLMechatronics")
    float RatioBetweenGears = 1.3;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SLMechatronics")
    float GearSpreadExponent = 1.0;
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SLMechatronics")
    float GearRatio = 0.0;
    UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "SLMechatronics")
    int32 Index_Rotation_Input = -1;
    UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "SLMechatronics")
    int32 Index_Rotation_Output = -1;
    UPROPERTY(VisibleInstanceOnly, BlueprintReadOnly, Category = "SLMechatronics")
    int32 Index_Signal_Shift = -1;

    float LastSignalValue = 0.0;
    bool bChangedGear;
    FSLMEvent OnChangedGear;
};
nova wasp
#

I guess what I am saying is you must send a tiny replay of how these changed if you can't simulate it locally and you need accuracy of what actually happened

dark edge
nova wasp
#

if it's detereministic and you have the full state of the system and each input you could just tick it and see the result separately from the visual

dark edge
#

I've thought about trying to make it deterministic but I don't think so

#

since physics feeds back into it

nova wasp
#

it's honestly not as hard as it sounds if you don't need perfection

#

and you have full control of all inputs

dark edge
#

the net result of the entire sim depends on things as subtle as the load on a tire

nova wasp
#

yes, not saying that isn't true

#

but it if you simulate the system putting load on the tire locally and its the same input world state as the server it would be good enough
for example the result of the rangefinder is input into the simulation that can be a single signal into the graph, the REASON it went off can happen later and be told as history

#

this is kinda complicated to reason about but generally speaking only things that react to the world around them here are inputs into the system, whichever one is more expensive to send could change how this works

  • a wheel hitting the ground as a hitresult might be relatively large information as a double vector that would lose precision when quantized (and probably still be okay)
  • but the INTERACTION it sends up the graph could be relatively smaller float vector in local space so to speak
#

so each frame the graph has inputs sent into it from the world, you already made that work

#

this is honestly something that might start to get out of hand quickly but it would be quite simple to have a copy of the vehicle system that serves as the "scractchpad" of a locally simmed version with a buffer of true inputs + how long each frame took (ideally fixed but idk what the authority is here)

#

with actors this would be tedious as hell but you kind of skipped the hard part by making these a simple system with inputs and data

nova wasp
dark edge
#

Say you had:
Rangefinder -> trigger (input < 10,000) -> weapon

#

if RangeFinder outputs a 9000, trigger outputs a 1.0, weapon fires

#

Now of course weapon isn't a great example since the weapon itself can be replicated, doesn't make sense to have a weapon without an actor

nova wasp
#

okay, that means that for starters we are seeing 32 bits of information per input
but if the CONDITION of (input < 10,000) is unchanging or already known
we don't need to know anything but if the condition is true or false

#

obviously seeing the rangefinder in-context reading world data is useful to the user

#

but for the simulation result it might ultimately be something that is compressed down to the sort of true or false

dark edge
#

ok let's say it's something wihtout a world context.
It's a power network sim for a city builder, and you have a power-triggered switch. If too much power flows through it, it shuts off like a circuit breaker.
None of this is actors.
Assuming the inputs (the power plant state) and outputs (whos lights are on) are replicated in some way, you'd still want to know a bit of the internal state of the network since the switch is a discrete state.

nova wasp
#

but either way the number of inputs might be small enough this kind of compression is not useful

nova wasp
dark edge
#

almost all discrete state needs to be known in detail since otherwise the results will just keep being wrong

#

instead of being temporarily wrong

nova wasp
#

then you must send a buffer of discrete states to the users or derive it locally based on a buffer of inputs and resim

#

for example they might never need to see the graph of power usage until reading a power meter

#

how to send a buffer of states is something I am not certain about but a fast array is ome simple way to get "good enough" results very quickly if the total size of the buffer or individual slements are not huge

dark edge
#

Say I had a:
FStruct:
float A
float B
float C (replicated)
float D
float Z

#

and I had a fastarray of these

#

in an actor

#

would I just automagically get C replicated but the rest able to do whatever?

nova wasp
#

it would only send float C while serializing, also you would have to mark the non-replicating structs as not replicating as a ustruct but you probably know that

#

for example

ustruct:
    UPROPERTY(NotReplicated)
    float B;
    UPROPERTY()
    float C;
    UPROPERTY(NotReplicated)
    float D;
#

however in some stupid situations these NotReplicated values will be zero'd like polymorphic struct serializers (because fuck you and GAS works that way with effect contexts) every time a replicated value arrives (only relevant when sending gameplay effect contexts or polymorphic struct serializers iirc)

#

but typical struct serialization will leave them alone afaik

dark edge
#

I might try moving the guts over to actors, just managed by a subsystem.

#

in the BP API I just need AddModel and RemoveModel and MakeConnection

nova wasp
#

actors here are only useful as a place rpcs and replicated properties go, the definitions for the structures and what happens on them can be done anywhere except for marking properties dirty easily and defining rpcs etc

dark edge
#

Yeah It'd just be for my sanity, I already have 2 classes and 2 structs per device type, and over 30 device types once I'm done

nova wasp
#

also you can get really insane with how you serialize the state as a buffer and could easily make a simple serialization scheme that sends deltas per state as an atomic thing so for example going from 1.0 -> 1.0 is cheap
will require actually making serilization though generally speaking

dark edge
#

Can a subsystem enumerate all subclasses of an actor and spawn exactly one of each?

nova wasp
#

in my case I send a buffer of inputs as a
InputStateDesc
{
Input
int32 NumAfterThatAreIdentical
}
TArray<InputStateDesc> Inputs
which requires 0 custom serializers and means sending copies just means incrementing the NumAfterThatAreIdentical

dark edge
#

The whole reason I reached for subsystems to begin with is for the automagic discovery, making a new device type is just a copy paste of a file and changing the guts out

nova wasp
#

I feel like each seprate system being an actor with owned properties seems okay here

dark edge
# nova wasp sure? why does it need to?

So MechatronicsSubsystem can spawn an actor per device type instead of me making a subsystem per device type.
Then I can get the sim logic and data storage and replication all in one spot.

nova wasp
#

and what I mean by SYSTEM is the GRAPH OF CONNECTED STATES

dark edge
#

oh i got that too

#

lol

nova wasp
#

how to make each distinct one do different things without a uproperty knowing about them as a type is going to mean some fancy stuff

dark edge
#

I haven't even mentioned domains

nova wasp
#

but honestly if you don't need perfection one fast way to make this work is replicating finstancedstructs

  • this is relatively expensive when CHANGING them because it means you have to send the entire struct type each time + the data (oof)
  • but it might be faster to set up and might be dwarfed rather quickly by the system state
#

but yeah honestly I wonder

dark edge
#

This whole thing would be so much easier if using objects scattered all over the goddamn place wasn't so slow

#

grrr cache

nova wasp
#

also for example the "elecritity meter graph" example does not need a unique actor property
you could have a generic UPROPERTY that serves a buffer of graph states and that could be... anything!
it could change to represent fuel on a fuel tank you look at just from an enum changing

#

remember that the thing you are replicating in a unique way are shapes of things, if the shape never changes neither does the way they replicate need to change

#

I would say just do transforms 100% by hand though, don't try to make that generic lol

#

because it is too important

#

but you already have that

dark edge
#

Yeah I hadn't thought of fuel or battery. I got it implemented but yes that is one continuous state that'd have to be replicated. At a lower frequency of course.

#

since that could diverge and stay diverged for a long time.

nova wasp
#

the state you need to see in third person and the state you need to see when staring at the UI of the car dashboard are distinct things

#

imo

dark edge
#

There's bits of state visible all over. Engine audio, shafts turning, audio everywhere.

nova wasp
#

which is not to disagree with what you just said, just trying to make what I am saying clear

#

the audio being here is kinda oof because that being desynced will be weird visually and that will be immediately obvious to viewers

dark edge
#

I'm pretty certain the client needs all state all the time, it's just a matter of how synced it needs to be or not. Engine RPM doesnt make sense to sync as it can't stay diverged for long and is very transient, it changes all the time.

nova wasp
#

the dashboard showing a graph of fuel chaning 200ms late is 100% fine but hearing a bonk 200ms later is awful

dark edge
#

That's why the approach is to run everything everywhere and just hard sync the things that can diverge

dark edge
nova wasp
#

yes, which is something that should never diverge that far to matter visually

#

you would already have 100 new "results" of the full picture by then

#

it taking .1 second to start sputtering would not matter unless it was constantly flip flopping and never really happening

#

IMO the most simple way to have dual simulation with authority I have seen is to have predicted state and "true" state and only do server input based playback or authority on one of them at a time

#

for example Spelunky 2 has 2 game sims

  • the one the user sees and does input and sim in in predictively
  • the "true" one that is in the background and does only verified inputs and is 100% perfect, which serves as the authority to return to when things diverge
#

in your case add on top that you send the final results to the "true" one as well as input

#

this is nice because it means that you don't have to rollback everything but only the presented state to the "true" state when divergeance occurs

#

but this is a bit reliant on being able to sim the whole game quickly at the same hz as the server did

dark edge
#

Oh shit, this might be the play

nova wasp
#

okay nevermind then lol

#

idk if AInfo has a position that can work for prioritization

dark edge
#

no prioritization needed

#

whole sim runs everywhere, I can handle relevency in my own project via the actor's which hold components which register/deregister models.

#

replicated data for models which don't exist locally can just be ignored.

#

but for my own game there'll be no relevency, you can shoot all the way across the map so it won't save much

#

I'll cross the "model persists while component/actor comes and goes" later for the plugin. That'd be useful for stuff like a Satisfactory type thing

#

Haven't figured out a great way to do that yet, something with GUID will be the ticket I think

nova wasp
#

I feel like a static getter to get a manager actor is like the least of the issues here lol

dark edge
#

It's one of the reasons I was reaching for subsystems, if I can trim that out and get 2 birds stoned at once it'd be helpful

nova wasp
#

also just make the only place that spawns it actoriterator first and ensure if wrong where the real spawned one should have had a cached pointer... having 2 will entirely brick the game and should not be accepted

#

classic AI output I guess

dark edge
#

Yeah I'd never actually use its code, I didnt even know you could make static getters for actors, hadn't really thought about how GetGameState works under the hood.

nova wasp
#

if only place these can appear is from the subsystem lifecycle and nowhere else (which is true for AInfo as it is notplaceable etc)

nova wasp
#

honestly I think subsystems should just have a template for a static getter at this point too because I have written that function 20 times now

#

I guess I can make a simple one

dark edge
#

you can just get subsystems

#

in bp

nova wasp
#

yeah but it's wordy to go by the type

#

I am not talking about BP here I guess

dark edge
#

yeah I care about the BP api a little bit because I'd like this to be just as usable from some BP chucking models and connections into the sim and feeding it data and getting results

nova wasp
#

BP subsystem code I make tends to just be passing in a world ptr to a bp function library and that just silently getting the subsystem each time (which is not great but is okay for most)

nova wasp
dark edge
#

I went with the static getters so it's trivially extendable. Copy paste file, change names and properties and logic, and bam, new device system

nova wasp
#

the only thing each model and connection should care about is probably the input and state unless it needs world context for qeuries like traces

#

but I might be misunderstanding what they can and can't do

#

of course you want to be able to debug print in the world etc easily

dark edge
#

Depends on the device, some are simple and fully in the sim, some need world stuff

#

a tire doesn't mean much if it doesn't get and set world state

nova wasp
#

but if they can randomly get and create other new devices outside of input is not possible to control the consistency at all unless its an entirely safe way to obtain an external device's state that knows about the current frame or something

#

or its a separate uworld (oh god)

dark edge
#

This sim is like a parallel physics engine in another dimension

#

inputs and physics are how it interfaces with the world

nova wasp
#

so the bp runs in parallel as well or just sends inputs?

dark edge
#

Like say you wanted to make a standard vehicle.
You could add an engine component, gearbox component, cockpit component, 4 tire components, giving them all their intial setup.
Or, you could just add the models at begin play and have no components at all. You'd of course have to feed the tire models their external state (loading, contact point, contact normal) and feed your throttle and steer and shift inputs on tick, but from there it's in C++ land doing its thing.

You could do a raycast vehicle with 1 static mesh component and as complex a drivetrain as you wanted.

#

in my project I have individual actors per vehicle part since it's a lego style building game, but it's all the same mechanics under the hood. The only thing that changes is how the models get put in the system and how they are fed their input data.

#

You could use the same system to make a power network sim for a city builder, even if there's no actors at all when the city is out of sight. The sim exists in its own world and just interfaces with actors at the edge

#

Just like a physics engine. Just with more constraint (device) and particle (domain) types.

royal vault
#

Hi if I send too many reliable client rpcs, everything works, but I can no longer posesss players and it takes a while before im allowed to move again. Any ideas?

dark edge
#

What's in these RPCs?

latent heart
#

The engine starts dropping reliable rpcs if you send too many. Just don't.

nova wasp
#

too many reliable rpcs will force a client or server to send more and more data redundantly until it cannot any longer

latent heart
#

And the problem gets worse the less fps you have.

dark edge
#

Say I had a bunch of actors with arrays of properties, and I want to just spam those properties out to clients.
Is there a way to "batch" it so I just stream those or should each actor just do it itself?
I guess my question is more like, 1 actor with lots of data or many actors with a bit of data each?

hollow breach
#

i'm trying to create a procdural level loading system that loads a level instance at a 90 angle until it created a 4 quadrant level system

Server creates seed
Multicast loads level instances based on seed defined by server
All actors are already placed within the level.
All actors are replicated

End result:
Host actors all function properly
Remote actors don't move and don't replicate their information properly
This is ONLY the case with loaded level instanced, and works perfectly fine when all placed within a persistent level.

dark edge
#

I don't know any way to do this automagically, best I can think of is to replicate some state that drives the level instances and their transform data, then cruise the level serverside setting the actors to replicate.

#

What happens if you JUST spawn an instance on the server, does anything happen on client?

hollow breach
#

The only thing that I can think of is to create a system that will load the ground and static actors for server/remote, then load a level with the actors but ONLY on the server, then, have a system which stores the transforms of all of the actors.I have marked with a tag, delete those actors, then, spawn them again on server and have them replicate to the client

#

But that seems like such insane overkill

#

Like, there has to be a way for this to be simpler

halcyon ore
#

Did you turn off that net load on client, so the client doesn't attempt to make a client only copy in the spawned map?

hollow breach
#

Like on every actor?

halcyon ore
#

On the ones that need actual replication (NPC's, doors, etc)

#

No need to care about a wall or something.

hollow breach
#

I tried that with one of them, but they ended up never loading

halcyon ore
#

Damn.
I was hopeful. 😛

nova wasp
# dark edge Say I had a bunch of actors with arrays of properties, and I want to just spam t...

I honestly do not know because it feels like you have this idea of a giant global state that is going to get weird no matter what if segments appear one at a time

in my mind the ideal is you have an atomic packet that describes 1 isolated thing in entirety or at least a given area of the game

problem with having it be based on "manager actors" in cells is that while it seems simple at first I'm not sure how to handle data moving between them and arriving out of order (bake a frame number into it and just go from there?)

#

Some projects that REALLY need perfect full state send even just go the full "screw it, more data" and just have an http stream which is not nice but would basically work like downloading the state over time I guess

royal vault
# dark edge What's in these RPCs?

sending voxel chunk data. it only needs to happen once:

(Tick)



    UActorChannel* Channel = NetConnection ? NetConnection->FindActorChannelRef(this) : nullptr;
    if (!Channel) return;

    int32 SlicesSentThisTick = 0;
    
    while (Server_BytesSent < Server_TotalBytes
        && Channel->NumOutRec < (static_cast<float>(RELIABLE_BUFFER) / 2.0f)
        && SlicesSentThisTick < MAX_SLICES_PER_TICK)
    {
        const int32 Remaining = Server_TotalBytes - Server_BytesSent;
        const int32 SliceSize = FMath::Min(Server_MaxSliceSize, Remaining);

        TArray<uint8> Slice;
        Slice.Append(Server_SerializedChunkDataSaves.GetData() + Server_BytesSent, SliceSize);

        // Send slice via reliable RPC
        Client_ReceiveChunkSlice(Server_BytesSent, Server_TotalBytes, Slice);

        Server_BytesSent += SliceSize;
        ++SlicesSentThisTick;
    }

    // Finished streaming
    if (Server_BytesSent >= Server_TotalBytes)
    {
        Server_SerializedChunkDataSaves.Empty();
        Client_ChunkStreamFinished();
    }

#

im already preventing sending too many rpc's at once

#

and the client RPC's get through correctly w/o lag

#

its just afterwards when i spawn my player- the player doesnt get posessed and the client cant move. but the game isnt frozen its just i cant use the player.

until a little while later (the photo shows just stuck inside my player eyes)

#

if i remove any client RPC's the posession and gameplay work completely fine

#

the client rpcs are sent only once, gameplay is just broken AFTER they have already been processed, until some strange amount of time later

nova wasp
#

well

#

is the reliable rpc to possess being sent during this massive mega rpc send?

#

also may as well just zip this bytebuffer if it must be sent

#

also check output log here I guess

#

which I assume you have already done? anything in there?

royal vault
royal vault
royal vault
nova wasp
#

I think you are trying to ask the actor channel for the number of reliables but

#

this is not per-actor channel

#

this is per connection

#

also this code is going to not work when Iris is the default

#

actor channels do not exist in Iris

#

also arguably you could avoid needing to pray it doesn't overflow by just not sending more data until an ack is returned from the other side

royal vault
royal vault
nova wasp
#

looks like your code is very similar, yeah

#

do you modify the default unreal network rates at all?

#

I guess it kinda depends on if Connection->GetOutgoingBunches() gets more stuff added to it or not from other channels

#

I'm not really sure but you can just breakpoint it and see fairly quickly

nova wasp
#

there is technically a way to disable the network bandwidth limit in a scope

#

FScopedBandwidthLimitBypass in network prediction

#

why do they need this? because their input rpcs are huge I guess

#

it's really simple so you should probably just copy pasta it out

#

all it does is basically directly write the QueuedBits of the connection to be the same as it was before in the scope

halcyon ore
#

Still struggling a bit with this stupid FastArray shit...

So, I of course wanna handle the initial replication, manually.
But, how in the heck do I stop the initial replication, while still allowing replication after. 😛

My initial idea was to mess with the NetDeltaSerialize, but I can't figure out how to know if the Serialize is for the initial add, or from changes.

Or, am I going at this all wrong?
Cuz, I know someone suggested To use the rep condition, but that doesn't support multiple people (since rep condition targets everyone)

nova wasp
halcyon ore
#

Cuz, it'll explode the rep limit.
hence the need to override, and batch it

nova wasp
#

read the (my earlier message) message right above yours

halcyon ore
#

I tried that.
It lagged shit to hell and back for a couple seconds, with a super simple test.
(movemenet and shit was out of sync for like 5 seconds)

nova wasp
#

what's actually in this fast array

halcyon ore
#

My items, this shit we spoke about last.

nova wasp
#

have you profiled it?

#

what is the actual direct error log that is happening

#

network tracing tl:dr

#

-NetTrace=4 -tracehost=localhost -trace=net,default,task launch with with this and press insights, look at shiny graph and see what is in packets

halcyon ore
#

I haven't debugged enough for the actual error log.
But, 1 item is 50 bytes at the current moment.
Which for a basic item like that, is 1300 items.

Let alone any other planned modifiers, that aren't in that.

nova wasp
#

okay I am not sure I can help if looking at the output window is not possible

#

it is really important to have this in your editor open at all times when doing anything technical imo

#

or some other live log thing

halcyon ore
#

Not sure I follow?
I already know the profile info.
Do you want me to re-re profile right this moment?

nova wasp
#

an actual insights profile? that is 3 seconds to make if you launched with the right args (use the ones I posted above)

#

sure? it might be separating it out into multiple bunches though

#

you can show me the old one if you want

#

to be clear I mean Unreal Insights and not stat net

#

stat net is still convenient sometimes though

#

if network insights is being strange it might be you need to start and stop it and then press play in some weird versions, it's kinda fickle

halcyon ore
#

What eactly do you wanna see from it right now?
A pic of one of my item reps, or?

nova wasp
#

sure? I guess

#

and I guess what the actual problem is with replication being too much, I don't know what the problem is
is disconnecting people? check the output log

halcyon ore
#

I don't have an actual error yet, I just know i'm gonna have issues, repping a wall of data filled items in 1 network bunch by base UE

nova wasp
#

I guess you could delay it being relevant or something?

#

I'm not sure I follow the idea of guessing here when we don't need to

#

if it's too much data then you can try to split it off into sub objects or something

#

but I'm not sure if that will really help reduce bandwidth and will actually add some overhead for some parts

#

I've made a 1k+ element fast array once and it just kinda reduced the send rate on the end clients

#

so you may as well just try adding random crap and pressing play

halcyon ore
#

Ok.
I'll get on that, for solid info and insights.

nova wasp
#

also keep in mind in newer versions you can have clients join later than play

#

which can help figure out things from a new client showing up out of nowhere

halcyon ore
#

No, its no issue like that (right now at least)

halcyon ore
#

I realized I messed up my test.
I forgot to account for current, and max, my test only had current on it.

#

Ok, insights/ test results:
1 item - 788 bits
200 items - 129,031 bits
400 items - 257,231 bits
600 items - 385,396 bits
800 items - 513,631 bits (it started triggering bad ping, and ServerMove: TimeStamp expired: 20.660255, CurrentTimeStamp: 21.701906, Character: Player_Character_Female_BP_C_0

850 items - unknown bits (it triggered the Bunch size ensure)

Attempted to send bunch exceeding max allowed size. BunchSize=68228, MaximumSize=65536 Channel: [UActorChannel] Actor: Data_Tester_C /Game/ThirdPerson/Maps/UEDPIE_0_ThirdPersonMap.ThirdPersonMap:PersistentLevel.Data_Tester_C_5, Role: 3, RemoteRole: 1 [UChannel] ChIndex: 17, Closing: 0 [UNetConnection] RemoteAddr: 127.0.0.1:52873, Name: IpConnection_1, Driver: GameNetDriver IpNetDriver_0, IsServer: YES, PC: Controller_Player_BP_C_0, Owner: Controller_Player_BP_C_0, UniqueId: NULL:DESKTOP-M7EKB5K-5CFEED7248BFD81BBFABB69371097F8A

Data in test:
Class - item class
int64 - item ID
GamplayTag Array - 10 entries
int32 array - also 10 entries, that matches the gameplay tag length.

nova wasp
#

can we see a screenshot of 1 item in the sent packets

halcyon ore
#

The insights didn't split the values into there individual sizes (is it because its like 3 structs inside of itself?)
FastArray -> Fast Array entry -> custom struct.

nova wasp
#

oh, that's a partial bunch

#

does it show the true size right after?

#

instead you could just send 2/3 items or something that should not be forced to be a partial bunch

#

to just see 1 at a time

#

you could also show the writing half as well as that might not be all partials

halcyon ore
#

As in the server send you mean?

nova wasp
#

well okay

#

for starters what is the item id

#

a 64 bit integer that is unique to what? the kind of item? the instance?

#

what is the actual range of values this number can be in terms of min/max

halcyon ore
#

I wanted the item ID to be unique, no matter what happens.
and, one of my friends told me about discords snowflake ID system.
So, I basically made that.

Its 3 values stitched together.
Epoch time + hashed name + a counter that resets every couple seconds.

nova wasp
#

and just as I explained before you can see sending even small strings is brutal here and should be avoided if you plan on having many of these
2 duplicated (well not duplicated, you know what I mean) arrays of the same size is not wise as well as you are sending redundant information (the same size of n elements) but I am not sure having a nested array will ever really be nice here as this is not delta serialized

#

I have no clue if you can have fast arrays inside fast arrays or something but a gameplay tag container is fairly fancy in terms of serialization in comparison to a regular tarrat (just see its netserialize etc)

nova wasp
halcyon ore
#

I know you can't reasonably send 800 full sized 64's.
Thats why I don't wanna do that. lol

#

Hence my want to batch it.

Which so far I've only been able to do with my tedious ass manual methods.

UE doesn't seem very supportive of it. 😛

nova wasp
#

one thing I'm not sure about is

#

why does the client need to see 800 items at once ever

#

if you don't want to use reasonably sized network ids or avoid strings when sending stuff this might be better off being sent only like when they open a chest to look inside something

halcyon ore
#

That is when it’s sent.
It’s not always known.

nova wasp
#

as for stuff like having a larger piece of data represented by a smaller piece of data that gets resolved on both sides iris has built-in stuff for this but it's a bit advanced and idk if I can safely advise using it

#

it still requires sending the true full thing once at least

#

I'm personally not convinced you need to send 64 bits of data to the client for them to have a locally unique thing... if this is a "forever" thing then maybe keep that a server conceit

#

for example

#

32 bit item id that increments for each new item would not wrap around until it used 4 billion entries

#

and at lower values is already compressed down to a lower range

#

perhaps clients can go "give me full info about THIS item" and the server sends it back as the full "true giga id" or from transcations involving picking stuff up

halcyon ore
#

Yeah.
If I can’t get batching, then some stuff will need to change.
Just the original idea of everything was built around batching, and custom manual shit.
I only recently heard that you could potentially do batching with Fast Array deltas, which is what I was planning in doing now.
And, thus an item ID on the client doesn’t matter as much, since the FastArray should keep stuff in sync.

nova wasp
#

it's already batching it, just kinda outside of your control afaik

halcyon ore
#

If it’s batching then why do I hit a limit?
Isn’t the whole point of batching, to not hit the limit, by using it over multiple network events?

nova wasp
#

because there is a limit

#

it already must batch because it physically cannot send this as 1 packet

#

notice how none of your packets are larger than the mtu etc

#

we could be evil and just... raise that limit I guess

halcyon ore
#

Definitely not doing that.

nova wasp
#

there is also a hardcoded size limit to array replication that exceeding will just break things I guess

#

its hard to think of a game that sends me the full internal info of 8000 things at a time that isnt like an rts game

#

do you have to see all of them at once visually? are they like in a giant graph of items in a box or something

halcyon ore
#

There in different boxes, as put in by the player.
You only know of them when opening said box.
There is cases where you do just “know of items”, but at max it’s like 8 per player.
Cuz, seeing dyed armor and shit.

nova wasp
#

uh

#

can we just send that info instead

#

8 items per player would be no issue here with a fast array

#

why do you need to know of all 800 items in a box immediately

halcyon ore
#

I think you miss-understand.
You do only know of items you open the box of.
But, shooting the client with even 300 items, while an entire game is going on around you, seems a bit much.

nova wasp
#

yeah, so they should receive information about what they need to know to represent what they need to see

#

as for how to filter this out a bit I'm not sure how old net groups work but repgroup should be able to filter out the chest inventory pages or something on an object basis... I would seriously consider Iris here because this is starting to have problems that can only really be done easily with iris filters imo

#

I'm sure there's something I'm missing though

halcyon ore
#

And here I thought this would be a simple ass “return false after this if check, and profit” lol

nova wasp
#

I kinda wish there was a nicer hierarchichal way to send information here that would kind of grow in a simple way... for example a sort of lod of what to send based on significance

nova wasp
#

the server could kinda create these objects that are condition owner only or something I guess

#

more objects = bad news on old replication unless you are careful with not abusing polling (object polling is suffering for the server lol... always push model if possible)

halcyon ore
#

That was a thought.
But same overall issue. Client gets hit with 400 items in 1 hit.

I could TECHNICALLY make some like “paging” UI, rather then a scroll box, but that would feel so meh.

dark parcel
#

How does the client get hit with 400 items in 1 "hit"

nova wasp
#

yeah, of course but that would still need a way to send info atomically as some rpc per page request

#

a fast array of... a lot of 64 bit ids and strings

halcyon ore
nova wasp
#

there's not really a nice way to defer sending a fast array over time I'm aware of unless they directly bonk the actor channel is there

dark parcel
#

Why do you have 400 unique items in a box? Isn't that tedious and too much data for the client to process, limitation aside.

nova wasp
#

it is hard to think of a game that streams in this much info in 1 packet

#

for 1 object without splitting it up somehow

#

even just not sending strings and not using massive ID would reduce this heavily to begin with too imo

halcyon ore
nova wasp
#

I think one really quick and dirty way to have the "full info" come down would be to have it create or change a replicated object(s) for the local player that represents either

  • the stuff they want to see on the current page in a chest
  • the current item their mouse is hovering over or something
#

what is the actual information that must be known upon opening the chest

#

hovering items to see the name is not the same as looking at a wall of icons

halcyon ore
#

I mean.
I guess I could throw most of the info into the tooltip. 😛
it would’ve been nice and quicker to have it on the main item widget.
Cuz, then I would only need like quantity, class, and quality.

nova wasp
#

the tooltip can just be a replicated object or an rpc ack... is this string just for the tooltip?

#

quantity can be an insanely tiny number, the quality I don't know

#

of course you still need to know extra info about the item in some ways, so maybe the local player's inventory will have more info than the sort of "visual" replication

#

it's fine to go crazy there if they only have a few

halcyon ore
#

Feels like such annoying compromises for an overall easier dev experience for me.

nova wasp
#

okay, do the iris filtering setup then lol

halcyon ore
#

I might as well just do my custom/ manual shit.
Can’t trust iris at this rate. Lol

nova wasp
#

works for me :U

#

I am suggesting things because they seem simple to do and don't involve making heavy error-prone serialization code or engine changes but I don't know if waiting 100ms for knowing what at tooltip something is is somehow a non-starter

#

hell, you could literally locally cache the damn info for later and not re-request it if an ID didn't change

halcyon ore
#

Oh, I’m not denying your suggestions.
I’m more so annoyed that somehow nothing in UE has this (expect maybe iris, which I’ve never touched)

Surely someone would have run into needing to batch a lot of data.
Unless, maybe they did just rip apart the engine. (I’m trying not to do that, just trying all the suggested methods)

nova wasp
#

this engine is not made for mmos

#

or factory games or whatever

halcyon ore
#

Good thing it’s not an MMO

nova wasp
#

it's kind of pointless to say but generally speaking sim proxy info is lightweight visual info that is spatial so most of the engine is oriented around doing that

#

or things like "oh we, want to track this for owners but not non-owners" etc

#

or replays etc (not in iris though)

halcyon ore
#

This would probably be hellish simpler, if the stupid custom rep condition type. supported individual players, rather then affecting all players.
Cuz I could turn off rep, batch send items, turn on rep.

nova wasp
#

that's just praying it doesn't go above the buffer though in one frame

#

it's honestly surprising how awful it is to manage bandwidth on a per-thing basis even in iris though

#

weird oversite where the idea is to basically have priorities and then a 1d global buffer of send rate

#

there's not really a way I am aware of to have like a "budget" per-thing

#

I guess actor channel cheese could help though... honestly worth considering but it's a dead end if you plan to use future versions that might deprecate it

#

but that could be a loooong time in the future

halcyon ore
#

Apply damage ain’t removed yet. (Wasn’t that planned forever ago?)

Well.
As the last like 3 times. Thanks for the help/ suggestions.
I’ll need to mess with them tomorrow.

nova wasp
#

yeah I think it's fair to assume ye olden replication will be around for a while yet

#

I wish I had a fancy nicer answer to all this stuff but I have mainly dealt with networking stuff on a more individual realtime thingy bassis than huge buffers of potentially hierarchical things that need to be segmented... I hope someone reads my yapping and has some nicer ideas

#

would be worth looking around at other games and how they do inventory setups or things like gdc talks etc, even if it's not really simple to do in unreal there might be some inspiration

frosty harbor
#

this might be multiplayer related I'm not entirely sure but yea. I'm trying to make the animation stop the moment it detects a hit on a player by changing the playrate to 0, then reverting it after 0.1-0.2s. (I made it 10s to see what i was doing wrong in the screenshot). Essentially what action games call a "hit stop"

The issue is that I think this is not applying on the server at all and just on the owning client (local prediction) when in reality it should be applying on both. The reason why i think this way is that even though I put it to revert to the normal play rate only after 10s, it happens near instantly which makes me think that it's the server "correcting" the "stopped" animation by going past the local client's location & correcting the playrate.

Any idea what im doing wrong and how to improve this without making the GAS Ability replicate so I can use different rpcs inside it? (Which I think isn't what Epic games thinks is the right way to do things).

halcyon ore
meager spade
meager spade
frosty harbor
meager spade
#

yeah but you shouldnt need to do this

#

your animbp can handle this

frosty harbor
#

Hm

#

I assume you mean freeze pose when I flip a bool?

thin stratus
#

I mean, that's just the specifics of how you'd stop/pause/freeze the anim locally. Don't think that would resolve your issue, or?

frosty harbor
#

I haven't tested it yet but dont know if it will or not

thin stratus
#

Not sure why the server would do any corrections though. Montages aren't replicated by default.

frosty harbor
#

well i was assuming it was the server

#

maybe it isnt

#

but if it isnt then i have no clue why it doesnt work

thin stratus
#

Why assuming? Can't you print or breakpoint?

#

There might also be something about 0.0 playrate . Have you checked if there isn't just a Pause function instead?

frosty harbor
#

it really looks like its catching up its why I think it was hte server correcting

#

but ill do some more tests

frosty harbor
#

Pause function worked perfectly

#

playrate to 0 was causing it to skip ahead when resuming the playrate or something similar

nova wasp
meager spade
#

oh

#

like instanced structs?

nova wasp
#

that would help but it would mean extra data for all elements for the struct type

#

great for one-offs though

gentle mauve
#

Is it possible to change View Modes when playing as a Client in the editor? viewmode unlit does nothing

halcyon ore
nova wasp
#

but as we talked about earlier it's kinda arbitrary for some parts

royal vault
north jacinth
#

What would be the preferred pattern for handling interactions between pawns while using NPP?

grand kestrel
north jacinth
north jacinth
nova wasp
#

show how you obtain the ping

#

use GetPingInMilliseconds

#

the player state

#

which version is this on?

#

in the future if you are on a really old version do not leave that info out

#

is bShouldUpdateReplicatedPing on?

#

well, it's kinda a running average if you read the source as well

#

is the ping average being updated in PingBucketV2 on clients?

#

or is that only on the server

#

no clue then... I am just browsing the 4.27 source on github

#

I recall there being an option to have ping include frametime in some versions but idk if that applies to 4

#

that doesn't seem very bad to me especially if it's unreliable

#

it would be a trivially small rpc

#

you could arguably include it with (well,inside) another commonly sent rpc to save even more

#

I guess my assumption is this is an rpc to the server from the client to just update some replicated value that's separate

zealous wigeon
#

persistent static data: postgres (sql)
persistent dynamic data: scylla (cql)
warm memory: redis (faster than postgres/scylla queries)
hot memory: the server's ram (latency sensitive)

#

@slate phoenix ^

slate phoenix
north jacinth
thin stratus
#

You can send unreliable RPCs on Tick just fine.

haughty ingot
zealous wigeon
#

but the little bird whispered to me in my dreams that every actor should always receive every replication

thin stratus
north jacinth
iron swan
#

When I switch over to the server via RPC it seems a lot of my setup scripts for my vars and components haven't run on the server. I'm seeing invalid refs and triggering my invalid errors when I'm running within an RPC's impl (even when the var is replicated).
Is my understanding accurate?

#

This is within a PlayerController, for context

thin stratus
royal vault
#

Hi anyone know how to move a non-controlled character from a client?

context: controller moves character, which rides a mount. character forwards the movement to the mount- but movement-component doesnt know to use client-server movement.

crisp shard
#

uhhhhhh , i have two rep notifies (2 doors) in an actor and it seems that when a later joiner / non-relevant player gets in relevancy range, only 1 of these 2 variables get updated to the client. is this normal behavior?

silent valley
#

No

crisp shard
silent valley
#

Likely causes might be, modifying value on client, different rep conditions, etc

crisp shard
#

coudl the net update frequency have anythign to do with it? i have it set quite low in this case

silent valley
#

In my experience, when an actor becomes relevant, all the replicated variables are sent in the initial bunch. So idk what is happening for you. Best bet might be to add a c++ onrep and try and debug it as best you can.

crisp shard
nova wasp
crisp shard
nova wasp
#

this is more of a rhetorical question but the main takeaway here is that you should get used to manually calling things that onreps call to make sure they get called when you actually want them to (especially in C++ on the authority as otherwise nothing would call it)

silent valley
crisp shard
#

i may have discovered the issue as i typed this

#

my doors open via a timeline

#

it's possible that the timeline is only diring for 1

nova wasp
crisp shard
#

so it doesn't actually move the door

#

that has to be it

crisp shard
crisp shard
# crisp shard my doors open via a timeline

my assumption here is, the timeline can't be called twice at 1 time.. but still confungles me as the client can still walk through the door, so it's "opened" but visually, it's not moved

nova wasp
nova wasp
#

or maybe the outliner if is bieng cooperative in this case

#

If there's a nice "hey this was from relevancy and the actor has existed for a while actually on my end" I am not aware of it unless there's some timestamp I am unaware of

crisp shard
nova wasp
#

if you find it's like missing fast-changing values between true/false

crisp shard
#

i havent fully proved it yet, but im 95p sure it's from the timeline, which is slightly annoying to figure out how to accomodate, cause like you mentioned, it would be nice to be able to determine if the variable change is coming from the client instigating it in realtime, vs a late joiner/relevnacy thing, cause if the latter, id' just set the transform and ignore the timeline completely

#

the timeline is really just so it looks semi decent instead of just teleporting to the opened state

#

i could make 2 timelines... lol

nova wasp
#

it's arguably more data than you might want to represent something so simple but I would defend it as you aren't going to be opening 200 doors a frame

#

it can also be ground down to seconds etc and be VERY small

#

by this I mean you can replicate a timestamp for when the door last opened/changed etc

crisp shard
#

could i make a a seperate local bool that says if the doors are intialized on the client and if so , it can play the timeline, if not, just set them to whatever they need to be set at ? that might be similar approach to the timestamp

nova wasp
#

this way the client can track what the door actually did on their side visually separately and they don't need to rely on only the replicated value I guess

#

very common

#

the timestamp I guess is more if the idea of it being old or recent is meaningful (or even getting really fancy with accurate timing... you probably just want the most recent state here though) no matter what but if a local bool does what you want that's plenty

crisp shard
#

nice that was the issue, and the local bool did fix it

#

good to know, that multiple things being updated at once using the same timeline will only visually be repreneted by the last changed variable that uses it

#

could also maybe make this a bit cleaner by simply never doing the timeline call in the on rep at all, teleport the door on server via the onrep (set it's actual state immediately), and have a multicast do the anim , so that way, it always fires and updates the correct position, and doesn't have to worry about if it's intilizaed or not for clients, but will playt he anim if you have the relevancy to see it. only issue w that is you might have a colliison issue with opening/closing but my door anim is quite fast either way, so prob not an issue

nova wasp
#

one potential issue is the animation playing when it pops-in but this might not matter in practice

crisp shard
# nova wasp one potential issue is the animation playing when it pops-in but this might not ...

yea main concern was just making sure door's state is appears as it actually is, but i've opt'd to use the bool, and have a small delay on begin play to set it to true, giving time for the doors to update. would have been a bit more of a lift to change it w the multicast given my current setup and i have a lot of diffeetn buildings w diffeten setups and diffetne numbers of doors etc.

whole pollen
#

Hey guys I want to learn Multiplayer, keeping in mind that I am not new to unreal engine. can you guys suggest some good learning material on youtube or any other place?

#

Would appreciate your help

lament flax
#

check pins

whole pollen
#

Thanks man

crisp shard
slate phoenix
#

Hello everyone,
I’m developing a game, but I’m stuck at this point.

Players will be able to create their own worlds or visit other players’ worlds. There will be an ownership system for worlds, and the number of worlds will be limited. For example, a size like 20x20x20, though the exact dimensions are not very important for now.

Players will progress and farm in their own worlds. However, what confuses me is this:
If there is only one dedicated server, do I need to run each world as a separate server? How should I handle this?

I’ve been thinking and researching this for about three days, but I couldn’t find a clear answer. Is there anyone who can explain this topic to me?

It will be a dedicated server, not a P2P game.
It will be something like an MMO.

slate phoenix
#

By “separate server,” I mean this:

For example, the main server:
192.168.1.1:8888 (I’m just using a random IP and port as an example)

When Player A creates a world → 192.168.1.1:8889

When Player B creates a world → 192.168.1.1:8890

So, do I need to run a separate server instance for each world on the same IP but different ports?

#

How to

#

ue need different world ?

#

Whenever a different world is created, the corresponding level map should be opened and the player should connect to the server.
I created a system like this, but it sends the player back to the world creation or world selection screen.

#

If I use Open Level, it works, but in this case the level is opened locally.
The player can see the main server and connects to the backend API; everything works fine.

However, when a second player enters the same world, they cannot see each other.
Even so, the actions performed are correctly saved through the backend API.

slate phoenix
#

If there's an easier way to manage it, don't hesitate to share.

crisp shard
slate phoenix
slate phoenix
thin stratus
thin stratus
# slate phoenix Hello everyone, I’m developing a game, but I’m stuck at this point. Players wil...

To generally answer this.

If your game needs DedicatedServers, then you need one (Unreal Engine Game) DedicatedServer per player world. And that DedicatedServer can usually handle a maximum of 100 players (with a lot of optimizations) before it will struggle with performance (more realistic is something around 60-70).

Running multiple DedicatedServers on one CloudServer is possible but probably limited to a handful before the CloudServer has to be too powerful. So if you plan for 10.000 players, and you'd expect most players to be in their own world while some are visited by a 2-4 other players, then you would need quite a lot of DedicatedServers and CloudServers.

If your game doesn't need any DedicatedServers and can work with ListenServers, then I would go with that instead.

#

DedicatedServers on the same CloudServer would share the IP, but have an incrementing port (starting at 7777). Individual CloudServers have their own IP.

#

Players, no matter if its their own World or not, would need to connect to that IP:Port via open <ip:port>.

#

For ListenServers, the hosting player would need to use OpenLevel <MapName>?listen, while the joining one would need to connect to their IP:Port. That usually requires opened ports on the player's end, which most people get around by using Steam or similar for the Session Management. That then also comes with the benefit of being able to join those Sessions and not having to share IP addresses.

daring gorge
#

im using a replicated variable to set the rotation of a turret to sync w where the player is looking at through the anim BP but when i spawn projectile and muzzle flash it spawns at the initial position of the guns barrel rather than where it has been rotated to which ofcourse looks weird, im also unable to use GetSocketRotation and get where the socket is facing, it just shoots forward as if the gun never rotated to begin with, i know anim BP isnt replicated but isnt the turret being rotated on all clients since its using a replicated variable to do that and doesnt that mean the socket should face the same direction in all instances?

thin stratus
#

Are you spawning the effect locally, or is it replicated?

#

Because the one thing I could imagine is that you are using a SkeletalMesh for the Turret and you don't have the Visibility Based Tick Option (or whatever it is called) on the Component set to "Always Tick and Refresh Bones".

daring gorge
thin stratus
#

Which means if the Server isn't looking at it, it wouldn't update.

daring gorge
thin stratus
#

And the multicast has the spawn transform as a param?

daring gorge
#

yes

thin stratus
#

Yeah, then try what I wrote above.

daring gorge
thin stratus
#

That should also have it

#

You can also test this by just making sure the server is looking at the turret.

daring gorge
#

is it this

thin stratus
#

If that still fails to spawn it correctly, then not sure.

thin stratus
#

Maybe the socket isn't parented to the right bone?

daring gorge
#

i couldnt tell, ill try spawning w the server and looking at the turret once

#

basically the turret has a replicatedplayer variable which is replicated and the player has a Rotation variable that's replicated, the same used for the TPS aim offset and such, also used when player is driving vehicle, the same rotation is being taken and promoted to another variable in turret and the anim bp uses that to rotate, so it perfectly rotates on all clients as it should, the socket is also parented to the right bone

#

wait no it isnt

#

no way

#

wow, im really sorry this is so dumb it wasnt parented right

nova wasp
thin stratus
#

All good. Glad it was that easy :D

daring gorge
#

thanks guys

nova wasp
#

(I didnt do anything lol, I was just reading along)

daring gorge
#

also another question, how would you deal with high ping and input delays due to it? do you just do the local fx spawn and not care or are there buffers to handle this

#

i havent profiled my game but im worried about each shot being a seperate RPC and the listen server ping causing input delays

nova wasp
#

if it is slow enough to justify that (a rocket or something etc in unreal tournament)

#

fairly open-ended problem that can kinda depend a lot on the perspective and how important it is to not miss things

#

as a general rule of thumb it is important to understand that replication timing is entirely vibes base and will rarely look smooth when interpreted with no help to make it smoother

#

there are multiple built in-things for client prediction but they tend to not really be for this specific problem (GAS, cmc, network prediction/mover,newer chaos replication) as much as movement of physics bodies and characters

nova wasp
#

A weird tip about PIE network testing: you can actually have tickrates be different on different "machines" (well, PIE clients which are just ticked one after the other)

this is useful because you can see vastly different rpc/rep behaviour when you have a low vs higher tickrate on either side. Lower framerates will mean a longer time between consuming packets and producing them etc

#

So for example a client with a really bad framerate but decent internet might send the server a very sparse amount of inputs relative to one with a better framerate

#

Which is fine for many games but might cause jitter in others if they rely on a lot of info from that client etc

royal vault
daring gorge
slate phoenix
# thin stratus To generally answer this. If your game needs DedicatedServers, then you need on...

Let’s assume my game has 1000 concurrent players, and everyone can create their own world.
That means 1000 worlds.

1 world ≈ 400 MB RAM

Or if a world has 64 players ≈ 1.5 GB RAM

Because of this, the classic one world = one port / one Dedicated Server approach would consume too much RAM.

So I calculated a few scenarios:

Available RAM

Total RAM: 32 GB

Reserved for OS and other services: ~4 GB

Usable RAM: ~28 GB

Scenario 1 – Everyone plays alone

28 GB ÷ 30 MB (world + player)

≈ 900 players

Scenario 2 – Average 5 players per world

200 worlds × 50 MB = 10 GB

1000 players × 15 MB = 15 GB

Total ≈ 25 GB → ~1000 players ✅

Scenario 3 – Average 10 players per world

100 worlds × 100 MB = 10 GB

1000 players × 15 MB = 15 GB

Total ≈ 25 GB → ~1000 players ✅

The number of players in worlds will never be stable,
because players will constantly farm, trade, and visit other worlds.

Because of that, I’m considering a Single Server + World Manager architecture:

All worlds are handled inside a single server process

Actors are replicated only to relevant players

A Replication Filtering System is used to reduce unnecessary replication and RAM usage

I believe this approach will use significantly less RAM compared to running one Dedicated Server per world.

#

There may be 500 concurrent players, but the database can contain 2000 worlds.

Additionally, Listen Server is not an option.
The hosting player would be the server, and when that player disconnects, everything would be lost.
In other words, if the world owner leaves, all other players in that world would be disconnected as well.

Because of this, that approach is not viable.

dark parcel
#

but networking framework that comes with Unreal doesn't support multi world.

#

you were told this in the past.

#

A server can host a world and all client must connect to the same world.
Any world that client create will only exist on that specific machine and will not be known to server and other client.

#

The path of least resistance to have multi world is by using dedicated server to host each world.
A travel between world is simply joining a host with a specific map the player want to travel to.

thin stratus
#

As ColdSummer wrote, UE doesn't support multi word stuff and more than 60-100 players per UEServer isn't gonna run well. It's not even RAM related. The CPU is the bottleneck. And potentially even the bandwidth.

#

You do have a different definition of world I assume but it comes down to the same problem.

#

UEs Server setup is from a time where arena shooters were popular

#

Unreal tournament specifically

#

Meaning they are coded for short rounds with maybe 32 to 64 players max, and only the connected players see each other. 2 or more dedicated servers usually don't communicate with each other.

humble idol
thin stratus
#

Yeah. This basically needs a custom setup, probably without even using native dedicated servers and handling replication outside of UEs native code.

slate phoenix
# dark parcel but networking framework that comes with Unreal doesn't support multi world.

There will be no multiple level maps.
There will be only one level map, for example called M_World.

When a player creates a new world, the game will create that world using the M_World level as a template.
For example, Player A creates a world called “sohbet”, which is instantiated from M_World.

When Player B types and searches for the “sohbet” world, the database already contains that world, so the player can simply enter the world and visit it, because the world already exists.

For worlds that do not exist, the game will always use the M_World level to create a new one.

slate phoenix
thin stratus
#

And almost everyone here will take that meaning over whatever you might be talking about.

slate phoenix
lament flax
#

Seems like what you want is 1 dedicated server per player playing in his "world"

#

Which is insane

#

So yeah, lots of custom code and hardware setup to have it working

latent heart
#

Maybe you implement phasing like mmos do these days.

slate phoenix
# latent heart Even if it's a "template", standard UE is still gonna have each of those levels ...

Yes, I tried it, but it didn’t work.
Either I’ll have to run separate servers by assigning a different port for each opened level, or I’ll need to buy a plugin like this.
https://www.fab.com/tr/listings/006026b4-9a0b-4f44-a918-a02f7241e997
The 6-hour process went to waste 😄

Fab.com

MultiWorld is a runtime plugin to manage multiple independent UWorld instances simultaneously. You can run several worlds in parallel, each one with completely isolated actors and components (and so with independent graphics, audio, physics, collisions, UI, etc), with the option to transfer the player and other actors between the worlds.Trailer ...

dark parcel
#

read into the description, the secondary world doesn't support replication.

#

only the main world, so it's just business as usual in multiplayer context but client get to make their own world (which only exist on that specific client).

#

It's nice plugin to display pocket world like showing character or items to the local player.

slate phoenix
#

So how do I do it?

latent heart
dark parcel
#

do you have the technical expertise and time? Multiplayer that comes with UE doesn't really fit for a server to support minecraft games for many players or multiworld.

The most realistic approach and one where you don't need to build sky scrapper is by hosting dedicated server per world.

#

using AWS fleet and serverless API calls, you can pretty much have the server on cloud. Hosting one per request and destroy it when there are no player left in the world.

slate phoenix
#

you said WORLD_A → Server 1 (Port 7777)
WORLD_B → Server 2 (Port 7778)
WORLD_C → Server 3 (Port 7779)
Do ?