#multiplayer

1 messages Β· Page 675 of 1

slow pond
#

so as they move around

#

positions

#

but

#

the ones that are far away are less important

#

so they could be updated less

#

you are saying replicated TArrays don't have the same order?

#

it seems like they do in my tests

obsidian cargo
#

It's packet loss that causes out of order data

slow pond
#

i see

#

even if the data was out of order though

#

i'm not adding or removing elements

obsidian cargo
#

I've just been learning replication (as it relates to UE4) this past week, let me see if I can find where it says in the docs that order is not guaranteed

obsidian cargo
slow pond
#

ok

obsidian cargo
#

Line 149, 150 of NetSerialization.h, in regards to Fast TArray Replication The downside is that you will need to have game code mark items in the array as dirty, and well as the *order* of the list is not guaranteed to be identical between client and server in all cases.

#

It might only be FFastArraySerializer that does not guarantee the order

#

I've been cramming so much UE4 info the past couple months, I get a little confused on what I learned where or when.

slow pond
#

ok

#

it might not matter depending on how i do this

#

right now

#

if I create an array of 4000+ elements

#

the client explodes when the game starts

meager spade
#

@slow pond if you pack these items nicely

#

you can reduce the size

slow pond
#

for reasons I don't understand

meager spade
#

ie use FVector_NetQunatize

slow pond
#

yeah

meager spade
#

Quantize*

slow pond
#

I use that currently

meager spade
#

pack your bools

#

etc

#

only send data if its changed via a custom NetSerialize

slow pond
#

yeah

meager spade
#

then use FastArray and only mark elements that changed to only replicate them

#

during gameplay, initial replication will be the big hit

#

not really sure there is a brilliant solution for sending mass amounts of data

#

unless you do frame sliced RPC's

#

and do it based on priority (so units closer/more relevant get updates quicker)

slow pond
#

I might make a smaller array of like 500-1000 that lists the indices to update

#

that is the other choice

chrome bay
#

TArray order is preserved btw. But packet loss might mean that it takes a bit longer to match the server perfectly.

#

I.e. you might occasionally be in a state on the client that isn't the correct order, but it should resolve itself

winged badger
#

@slow pond why would you create a 4000 element array?

fiery badge
#

Hey!
First of all, I am familiar with Unreal Engine Single Player Game development, and I am new to multiplayer game development (Just started learning).
I am creating a mini shooting game for android where 4 to 5 players play together and shoot monsters.
I have completed the prototype on the pc and I am ready to test on android but don't know how to do it.
Can anyone tell me how to move forward from here,
The first thing I want to do is test it with my friends over the internet so that I have an idea of how it fills, what I need to improve, and stuff.

rare pulsar
#

Hi there, got a question. I have a 3d ui element showing the healthbar of a tower in my game. The tower replicates fine but the health on the bar dose not, how would i apply this to both clients

sinful tree
sinful tree
#

How are you feeding the health value into the widget?

rare pulsar
#

Via an event setting the percentage, ive tried running it as server

sinful tree
#

You can't really do it that way as widgets don't replicate. The health value should be replicated on the tower itself. The widget can be bound to it, or if you set the health variable as W/Notify you can use the OnRep function to update the widget.

rare pulsar
#

So instead of updating the percentage directly bind it to a float for example and update that float?

sinful tree
#

Yep.

rare pulsar
#

how would i access the value within the widget?

rare pulsar
sinful tree
#

Don't do it that way... It's not the proper way to notify clients of changes to state.
The tower itself has the health value. If you're changing the health value there, that's all that should be required.

You can do this on begin play of your tower, though you'd need to cast to your widget class, and put a reference object variable within the widget itself (I just left mine in this example as NewVar_0)

rare pulsar
#

like that and set the variable from there?

sinful tree
#

This should be the begin play of the tower.

rare pulsar
#

Ah can i then access its variables in the widget?

winged badger
#

You normally want the UI replaceable without altering the game logic.

#

As the UI gets thrown out and different designs get tested or improved

sinful tree
rare pulsar
sinful tree
#

^ then that would be the bind in the widget.

winged badger
#

You don't want to have to rewrite your entire game when you replace UI, so you inject refereces UI needs into UI and let it take care of itself from that point on

rare pulsar
#

Ah ok thanks for clearing that up

rare pulsar
#

Would i use that for any bits of hud that needs replicated i.e. Amount of points for the team?

prisma snow
#

Hi! I am researching the replication system, and I saw that we can set a determined tick rate for the network to send updates (by using NetUpdateFrequency and MinNetUpdateFrequency), I wanted to know if this tickrate is dependent on game framerate (FPS) or it is independent :)

marble gazelle
#

independent, you can render in higher tickrate than updating actual data

prisma snow
chrome bay
#

Network tick always happens at the end of the game tick

#

So replicated properties will still be checked at most at the framerate of the Server, for example.

#

NetUpdateFrequency is the maximum frequency that property will be checked at, assuming you reach a framerate higher than 100.

#

TL;DR networking updates are applied in lockstep with the game thread.

#

And you'll never achieve a stable frequency outside of editor anyway, so you shouldn't build any system dependant on that.

waxen umbra
#

What would be an appropriate or idiomatic way of sending the contents of a storage container to a client only when they open it?

#

Would I need to go via the player controller and tell it to update the container in question with a client call ?

chrome bay
#

Depends. You can separate the inventory of the container into it's own actor, and only make it relevant to players who are interacting with it.

waxen umbra
#

That sounds like an interesting approach

chrome bay
#

One actor to handle the physical/visual interaction but another for the content seems a good way to solve it to me

prisma snow
chrome bay
#

It's doable to an extent but not inherently

#

UE replication is "lossy" by design, so it's very hard to make lockstep really work.

#

And the game-level networking and game thread are interlocked

prisma snow
#

lossy means that we expect to loss packages?

chrome bay
#

yep

prisma snow
#

yes, I thought of that

#

it runs on UDP right?

chrome bay
#

Clients can easily get into states that never existed server-side for e.g. Clients can easily miss packets and never receive a given state etc.

#

All you are guaranteed to receive with replication is the eventual state, not all states leading up to it.

prisma snow
#

I see

#

The idea was to send commands (player inputs) instead of replicating certain costly/bandwidth intensive data such as unit positions, with a relatively low frequency.

#

As the inputs are very small, I read that some rts re-send the previous frame inputs (redundantly) so that if a packet is lost, we can reas from the next ones

chrome bay
#

Sending input only can really only work for fully deterministic lockstep sims

#

And Unreal is very much neither of those things.

#

So it will to some extent feel like pushing rope up a hill

prisma snow
#

However, we are aware of the limitations of UE4 in this sense, so probably we will either use the default replication if we manage to optimize it enough, or make a complete custom solution and use UE4 mostly for rendering.

#

We aimed to support roughly up to 3-4k units simultaneosly, which is quite a lot for standard replication

chrome bay
#

For something like that you'll almost certainly need something bespoke

prisma snow
#

In any case we will see, time to experiment a bit :)

slow pond
#

@winged badger To track positions for 4000 units that are not actors

crystal crag
#

I'm at a cross roads with how I want to design the coupling between my mission subsystem and the mission component that lives on the player controller. I'm starting to write it in such a way that the sub system calls methods on the mission component to push data such as accepted missions, their current status, etc.

#

But I am thinking maybe it would make more sense if I created a bridge like class (non-BP, not a UObject) that the mission component gets from the mission subsystem and then the bridge would fire off events. Basically I would be going the other way around - the mission subsystem wouldn't know or care about the mission component

#

the mission component would depend upon the mission subsystem. The reasoning for this is that if I make the sub system required to push all mission state changes, now the mission system has to hold on to the player controller instance or the mission component instance.

#

So now, if the player disconnects and gets a new player controller assigned, now I have to make sure I update the mission component instance in the sub system. While that is certainly easy enough to do, it almost seems like a violation with Separation of Concerns

crystal crag
#

The mission subsystem is supposed to handle mission / objective states, loading the mission assets. It seems more clean to have the mission component just query the subsystem and wire up events during its begin play

winged badger
#

@crystal crag if the component is there just to handle the user interface

#

first you should cconsider putting it on HUD

#

and second, your subsystem can just broadcast mission status changes with adequate payload

crystal crag
#

The main thing stopping me from having the subsystem just have a delegate, is then all players will get mission updates that the component will have to discard unless it was meant for them

#

So it seems wasteful

#

So if I had the component just grab a hold of that bridge class instance and bind to it, then the subsystem would broadcast the payload to that bridge, which then only the player and the party members would get the payload

#

And then the component could request the bridge instance, and if I wanted other consumers subscribe for a given player, then they could also grab that bridge instance, and the mission subsystem wouldn't have to care who the consumers were

#

This is the most complex task I've handled with unreal, so I'm struggling with what design I like. I just keep staring at the monitor, hoping the design will magically pop into my brain and I can start coding it ><

winged badger
#

wasteful is not really an issue here

#

having listeners ignore the broadcast that is not for them will consume maybe a microsecond during an entire hour of gameplay

#

but i am at a loss at what bridge instance has to do with a mission or the subsytem driving it

tribal flicker
#

Hey guys, I'm having problems with networking and animations. So, I have an FPS character who has two meshes with following setup:
InnerMesh = CreateDefaultSubobject<USkeletalMeshComponent>("FPPMesh");
InnerMesh->SetupAttachment(RootComponent);
InnerMesh->SetOnlyOwnerSee(true);
InnerMesh->SetCastShadow(false);

`GetMesh()->SetOwnerNoSee(true);`
`GetMesh()->bCastHiddenShadow = true;`
`GetMesh()->SetIsReplicated(true);`

and I have else two classes: weapon component and rifle weapon. Basically every time the weapon shoots it runs ReduceAmmo method. When the ammo = 0 it fires Reload method of component, which is server RPC. Reload runs Multicast PlayReloadAnim method. If the current player pawn is controlled, it plays anim montage on InnerMesh anim script instance. Else it plays montage on the actual character, which is basically 3rd person mesh. And ** that's where the problem comes in**. If I run action reload it works just fine (pressing key) including listen server. But, if my ammo is empty it doesn't work on listen server. Anim montages play on 3rd person, but not 1st. However, if I run it on client it will work fine in both cases.
Please, help me understand what's the problem.

meager spade
#

would need some more information or possibly code to help you with that

tribal flicker
#

Furthermore, anim montage doesn't play in standalone correctly when Reload method was fired from ReduceAmmo

#

oh yeah, and reduceammo is a server function, not rpc

tribal flicker
meager spade
#

i would need to see your logic flow

#

cause i cant picture how your code works

tribal flicker
#

from the moment when player fires?

meager spade
#

well anything you think is relevant to the above issue

#

i think you have gated something incorrectly

#

possibly in your reload stuff

tribal flicker
#

I play anim montages first person with my character's client RPC, which basically does
const float Length = InnerMesh->AnimScriptInstance->Montage_Play(MontageToPlay);
UE_LOG(LogTemp, Display, TEXT("Anim montage playing for: %.2f secs"), Length);
and the length is never 0.00

meager spade
#

i am not on about that

#

that is not relevant here

tribal flicker
#

ok, sorry

meager spade
#

can you not show your functions?

#

or is it private?

tribal flicker
tribal flicker
meager spade
#

no, i mean paste the code here

#

so i can see it

tribal flicker
#
{
    if (!HasAuthority() || !WeaponComponent) return;

    if (Bullets == 0)
    {
        UE_LOG(LogTPPWeapon, Warning, TEXT("Clip is empty"));
        return;
    }
    Bullets--;
    ForceNetUpdate();
    Client_InvokeAmmoChanged(Bullets);
    if (Bullets == 0)
    {
        WeaponComponent->Reload();
        StopFire();
    }
}```

```void UWeaponComponent::Reload_Implementation()
{
    if (!TPPWeapon)
    {
        UE_LOG(LogWeaponComponent, Warning, TEXT("Weapon's pointer is null"));
        return;
    }
    if (bReloadAnimInProgress || !MyPawn || MyPawn->IsPendingKill() || !CanReload() || !ReloadMontageFPP) return;

    MyPawn->SetCanRun(false);

    bReloadAnimInProgress = true;
    PlayReloadAnim();
}```

```void UWeaponComponent::PlayReloadAnim_Implementation()
{
    if (IsRunningDedicatedServer() || !MyPawn) return;

    if (!ReloadMontageFPP || !ReloadMontageTPP)
    {
        UE_LOG(LogWeaponComponent, Warning, TEXT("One of reload montage assets wasn't set"));
        return;
    }
    if (!MyPawn->IsLocallyControlled())
    {
        MyPawn->PlayAnimMontage(ReloadMontageTPP);
    }
    else
    {
        MyPawn->PlayAnimMontageFPP(ReloadMontageFPP);
        OnAmmoChanged.Execute(0);
    }
}```
#

idk if i should paste here playanimmontagefpp

meager spade
#

should have used three ` for cleaner

tribal flicker
#

oh, i didn't know about this, thanks

#

oh yeah, and I have animnotify which resets bReloadAnimInProgress and does actual reloading

#

but since it doesn't play on listen server, the notify callback isn't called

meager spade
#

hmm, did you try logging all the steps or using break points to determine where its failing? struggling to get a feel for how this works (seems quite clonky relying on an animnotify), i tend to just set the ammo when montage is completed.

tribal flicker
#

I did, I know that montage doesn't play when it should.
I know I probably should've set timer rather than using animnotify, but the issue isn't it, so whatever

meager spade
#

so where is it failing on the server?

#

set some breakpoints and debug where its failing

tribal flicker
#

MyPawn->PlayAnimMontageFPP

tribal flicker
meager spade
#

does it enter that function?

tribal flicker
meager spade
#

can i see that function

tribal flicker
#

yeah, 1 sec

#
{
    if (!InnerMesh || !InnerMesh->AnimScriptInstance || !MontageToPlay) {
        UE_LOG(LogPlayerCharacter, Warning, TEXT("In 'PlayAnimMontageFPP' some nullptr occured"));
        return;
    }
    const float Length = InnerMesh->AnimScriptInstance->Montage_Play(MontageToPlay);
    UE_LOG(LogTemp, Display, TEXT("Anim montage playing for: %.2f secs"), Length);
}```
#

as I said, log never returns 0, which is a sign that everything worked correctly, I guess

#

this is client rpc

meager spade
#

PlayAnimMontageFPP is a client RPC?

tribal flicker
#

right

meager spade
#

you should really name these functions better πŸ™‚

tribal flicker
#

my bad

meager spade
#

ClientPlayAnimMontageFPP

#

yeah if its running that and returning a value

#

but animation is not playing.. maybe its to do with the visibility options on the mesh?

#

tried setting the visibility based option to always tick bones and refresh?

tribal flicker
#

maybe, but I don't see how it could

meager spade
#

on the skeletal meshes

#

there is an option for that

#

otherwise you will need to more debugging to find out what is happening, using breakpoints and stepping through the code

tribal flicker
#

well, I tried, but when I do step in it takes me to some .gen files and then everything crushes

tribal flicker
# meager spade tried setting the visibility based option to always tick bones and refresh?

do I have to do smth like this ?

{
    bool const bFirstPerson = IsFirstPerson();

    Mesh1P->VisibilityBasedAnimTickOption = !bFirstPerson ? EVisibilityBasedAnimTickOption::OnlyTickPoseWhenRendered : EVisibilityBasedAnimTickOption::AlwaysTickPoseAndRefreshBones;
    Mesh1P->SetOwnerNoSee(!bFirstPerson);

    GetMesh()->VisibilityBasedAnimTickOption = bFirstPerson ? EVisibilityBasedAnimTickOption::OnlyTickPoseWhenRendered : EVisibilityBasedAnimTickOption::AlwaysTickPoseAndRefreshBones;
    GetMesh()->SetOwnerNoSee(bFirstPerson);
}```
#

it's from ShooterGame template

meager spade
#

can try it?

tribal flicker
#

yeah, why not

crystal crag
#

I find that I am not using BeginPlay much for components other than wiring up to a system onready delegate of some kind, to then go and do more initialization. Is this a design smell? Is this more common in multiplayer games?

#

For example, my inventory system, upon a player joining, fires off an HTTPS request to get their inventory for the character. The inventory component is created before the HTTPS response is returned, so in the inventory component's beginplay, it just (on authority only) sets a timer to check if the player's inventory is ready every 0.5 seconds

#

then once it is, then I trigger a call that has the inventory component finish it's initialization logic

#

I could tackle this problem partially with beacons and preloading all of the player's data ahead of time, but that is a challenge for another day.

#

or maybe that's how all games generally do it and I am just doing it wrong

meager spade
#

a timer?!?

#

why doesnt the request trigger the inventory component to update when the data is recieved.. πŸ€”

#

but normally tho, players inventory is done before they even load into a gam

urban mason
#

upgrading my project from ue4 to ue5, the only plugin that didn't work is advanced sessions plugin. i stripped the advanced sessions plugin from the project to pass builds, and am trying to figure out how to re-add multiplayer. someone on the forum said this (see screen shot). can anyone explain what this means?

sinful tree
# urban mason upgrading my project from ue4 to ue5, the only plugin that didn't work is advanc...

I believe you need to edit the Build.cs file that is contained in the source folder of the plugin's folder.
AdvancedSteamSessions/Source/AdvancedSteamSessions/AdvancedSteamSessions.Build.cs

There is a line in there that reads:

   if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Linux) || (Target.Platform == UnrealTargetPlatform.Mac))
#

and you'd probably want to remove
|| (Target.Platform == UnrealTargetPlatform.Win32)

#

Then you need to recompile.

urban mason
#

thanks dude

versed ocean
#

Anyone have a nice C++ unreal multiplayer repo I could look at ?

clever plinth
versed ocean
#

ok cool wasnt sure if that was blueprint of cpp

#

or*

coral pivot
#

I'm trying to make a multiplayer game ..with listen server ..can any one help ..I've further questions ..
1 . Is Listen server is only limited to LAN ?
2. Is there any player limit on listen server ? Also Is this any nessasary that all players must be on same Wifi ?
3.Can there be Opensource alternative for Listen server or Dedicated ..?
4. How do I create this multiplayer ? Is it only through Widget with Host and Connect button ?

Any tutorial link is appriciated ..an Advice will be Loved ...
Thanks for help

#

cuz after pakaging I'm just stuck that how to connect both diffrent system

eternal canyon
#

Maybe don’t try thatπŸ˜…

eternal canyon
ancient badge
#

Hello,
yesterday i was playing the new battlefield and noticed soemthing that got me an idea to try out.
In games likes Battlefield you always see your own team as blue and the enemy as red. In Hearthstone you see the playfield always from the bottom, but for all players it is the same, like you would sit on the same side of a table. What would be really weird for a card game.

So i was wondering how would you do something like that. That the playfield always look the same for each player.
Right now ma games works like this.
Each Player says to the server please spawn me 5 cubes and replicate that to the other player. Player 1 has his cubes on the left side, player 2 on the right side.

My idea now would be instead of telling the server to spawn my cubes and replicate that. I would only tell the Server i have spawned 5 cubes but don't replicate them only tell the other server that i spawned 5 cubes. When the server tells me that the other did that, i tell see server, ok please show me 5 cubes on the other side of the playfield.

Makes that sense? Would you do it another way?

sinful tree
# ancient badge Hello, yesterday i was playing the new battlefield and noticed soemthing that g...

If you think about it, you can control where your cameras are for your players. So the "left" side for player 1 and 2 would be opposite. All that requires is you have your server spawn the cubes where they need to be for either player (to the left of player 1, to the left of player 2)

In terms of visual apperance, that is something that you can control on the client side. You can have a replicated w/ notify variable on your actors such as "team ID" and in the Onrep function, if the "team ID" == your team (stored in the playerstate or playercontroller), then apply a texture that is blue to the actors, otherwise apply a red texture.

#

Using the example below, you can see CameraActor and CameraActor2 - let these represent player1 and player 2 respectively. From their own view points, you can see that "their side" is always on the left.

ancient badge
#

@sinful tree
Im trying to understand what you just said, and i hope i understand you correct.

The Camera thing i understand, i would just turn the camera 180 degrees in my game for player 2.

The thing with the "replicated w/ notify variable" i have my problems. If i understand it correct i would at a variable to my actor like you said "Team ID". When the server spawns the actor for player 1 i assign to that variable "Player 1" or something.

But how would i check the Team ID? Can i just create a Costum Client Side Event that gets the Team ID from the Player 1 and checks if they are equal?

sinful tree
carmine ember
#

Anyone know what would cause
OnComponentHit
on a character's
CapsuleComponent
to not be fired for players that are clients?
It only fires for the server player when playing as listen server

kindred widget
#

Where are you binding it?

carmine ember
#

In BeginPlay on a UActorComponent on the character
Capsule->OnComponentHit.AddDynamic(this, &UCharacterFallDamage::OnHit);

kindred widget
#

Is the actor component a default subobject?

carmine ember
#

Yep

kindred widget
#

No if checks on the binding?

carmine ember
#

Not sure what you mean sorry

kindred widget
#

If you have any sort of if statement checks, or early returns that could stop the binding.

#

if (GetNetMode() < NM_Client) for instance.

#

Or authority, or anything similar.

carmine ember
#

I have a two for checking the owning actor and the capsule component aren't null, but i have logs and breakpoints inside and they're not being executed

kindred widget
#

That's odd. So I assume that the capsule component is not valid in this other component on it's beginplay?

carmine ember
# kindred widget That's odd. So I assume that the capsule component is not valid in this other co...

This is the entire BeginPlay. Note the log at the bottom, which is being logged

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

    GET_OWNER_GUARDED(Owner);

    OwningCharacter = Cast<AMMCharacter>(Owner);
    if (OwningCharacter == nullptr)
    {
        UE_LOG(LogFallDamage, Warning, TEXT("UCharacterFallDamage must be added to an AMMCharacter"));
    }

    auto Capsule = Cast<UCapsuleComponent>(
        OwningCharacter->GetComponentByClass(UCapsuleComponent::StaticClass())
    );
    if (Capsule == nullptr)
    {
        UE_LOG(LogFallDamage, Warning, TEXT("UCharacterFallDamage requires a capsule component attached to the owning actor"));
    }
    Capsule->OnComponentHit.AddDynamic(this, &UCharacterFallDamage::OnHit);

    UE_LOG(
        LogFallDamage, Warning,
        TEXT("UCharacterFallDamage::BeginPlay called on %s"),
        Owner->HasAuthority()
            ? TEXT("Authority")
            : TEXT("Non-authority")
    );
}
meager spade
#

well it would crash if the capsule component was null

#

would also crash if OwningCharacter was null

#

whats does OnHit look like?

kindred widget
#

Also to be clear, the Non-Authority, is logging?

meager spade
#

i am also wondering why you are using OnHit on the capsule for falling damage..

#

rather than binding to the Landed delegate on the Character

carmine ember
carmine ember
meager spade
#

yeah but should you not do different things based on if it was from falling via impact from say a thrown rock?

#

anyway digressing

carmine ember
#

At this stage, no since the velocity is the important thing

#

So further testing, now i found that actually its the OnTakeAnyDamage that isn't being fired

meager spade
#

yeah but that is server only

carmine ember
#

We have weapons that call the ApplyDamage on the server and they work fine

meager spade
#

ApplyDamage is server only

#

(well it should be, you should never deal damage on the client)

#

if you want clients to receive that message, you would need to either client rpc from the server or multicast if its all clients

carmine ember
meager spade
#

right so clients wont have OnTakeAnyDamage called

carmine ember
#

Correct

#

But its not being called (on the server) at all if the player that falls is a client

#

even though OnHit is calling ApplyDamage from the server anyway

thin stratus
#

Probably character shenanigans. There should be functions on the CMC and character for hitting things while moving. Check if they work instead of the bare bones capsule event

carmine ember
#

Hmm okay, i'll take a look at those

#

Thanks for your help everyone!

left marsh
#

Hello! I am following an online networking tutorial and have set up a basic moving platform that replicates its position. It works correctly in editor, but if I launch a server through command line and connect the platform does not move. Any idea why?

dark edge
left marsh
#

How so? like launching as Client?

dark edge
#

Yeah. Or at least test with listen server as well so you can see what the server sees

left marsh
#

Everything is fine in PIE as client and as listen server

dark edge
#

K what about pie with dedicated

left marsh
#

so I am spawning my server via the command "D:\EpicGames\UE_4.26\Engine\Binaries\Win64\UE4Editor.exe" "G:\UnrealProjects\PuzzlePlatforms\PuzzlePlatforms.uproject" /Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap?listen -server -log

#

and connecting with the command "D:\EpicGames\UE_4.26\Engine\Binaries\Win64\UE4Editor.exe" "G:\UnrealProjects\PuzzlePlatforms\PuzzlePlatforms.uproject" 192.168.50.114 -game -log

#

When I connect, all the platforms are now moving in a straight line and not reversing as they are scripted to

#

I'll test again with the editor closed

#

I seem to have spawned under the map.

#

oh, I was launching the wrong thing.

#

Same result.

#

@dark edge Is that what you mean about PIE with Dedicated?

dark edge
#

No I mean you can launch a dedicated server and client from the editor

left marsh
#

How can I do that?

#

Isn't that what I'm doing above?

raw quarry
#

Has anybody else run into the issue of servertravel only working when using the default server port? (7777) When I server travel on other ports, the client ends up dropping the server IP address in the map travel, and ends up opening up the map locally rather than on the dedicated server -- any suggestions?

raw quarry
#

i.e. server travel to map while connected over the default port:
LogNet: Browse: 192.53.121.254/Game/Maps/RoyalGarden/RoyalGardenExpanded
server travel while connected to a different port:
LogNet: Browse: :7778/Game/Maps/RoyalGarden/RoyalGardenExpanded
notice that the port gets added automatically but the IP address is removed

raw quarry
#

well I've figured it out. If anyone's curious, this bug appears to only happen if you launch multiple instances of a dedicated server and have Unreal automatically resolve the ports (i.e. if you start two servers, the first one will take 7777 and then the second will take 7778 since a process is already bound to the first port)

#

if you manually give it the PORT=7778 flag, relative servertravel works properly

grave lynx
hollow stirrup
#

Anyone what source file the CreateSession node is in?
I tried finding it with Rider search with no luck
Even tried doing a general search on thigs that inherit from UK2Node

#

Ah. That's why I couldn't find it

#

It's not a UK2Node πŸ€¦β€β™‚οΈ

It's just a UBlueprintAsyncActionBase. Pain

woeful pebble
#

can i use advanced session and the steam onlinesubsystem and steam advanced sessions and join without port forwarding? https://www.youtube.com/watch?v=EDNF2DNLhPc&t=902s&ab_channel=DevAddict this is the tutorial i used and im confused if my friend can join from another network without me or him having to portforward

Check out my Unreal Engine 4 courses:

β–ΊSouls-Like Action RPG with Multiplayer: https://devaddict.teachable.com/p/souls-like-action-rpg-game-with-multiplayer
β–ΊMultiplayer First Person Shooter with Dedicated Servers: https://devaddict.teachable.com/p/multiplayer-fps-inspired-by-cs-go
β–ΊMultiplayer Top-Down Dungeon...

β–Ά Play video
woeful pebble
bitter oriole
#

No

woeful pebble
#

like on the firewall?

bitter oriole
#

You haven't needed to open ports for a game in the past decade because games use NAT punch instead, and UE4 + Steam does precisely that

#

Firewall is a completely different matter, that's an OS thing, not a network thing

#

AFAIK Steam disables firewall for games it installs, otherwise it's up to you

woeful pebble
#

Ahh, my friend tried without advanced session (the default create and join session that ue4 gives you) and it didn't work before, but i changed to advanced sessions

bitter oriole
#

Advanced sessions doesn't do it, the Steam online susbystem does

woeful pebble
#

`[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"`

#

this is exactly what i typed

#

Am i missing something?

bitter oriole
#

That's correct, just need to create sessions then

#

AFAIK that's either C++ or Advanced Sessions

woeful pebble
#

Yep i used advanced sessions

#

so im guessing that the default sessions wasn't working with steam and that's why my friend couldn't join

keen thorn
#

The game is intended to run on LAN

#

has anyone encountered similar rubberbanding for shipping build before?

bitter oriole
#

Did you test the game with packet lag in editpr

keen thorn
#

strange thing is development package works fine

#

its only shipping that has issue and I can't think of what can cause it :/

#

One thing is that my game runs physics capped at 120fps, so I'm not sure if it may be because Shipping Build somehow does not comply with the 120fps cap

dusty python
#

i have some problems with pixel streming in azure cloud. thank all

woeful pebble
# keen thorn One thing is that my game runs physics capped at 120fps, so I'm not sure if it m...

here is a way to fix network rubberbanding not sure if this will help you though: https://youtu.be/nHfSGuMKIkc

Add this to your DefaultEngine.ini for a huge performance boost!

[/Script/Engine.Player]
ConfiguredInternetSpeed=500000
ConfiguredLanSpeed=500000

[/Script/Engine.GameNetworkManager]
TotalNetBandwidth=500000
MaxDynamicBandwidth=80000
MinDynamicBandwidth=20000

[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=800000
MaxInternetClientRate...

β–Ά Play video
#

just trying to help here

keen surge
#

oh this should probably be in other channel mb

keen thorn
small onyx
#

Does anyone have a tutorial for client side pawn possession/dispossession via character controller?

keen thorn
woeful pebble
#

Wait a minute

#

you said the fps is capped to 120 right?

#

that is not normal in packaged build

#

vsync should be off

keen thorn
#

which makes my issue much harder to debug :'(

keen thorn
woeful pebble
#

Oh

keen thorn
#

and its key for networked physics to work

#

it gives deterministic timesteps

woeful pebble
#

This seems like an unreal engine bug, i think you should report it

keen thorn
#

but again ue4 physics is terrible for networking so im really testing the waters here :/ its just weird that development builds works and not shipping

woeful pebble
#

that's what i mean it's weird that its different, it shouldn't be

keen thorn
#

but UE5 already use chaos so i doubt they will deal with UE4 physics hehe

woeful pebble
#

ue4 physics can be weird in multiplayer

keen thorn
keen thorn
bitter oriole
#

You can't really replicate physics.

#

It might be possible with Chaos later on in 5, but PhysX is not deterministic

#

There is no way to get solid results in a general case, you can only work around some important objects with huge amounts of interpolation

clear sand
#

Hey folks, is dedicated server state in UE5 is okayish right now? Have small project, which I cant convert to UE5, but its relatively fast to migrate most of components to UE5. Just curious about dedicated server stability in UE5

bitter oriole
#

"Stability" in UE5 is just not really a thing right now and no one operates any dedi on it

#

So maybe it works as well as UE4, at best

#

With the large changes with LWC and world partition I kinda doubt it

#

I would expect servers to work better and better with Epic moving Fortnite to 5

clear sand
#

Whats LWC btw?

bitter oriole
#

Large world coordinate

#

Using double instead of float

vernal hamlet
#

hello

#

Any idea on how to setup a simple multiplayer for VR in unreal? like 2 VRs with 2 PCs ?

peak sentinel
#

Is there any really significant reason CMC updates visual offset via relative transforms instead of world location?

kindred widget
vernal hamlet
kindred widget
#

There is a very big difference of handling with local versus online controls which is why I ask. If it's one per PC, then it's fine however they connect. If it's multiple per pc, then that likely depends on the PC and how it connects. I'm not even that familiar with how to handle that with multiple gamepads. Local coop stuff isn't that popular anymore outside of consoles, and even then it's kind of an afterthought most times.

violet sentinel
#

don't think you can normally work two headsets with one pc, usually tested with one and as client mode / server launched separately

#

or without vr just locally

kindred widget
#

The most I know about local coop is that the engine checks every frame if it should do split screen or not regardless of coop style games. πŸ˜„

vernal hamlet
#

Yea yea i meant one per PC

keen thorn
#

i suspect shipping build does something weird to the timesteps because when my vehicle drive in open area theres no problem in shipping build either, but the moment i get near dense forest then the rubberbanding happens

#

but the fps still seems smooth, way higher than what I had set as minimum for smoothing

#

so i believe it may be really a bug

#

for development build it works fine no matter where I am

tribal flicker
# meager spade can try it?

Hey, so I tried assigning InnerMesh->VisibilityBasedAnimTickOption = EVisibilityBasedAnimTickOption::OnlyTickPoseWhenRendered; and calling

{
    InnerMesh->VisibilityBasedAnimTickOption = IsLocallyControlled() ? EVisibilityBasedAnimTickOption::AlwaysTickPoseAndRefreshBones : EVisibilityBasedAnimTickOption::OnlyTickPoseWhenRendered;
    GetMesh()->VisibilityBasedAnimTickOption = IsLocallyControlled() ? EVisibilityBasedAnimTickOption::OnlyTickPoseWhenRendered : EVisibilityBasedAnimTickOption::AlwaysTickPoseAndRefreshBones;
}```
method in BeginPlay and when my character dies. Also I set `GetMesh()` to not replicate. All like in ShooterGame. Though, nothing changed. It still works on clients and when I reload from key event, but not from weapon directly on listen server and standalone.
I'd highly appreciate if you or anyone could help me. And I don't know what I should exactly see when debugging.
left marsh
#

I managed to solve my networking issue, mostly. Hot Reload was messing up my builds so i had to regenerate the intermediate folder

cerulean juniper
#

πŸ˜‰ Hey guys! I just watched the "Network Multiplayer Fundamentals" live, and I felt like "I need more."
I think I just got the basic concept of how Multiplayer works in Unreal Engine. But I wanted some more "Real Examples."
Is there any live, talk, or even a course that can give me that? unreal

left marsh
#

I still cant accept external connections but all of my actors are behaving properly

left marsh
left marsh
#

"Unreal Multiplayer Master"

#

I dont really recommend it

cerulean juniper
left marsh
#

A lot of it is filled with really basic gameplay programming, its poorly paced, and the host makes frequent errors he then has to correct.

cerulean juniper
left marsh
#

I am going to keep progressing with it. Maybe it gets more interesting later

cerulean juniper
#

Its very hard to find a good one on this topic

left marsh
#

Till i can what?

#

It was only ten dollars

tribal flicker
#

till you can refund

dark edge
#

That's basically how it's done in the default implementation. If you're capable of doing other implementations, you wouldn't be asking any questions here lol.

quasi tide
#

@cerulean juniper @left marsh I would recommend Tom Looman's course. It has more of a focus on C++, but it also does have BP's. It also shows how easyℒ️ it is to just dive into C++. Overall - probably the best gateway to Unreal imo.

left marsh
#

The C++ course mastery?

#

I'm already confident in my C++ skills. Does his focus on multiplayer?

nova wasp
#

Tom Looman does have multiplayer stuff but I don't know about that particular course

left marsh
#

These look great. Thanks!

quasi tide
#

This one, yes.

#

It is pretty darn good. Covers all that you need to know to get the ball rollin' with MP

keen thorn
#

the physics that is running for me is deterministic enough when running 2 standalones it will produce the same simulation in a small scene. But ofc when running in big world floating point precisions start to hit

thin stratus
# keen thorn the physics that is running for me is deterministic enough when running 2 standa...

I don't think anyone can help you here much, as the general knowledge is that UE4 physics aren't deterministic and don't have a fixed timestamp.
All movement replication would require you to locally keep track of the whole physics scene to be able to replay moves on correction. Without that you will get rubber banding and all of that. On top of that, vehicles with physics are usually done client auth.
If you need this all to work you'll need a lot more coding than just changing a few default variables

keen thorn
#

this i believe is why dark souls cap their game at 60fps

#

to have a stable networking outcome

#

my problem now is that physics run very fine in development build, but in shipping build it all go rubber

#

thats why i suspect theres some settings thats not carried over to shipping :/

keen surge
#

How would I make sure client that creates an actor would be the only one able to call certain events?

#

For example: my 2 characters are both creating actors and it’s just messing up everything

#

I could handle it in playercontroller, but surely there must be another way right?

meager spade
#

Not sure i follow

#

these actors are replicated or just exist locally?

keen surge
#

My characters are replicated

#

They both need weapons to spawn, and be able to use them (animation and projectiles, damage replicate)

#

Problem is with them being able to use the weapons

lost inlet
#

well a UFUNCTION(Server) can only be called by the owning client anyway

keen surge
#

The projectiles animation and damage works

#

But if I call the spawn on beginplay

#

Won’t they both have created them locally?

lost inlet
#

well that depends

keen thorn
#

Wow I just fixed shipping build physics by forcing fps cap on 60! so happy 😁 been struggling with this since yesterday -.-

lost inlet
#

uh that doesn't sound like the best solution, unless you mean you enabled substepping

keen surge
#

Let me get my project open to clarify

keen thorn
#

this is a common solution in Dark Souls

#

due to UE4's physics its the only way for somewhat deterministic physica

lost inlet
#

yeah but relying on a fixed framerate is what I'm kinda uneasy about in general

keen thorn
#

very different

lost inlet
#

since physics substepping is likely doing most of the work for reasonably okay physics

meager spade
#

but you have to ensure its always 60

#

if someone hits 20FPS

#

its borked

keen thorn
#

if people go below it will run more substeps at fixed dt

lost inlet
#

it's effectively fixed if you're consistently hitting the performance target

keen thorn
#

actually going below is very good

lost inlet
#

did you try it with t.maxfps 20?

keen thorn
#

current deltatime is 1/120 so as long as everyone fps is below that it all will sync

bitter oriole
#

I'm afraid the reason it doesn't work in shipping is that it just accidentally works in development because you get exactly the right performance level

keen thorn
lost inlet
#

you're going to struggle to use the editor

keen thorn
#

the point is for fixed timestep the fps cannot be more than substep limit thats all

nimble parcelBOT
#

:triangular_flag_on_post: Tio Esquilo#2037 received strike 1. As a result, they were muted for 10 minutes.

keen thorn
lost inlet
#

that's not at you

keen thorn
#

i think ure missing the point

lost inlet
#

but now the message got deleted

keen thorn
#

ah ok

#

sorry

lost inlet
#

so what if your players want to get the game to run on their fancy 144Hz monitor and they remove the fps cap in their INI?

keen thorn
meager spade
#

Sorry about that, for confusing the convo removing that message.

keen thorn
#

theres trade off

#

Dark Souls limit at 60fps and sells fine

#

i doubt 144hz pple will have much to complain

lost inlet
#

I think the only thing I'm thinking of is that there must be a way to get the desired outcome without limiting FPS

lost inlet
#

yeah because modders fixed it for unlocked framerates

keen thorn
#

but since UE5 isnt stable yet and my game is still UE4 :/

bitter oriole
#

If I needed networked physics I would use 5.0 branch with Chaos and try to get actual deterministic physics networking online, if you can get it to a plugin you'll make literal bank

keen surge
#

okay actually, I think I may have a different issue than replication

keen thorn
#

Chaos has fixed timestep independent of the fps so u can decouple it entirely

keen surge
#

so I'll try fix that first πŸ˜›

lost inlet
#

well there'll be NP eventually

#

and physics is a big part of that plugin

keen thorn
lost inlet
#

Release-5.0 stream exists so hopefully a preview before the end of the year

keen thorn
#

but im just happy my shipping build works as intended atm

#

but i cant wait for Chaos tho

#

its amazing from my UE5 tests

#

just cant rely on UE5 yet :/

bitter oriole
#

Maybe not now, but when is your game releasing ? Next 3 months ? Next 6 months ? It will be essentially done by then

lost inlet
#

well is your game shipping? you could always make a branch/stream to do UE5 experiments in

bitter oriole
#

Alright then, just don't be too surprised if some players experience massive rubberbanding

keen thorn
#

it will run on Local network anyway so i worry not too much, but shipping was rubberbanding even on LAN due to the fps issue

#

its for an exhibition

#

like a simulation

#

so i've calculated my tradeoffs already :(

lost inlet
#

oh on LAN might be okay and it's a controlled environment

keen thorn
#

:)

#

yes

#

this game wouldnt be ready for consumer at all

#

it has many horrible unoptimized parts Im very aware of lol

#

Ive done the risk analysis

lost inlet
#

well for your client when they have to foot the bill for hardware, don't be too hard on them

keen thorn
#

dw they all were quoted to use rtx 3080 or rtx 3090

#

they are the military

#

hardware is np

lost inlet
#

ah nvm then

#

I thought it was going to be like a museum or something

keen thorn
#

aha it is

#

but for military

#

its like they build this vehicle battlefield game where commander will deploy vehicles and players will take on roles to drive those

#

so there are tanks, light strikes, frigates, helicopters and jets

#

all run on physics

#

networked

#

and I had to dev it all solo, even had to rig the vehicles -.-

lost inlet
#

yeah, I can see how that could be problematic

keen thorn
#

surprisingly it all turn out fine

#

the tank i even used niagara to simulate the threads

keen surge
#

okay different question, since it seems I might have messed up earlier in creating this... πŸ˜›

#

should you be using the character to handle it's input or playercontroller

#

I changed it to playercontroller since that made my rotation input (tick based) easier to manage

#

but now I'm getting reference issues on the controller

#

idk how to properly debug multiplayer yet...

lost inlet
#

you can actually use either for that, I think controller might have the slight edge since if you respawn but pressed move forward before spawning, you have to repress the key if you go the pawn route

#

though why would you be processing rotation in a tick?

keen surge
#

combination of mouse/gamepad look rotation in topdown

#

depending on current input device

keen thorn
#

the tank playing with commander shipping build, no more rubber πŸ˜„

#

maybe i should cap it at 120fps to match the substep deltatime

meager spade
#

@keen surge we just calculate the DesiredHeroRotation inside the playercontroller, then the Hero's movement component, pulls this and rotates the character

keen surge
#

yes I'm using SetControlRotation and it works just fine

#

but I'm wondering why I'm getting reference issues...

meager spade
#

what reference issues?

lost inlet
#

it's probably all good then

keen surge
#

PC complaining about accessing none as playerRef

#

I'm trying to figure out on what client or server it's going wrong but as I said I'm no good with debugging multiplayer

meager spade
#

well player controller only exists on owning client and server

lost inlet
#

might be good with a more verbatim error, but in a multiplayer environment, your pawn might not be set right away - even if you instantly spawn on join

meager spade
#

controller is always spawned before pawn, and can tick before pawn is even possessed

lost inlet
#

so if you handle input on the PC, you have to bear in mind that the pawn you get might not be valid or might be something like the spectator pawn

meager spade
#

so maybe show the crashing code?

keen surge
#

it's not really crashing that's the weird bit πŸ˜›

#

it looks fine, but yet it gives errors

#

and I'm just setting it at beginplay like so

#

at the branch it's telling me playerRef is None

#

but only a few times when I join a client

#

host only is fine

keen thorn
#

at least ur Blueprint looks clean and commented

keen surge
#

haha thanks πŸ˜„

#

I am a game development student so hopefully

lost inlet
#

Oh BP, but in MP the player pawn can and will be null

keen thorn
#

i hate messy blueprints XD

keen surge
#

might also change it to C++ for some parts when needed, but I like how easy BPs are to iterate

thin stratus
#

Your main issue is trying to get the Pawn on BeginPlay

lost inlet
#

You can have input events firing before the client has acknowledged possession

thin stratus
#

Cause BeginPlay of the Controller doesn't mean it's valid

keen thorn
#

u should use OnPossessed to get the player

lost inlet
#

And yeah that’s bad in MP

keen surge
#

right, so how would you do it in MP?

keen thorn
#

and then replicate the playerref

thin stratus
#

There are events for this. Character has an OnPossessed event for example

#

Movement input should also be done in the Character if possible

#

PlayerController is more for Character independent input, like menus

keen thorn
#

that way PlayerRef will be available eventually, also put a "IsValid" check on the PlayerRef as well everytime u fetch it

#

never use object pointers without IsValid checks unless ure 100% sure

lost inlet
#

Or validated get

keen thorn
keen surge
#

I can just have it in playercontroller without any struggle

thin stratus
#

No sure what the issue would be here

#

The code you are showing should work fine in the Character

#

And if you can use C++, have a look at the framework classes, cause they have tons of functions that BPs don't have

#

e.g. OnRep functions for Pawn in the Controller

meager spade
#

see, BP has an issue though, and its one of the things i dislike, there is not many of the client side callbacks for the OnReps

keen surge
#

so, only movement input, or just all character specific input?

#

I mean idm changing everything to C++

#

I've just not worked with it much and last time gave me a headache haha

meager spade
#

in c++ you can use SetPawn function to cache a ref to the player.

keen surge
#

I was trying physics stuff, and for some reason it wen't all spooky

meager spade
#

this gets called from OnRep_Pawn and Possess

lost inlet
#

With multiplayer aware stuff, it’s always easier in code

keen surge
#

alright time to rewrite it πŸ˜›

lost inlet
#

I barely trust BP beyond basic value replication

meager spade
#

even i struggle with basic stuff

#

i have had onreps not fire, until i deleted and remade the property.

#

inside BP's

keen surge
#

yeah I found BPs really useful with how fast they were to iterate on

keen thorn
keen surge
#

but I've only started on MP yesterday

keen thorn
#

the only way to make physics behave in UE4 is to cap the fps

meager spade
#

no..

keen thorn
#

and use substep

keen surge
#

was afraid it wouldn't work but it's no big deal

meager spade
#

look @ rocket league, and other physics based multiplayer games

keen surge
#

or rather, harder to make it work than just coding

keen thorn
#

basically how i made my vehicle physics to work over network is from here

keen thorn
#

i dont think changing physics engine is a small task for any individual, it can be done, I did look into it as well

#

but the cost was too high

#

for my current project

#

Almost every well behaved networked physics game made in UE4 use different physics engine/solver

#

to use standard UE4 physics the fps capping is the only way

bitter oriole
#

That's not really true, Fortnite doesn't

keen thorn
#

fornite has been using chaos for a while

meager spade
#

it didn't

keen thorn
#

its the game that invented all the Unreal tech

bitter oriole
#

It may do now, though I haven't seen any source for that, but it didn't before

meager spade
#

its first cars were not chaos

lost inlet
#

Yeah because they have actually functional networked vehicles

keen thorn
#

also Fornite doesnt have "physics simulation"

bitter oriole
#

Yeah it does

keen thorn
#

fortnite use movement components

#

these components have very specific ways of simulating their movements deterministically

#

it cannot be applied in general

bitter oriole
#

The cars use physics

keen thorn
#

those components have their own physics solver

bitter oriole
#

Alright, I give up, good luck

keen thorn
#

just like how their projectile components solve its own motion

#

it does not rely on the physics engine

#

as i said, if you want networked physics in UE4 right now without capping fps you need to implement ur own physics engine/solver (like the components above).

#

Only in Unreal5 Chaos have deterministic overall simulation

dark edge
keen thorn
#

Even the water vehicles in fornite have their own floating components to resolve the physics by sampling the gerstnerwave generators that syncs with the GPU shader

dark edge
#

Why so you guys keep conflating determinism with networked physics. It helps but is not a necessary thing.

keen thorn
dark edge
#

Keep it deterministic enough to not devolve chaotically between state updates and you're in good shape. Prediction is the real pain point. If you're ok with ping delay it'll work just fine as is.

keen thorn
#

with state sync it will be ensured that things will somewhat behave correctly

#

only need for 100% deterministic is when using lockstep

#

but that's far fetched...

meager spade
#

Fortnite vehicles are client authoritive πŸ˜›

#

0 input lag

dark edge
keen thorn
keen thorn
meager spade
#

i have no idea, i just know that from UDN posts and information i see floating around

keen thorn
#

like it does prediction on client

meager spade
#

not got to vehicles yet, that is next years task

keen thorn
#

Physics prediction on client is perfectly normal but for collision it gotta be server

meager spade
#

i do notice if you hit another vehicle driving towards you, you kinda clip in and then bounce back

dark edge
#

Im working on a vehicle construction and combat game and we're lucky it's slow paced enough to not need prediction. Predicting arbitrary-performing vehicles sounds like hell.

meager spade
#

so i assume server just does the corrections

dark edge
keen thorn
#

but prediction has the ugly rubberbanding effect on collision :/

keen thorn
#

it predicts on client and corrects on server

dark edge
#

I'd rather have good collision and everyone agreeing on the world state. Our speeds can be high but it's not a twitchy game.

keen thorn
#

for my game i also did not do prediction (i tried), but it turned ugly fast

dark edge
#

Can't do Rocket League without prediction but they had a hell of a time doing it. And that's for a game where all vehicles are pretty much the same.

keen thorn
#

most vehicles will need accelerate and stuff so with input lag it's no problem, cus everything takes time to change

#

only for fast moving player capsules then prediction is crucial

keen thorn
#

there was a point in time I wanted to jump over to Unity for their physics XD

#

but now that Chaos is here there's no reason to

keen thorn
dark edge
keen thorn
#

woa looks cool

#

this would be cool in steampunk style

#

i like the gyro balancer

#

πŸ˜„

#

somehow reminds me of scrap mechanic

chrome bay
thin stratus
#

Not only that, but probably even a false statement :D

ancient badge
# sinful tree You got it. The team ID you'd probably store on the player state. Here's an ex...

Hi, thank you for your help with this.
But i'm having some trouble.
Your example, is it a normal function or a repnotify/OnRep function? (That ist could be a repnotify just name to me now πŸ˜…)

I used it as a normal function in my cube actor. But i think it isn't working for me because one of my actors ist the servern so can i even do things localy if he is the server?

Right now only the second player is doing it. But for some resons in didn't figured out yet. All my cubes are blue.

thin stratus
#

If the ID is controlling a State, then it should be a RepNotify

#

If no state depends on it, then it can be a normal variable

keen thorn
thin stratus
#

But that wasn't subjective :D

keen thorn
#

"much better" is inherently subjective

thin stratus
#

Anyway, they basically used whatever UE3 shipped with and improved it afaik

keen thorn
#

there's even debate in physics if Objective reality really exist hmm...

thin stratus
#

And given it's UE3 and not 4, it's even harder to compare this

keen thorn
thin stratus
#

But yeah, Physics and MP, straight out of the box, is a bit of a shitshow

keen thorn
chrome bay
#

PhysX is a really good physics engine, UE's implementation of it has always been the problem.

thin stratus
#

Authority driven maybe not, but if you are the one controlling the physics actor, it's not so nice

keen thorn
#

but like @thin stratus says, physics sim is all beauty until networking comes into play

thin stratus
#

Yeah James is very well aware of this haha

chrome bay
#

IIRC Epic actually bought the company that was originally creating Chaos, then continued dev as their own

thin stratus
#

Last time I had to do "physics" I fell back to fully calculating what I needed

#

(which was hover physics of a flying donut shaped drone)

#

Where our client implemented it with normal physics ;_;

keen thorn
#

would be too much pain otherwise

chrome bay
#

I gave up and went client auth

thin stratus
#

Haha, I gave up on normal movement on Bang-On Balls and went Client auth there too

chrome bay
#

When Epic told me that Fortnite was Client auth, I suddenly realised it's probably not going to be an issue for me if it's not for the biggest game in the world at the time

keen thorn
chrome bay
#

I can't remember tbh, just remember seeing that info floating around somewhere

thin stratus
#

You can do a lot of Client Auth as long as you don't trust it all :D

#

Racing Games for example I would probably always do Client Auth

chrome bay
#

I'm interested to see how Chaos integrates with network prediction, but if you look at the implementation currently it's just another unscalable solution.

thin stratus
#

Can't imagine F1 2021 Server Auth

keen thorn
#

but collision between players gotta be resolved server auth right

chrome bay
#

Yep

keen thorn
#

maybe the normal movements can be client

chrome bay
#

but in a predictive model it's impossible

thin stratus
#

"You didn't hit the sausage curb, but let me tell you, you will with this nice 2mm correction!"

chrome bay
#

All clients simulating in different relative timescales and with lossy gamestate

#

The only way to really do it is deterministic lockstep, but that's impossible unless your entire architecture is deterministic too

#

Which UE's isn't

#

Especially when you consider replication

thin stratus
#

I don't know how F1 games are done exactly, but I assume they are Client Auth and the collision between 2 cars (given the rubber banding when you really crash) is done Server Auth

keen thorn
chrome bay
#

tbh with even the lowest grade of anti-cheat you can make it acceptable

thin stratus
#

I would actually, even with Lockstep, be a bit scared of saving moves

#

Like, do you save the whole physX scene too?

#

F*ck that?

chrome bay
#

yeah it's impossible to reach any sane scale

#

Works for rocket league where you have 9 physics objects max

thin stratus
#

Yeah okay

chrome bay
#

Less so for a game with stack of barrels

keen thorn
#

Lockstep will run quite well if you mix it with state sync (very possible cus i did).

#

key is to find the sweet spot

chrome bay
#

There really is no one-size-fits-all solution to this problem tbh

thin stratus
#

If I would want to create something that is very physics heavy and multiplayer, I would probably not use either of the two bigger engines available

chrome bay
#

Just have to roll with whatever works best

thin stratus
#

Idk but I feel like it's more fighting than needed

keen thorn
#

and the simulation need to be as deterministic as possible, like the next few hundred ms or so

chrome bay
#

tbh making the sim deterministic is relatively straightforward

#

but keeping the inputs to it deterministic when all the input is coming from different relative timescales is the hard part

#

True lockstep means shit loads of input lag too

thin stratus
#

Games like Gangbeasts, where you have these wonky characters that can hold each other and lots of physics going on. Or Human Fall Flat, idk ,scares me, but haven't really spent much time check how to achieve this with UE4 anyway

keen thorn
chrome bay
#

yeah. an old RTS/FPS I play uses that same approach

thin stratus
#

Like, even in Bang-On Balls, we currently have this issue where Clients are Client Auth, dash into another Client or AI, and the response is just laggy

#

Cause they can't predict the hit

#

;_;

chrome bay
#

But they have very simple physics sims, unlike todays games with crazy vehicle sims

#

Hell even convincing vehicle sims are an entire career path

keen thorn
#

because lockstep guarantee order on input, but like u said it has few frames lag which is why it should only be used for vehicles and not Sonic

thin stratus
#

And BeatNUps?

#

That sounds like a good usecase for those

#

Iirc they even show the input delay at the top

keen thorn
#

conclusion is as @thin stratus said, networked physics is a shitshow XD

#

always a tradeoff, cannot have perfect...

thin stratus
#

*Networking is a shit show

bitter oriole
#

*Game development is a shit show

thin stratus
#

I kinda hope that UE5 helps with interactions between Characters

keen thorn
thin stratus
#

I don't know what they all change with their prediction plugin

keen thorn
#

XD

bitter oriole
#

Networked physics in particular is a particularly fresh sort of hell

thin stratus
#

But I'm so annoyed that I can't have 2 Clients interact with each other without it looking laggy

chrome bay
#

I wouldn't worry about it, nobody else has solved it either πŸ˜„

#

Apart from letting them run through each other

thin stratus
#

Yeah but BangOn Balls literally has banging into each other as a feature

keen thorn
thin stratus
#

And I would love to make that feel noice

#

;_;

bitter oriole
#

I prototyped a game two years ago that had bouncing ball-shaped vehicles in multiplayer and it worked quite well with simulated physics, I'm hoping Chaos can have UE5 come out with a good physical version of that

keen thorn
winter plover
#

what is the best way to determine, when a client has sent an RPC on their timeline? I've been thinking about having the client send the timestamp alongside the rest of the RPC, but that obviously might be insecure

#

are there any better ways?

chrome bay
#

Not sure what you mean?

#

You know when it was sent the moment you send it

winter plover
#

so when I receive it on the server

#

i want to know the GameTimeSeconds() at the time the client sent it on their end

chrome bay
#

All you can do is send the timestamp

#

But it's likely not much value because that timestamp is only relevant to that local clients' game instance

#

I.e, the servers' GameTimeSeconds will not be in sync with it

winter plover
#

mhmm

#

so in addition I would have to establish a common timer

chrome bay
#

yeah, but doing that is for the most part, impossible

#

For perfect sync, at least

#

Can work for some things but you have to live with inaccuracy and some occasionally assumption, such as internet traffic being symmetrical in speed

winter plover
#

im okay with the timers being offset by latency, I just want to be able to reference specific points in time for both instances

#

in part to overcome connection issues

chrome bay
#

latency isn't the issue so much as network traffic/ping not being true RTT

#

and true RTT is impossible to calculate

#

network traffic is non-symmetrical. It could be 50 ping to the server, but 150 back

winter plover
#

basically my idea for an approach is to timestamp every update

#

and not worry about when the packets arrive, but have clients sort it out just by that data

chrome bay
#

RPC's are always received in a fixed order

winter plover
#

even unreliable ones?

chrome bay
#

Well, they're always processed in a fixed order anyway

#

Unreliable bunches are still processed in order, but there may be gaps.

winter plover
#

so PC->PlayerState->Ping is only an estimate of latency then right?

#

not something that i should rely on?

bitter oriole
#

Yes

#

Ping in itself is fundamentally estimated

#

The very essence of it is that it changes for each packet

winter plover
#

so what im getting here is that ideally, i get a timestamp from a client, but check it against some average latency to verify it, right?

#

so that you cant put in some bullshit values

chrome bay
#

That's sort of what CMC does. It receives a timestamp for each character movement packet, and tallies up the delta times between them and tracks it versus real time.

#

An you use some kind of heuristic to track values that go too far outside of some tolerance over time, to keep them "reasonably" in sync

#

For example, to prevent speedhacking

winter plover
#

if a packet has a way too old timestamp i should just drop it right?

chrome bay
#

But the point is that it's impossible to be accurate, it's an estimate

sacred flint
#

hi i do something in my game in multiplayer, all players can interact with butons and mores
but i have a problem only input text can't be inteacted by client (only server host)

#

that normal ?

chrome bay
#

CMC tracks processed timestamps and rejects older ones.

#

But you also have to reset that timestamp periodically, to avoid floating point error accumulation

winter plover
#

I've actually been thinking of making a custom time stamp

#

that doesnt use FP, but rather fixed frame counts

chrome bay
#

going to have the same issue fundamentally

winter plover
#

one int for seconds, one byte for frames

chrome bay
#

everything is simulating at different framerates, and "because physics" not even at the same real framerate relative to each other

winter plover
#

I intend to have the gameplay logic run at a fixed framerate on both ends

#

and running it on timers

chrome bay
#

What I'm saying is, timers do not run at the same interval between computers

#

And over time, the error between them builds up

winter plover
#

right, so i need to synchronize periodically

chrome bay
#

Keeping two separate machines in perfect time sync is impossible

winter plover
#

that should be doable

chrome bay
#

Either way you can look at CMC's timestamp and error accumulation stuff

#

But it's not all that straightforward generally

winter plover
#

I am well aware :v

#

but I wanna try and build it myself, to get a better understanding

#

and to have some more control

#

Im also trying to implement a networking model that doesnt rely primarily on UE4's prioritized replication

#

I want to have all the gamestate stuff be updated in one blob

chrome bay
#

Well, that's easy to do but don't know why you'd want that

winter plover
#

more consistent and synced gamestate

chrome bay
#

but also much more expensive

winter plover
#

i know its more bandwidth costly

#

but im okay with that

#

ill probably not run everything in that blob

#

just players

chrome bay
#

Easy enough to do. Just dump all replicated properties in a single struct and write a NetSerialize() function for it

winter plover
#

and let UE4 do the rest

regal flower
#

Could you please point is there any default network-friendly way to pass FTransform as RPC argument?

bitter oriole
#

I don't think there's a built-in optimized type but you can send a rotator + net quantized vector, assuming no scale

sacred flint
#

i mean i can't interact

#

but detected

#

and only client can't

#

host can

regal flower
waxen umbra
#

If I have an automatic weapon that fires at say 600rpm. It's top down and the player can shoot wherever their mouse is pointing. What if anything could/should I do to minimize bandwidth? Firing a Start/Stop fire instead of an rpc for each shot seems difficult when the server has no idea where the players mouse cursor is.

bitter oriole
#

Start/stop it is

#

The server should indeed know the aim

#

RPC for each shot simply cannot work

waxen umbra
#

But I would need to RPC the aim location instead then would I not, and it would require very frequent updates to ensure that it actually fires where the player is aiming?

#

I mean the player could in theory change their aiming drastically during one frame with a mouse cursor

bitter oriole
#

Yes, but consider this : you only need one unreliable RPC per frame for aiming, and it's okay if 10% of packets make it to the server, the aim will have to be interpolated but inaccuracy is likely no big deal

#

Firing however is a 100% thing, has to be reliable if only to not have conflicting ammo count

waxen umbra
#

That makes sense

bitter oriole
#

Not to mention you can't just not fire because of bad network, and because of game feel you'll fire locally anyway before the server even knows

#

So you're essentially telling the server how it is

#

So unreliable rpc on tick for aim (something the engine does out of the box for controller rotation) + reliable start/stop

waxen umbra
#

Yeah I did not consider that aim does not need to be reliable

#

Thanks!

keen surge
#

People here recommended Tom Looman course, right?

chrome bay
#

You can't unfortunately rely on the aim of the server - it's sent independently (if you're using a character), and not at a high enough rate to be in-sync with the clients' actual aim.

#

if you can guarantee that, then start-stop is a valid option ofc

waxen umbra
#

My aiming is disconnected from the controller. The player can essentially shoot in any direction at any time

chrome bay
#

Unreal Tournament went to enormous lengths to tie it's weapon usage in with character movement, the result is a very clunky hard to extend system. It works and uses less bandwidth, but is quite horrible in it's implementation

waxen umbra
#

and not really a direction either, they aim and fire at a location and then there are calculations to figure out what the direction is based on what their mouse was over

bitter oriole
#

Personally I assume you want to replicate aim no matter what, if only to show to other players where you're aiming at, so I recommend the start/stop approach because you're solving two problems at once

chrome bay
#

It really depends I guess. For our case it didn't work out (competitive shooter), just wasn't accurate enough

#

But on the flipside pretty much all bandwidth to the server is character movement + these weapon RPC's

#

And that's it really

#

Regular RPC's anyway

waxen umbra
#

I'm going to try both but I have a feeling it might not be accurate enough simply because you can change directions so quickly

chrome bay
#

Essentially that's the issue we had. CMC updates are deliberately compressed for e.g. and sent at the lowest rate you can get away with, they're also unreliable so may not even always arrive.

#

Unreal Tournament got around that by forcing CMC to send an update when a weapon fires, and also having a fixed tick loop between weapons and CMC to make sure everything updates in order

#

But it does couple those things together quite tightly which I didn't like much

waxen umbra
#

My aim vector is just the location of the actor to the mouse cursor pretty much, so the cmc is not really involved

#

it is technically because it rotates whenever your aim differs by more than 90 degrees from it's forward direction

hearty vine
#

can someone explain to me the difference between prediction and extrapolation cause from the explanations I've heard they sound like the same thing except prediction seems to be tied to client whenever it's explained

#

i.e. prediction seems to imply client-side prediction with known inputs

#

extrapolation seems to imply unknown inputs

nova wasp
#

Extrapolation applies to remote stuff in my mind

#

Other players are "extrapolated" from your clients perspective

#

Seems like semantics though

#

I might be totally wrong

gentle pagoda
#

If I am passing some values in a structure through a run on server event the structed become null after the value is passed to that event

#

Please help.

crystal crag
#

Does anyone know what the base network cost is to replicate a uobject?

waxen umbra
# hearty vine can someone explain to me the difference between prediction and extrapolation ca...

Extrapolation means to make a guess about the future of some state based on the current state you know. You might guess that the player will continue in a straight line even if you're not getting any more updates for instance. It's something clients will typically do when they are not receiving updates from the server.

Prediction (ClientSide Prediction) is something the client will do where it assumes that commands it's sending to the server will be accepted and displays the result to the player immediately to give an illusion of no latency.

#

I can see it being confusing since prediction means to make guesses about the future, and extrapolation is also making a guess about the future πŸ™‚

prisma snow
#

Hi! I am doing a small test/POC in order to reduce movement replication costs/bandwidth.
Basically, I have a very low replication rate (1 per second for now), and I want to try "filling the gaps" by sending movement orders via RPCs.

This orders would then be taken by a Controller that performs the movement Client side. The problem is that AIControllers only exist in the server. I want to use those because I need to use pathfinding. Do AController instances exist on clients? Can I extend AController to use Navigation/Pathfinding in the same way AIController does?

waxen umbra
hearty vine
sage isle
#

So I have a bunch of character bps made and I need to pass info like stamina and hunger into a widget but I dont want to have to cast to each of those characters, how can I get those values into the widget without a cast?
It is multiplayer and I havent found a good way of doing this yet.

waxen umbra
#

You'd need to cast them once in the initialization of the UI to access the event. You could also get a reference to the UI directly in the character and update the value on the UI from the character whenever it changes, but I would not recommend it.

sage isle
#

The values are replicated yeah, but I had the UI created on the controller. I needed to get the variables from the characters to pass in the stamina and things but I could give that a shot, but the UI doesnt really come into contact with the characters other than through the controller, and yeah that last part is what I am thinking I have to do as the UI just doesnt communicate with the characters otherwise

waxen umbra
#

UI should live on the controller

kindred widget
#

Don't reference UI directly like that. Put in bindings, pass the character to the widget, and let the widget bind it's own events. If for any reason you have to recode your character class because you deleted a UserWidget, you've done something wrong.

waxen umbra
#

what I would do is I would add an Initialize function on the UI widget, that takes the controller and/or the character being controlled, then bind the event there. Whenever a new pawn is possessed by the controller, you initialize the widget again.

prisma snow
#

HUD is a good class to mediate between gameplay and widgets

waxen umbra
#

The character should not really know about the UI, this way all it does is pushes an event and it doesn't care who is listening.

#

You might use the same event to do some effects like flashing the screen red when you take damage for instance

sage isle
#

Yeah I didnt want the UI to require like everything, its really just 2 or 3 variables from the characters I need but I was wanting to avoid casting to like 20 different characters, but I am gonna try out some of the stuff you guys suggested first

waxen umbra
#

Why would you need to cast to 20 different characters?

sage isle
#

I made 1 controller but I have a bunch of different character classes

waxen umbra
#

Right

#

and you have 1 UI

#

so that would imply there's some data that is the same for all the characters

#

put that in a baseclass and work with that

kindred widget
#

Baseclass, stats component, or if you're a masochist put it into an interface and cry.

waxen umbra
#

AMyBaseClass : AActor
Health
Stamina

AMy19thClass : MyBaseClass
ThingsOnlycClass19CaresAbout

#

Yep, or use a component, may or may not be preferable depending on your situation. For anything complex I'd probably go with a component.

sage isle
#

Damn, someone else had mentioned doing a baseclass previously
I need to get on that now, might make things a lot easier

crystal crag
#

Yeah usually your character classes share some basic functionality that just doesn't make sense to duplicate across each character class type.

crystal crag
#

or maybe I can't get an answer to that because uobject in of itself doesn't replicate anything, so it really is like replicating a struct in that sense

waxen umbra
#

Yeah and it's gonna get batched with other things and compressed, so the size of those bytes specifically would depend on how it might compress with other things I'd assume.

crystal crag
#

So throwing out caring about the details of replication frequency and all of the other stuff (that is important to consider, just not within the scope of my question), really replicating a UObject with a float takes up no more size than a struct with a float.

waxen umbra
#

Without anything marked as replicated inside it, I don't think it replicates. Once you have a replicated property there is presumably some header information that comes with the object outside of your replicates values.

crystal crag
#

Well I know uobject itself doesn't replicate on its own. I guess I just thought that when you make a uobject replicate, then there would be some data injected into the network packets about that uobject that would not be present when replicating a struct

waxen umbra
#

Maybe, I wouldn't know. UObjects afaik have a "connection" so you can refer to the same object, so that Id would need to be passed as well.

#

For a struct you'd need a byte stream + knowing what struct to cast those bytes back to

crystal crag
#

Yeah that's more of what I am interested in

waxen umbra
#

I'm not sure how useful it is, to my knowledge UE handles most of the batching and optimizing of that traffic.

#

You could probably attempt to batch some stuff yourself if you're manually updating things by sending a struct with an array instead of an array of structs.

#

I'd definitely profile the need to do that first πŸ™‚

crystal crag
#

The only purpose of my question is to determine how much of a network cost difference I would see if I replicated a uobject with a float versus a struct with a float, so I can make better design decisions moving forward

#

Structs are good for basic data, but when it comes to replicating things such as item data and missions, those all have different properties

waxen umbra
#

Are you intending on manually writing the replication stuff for a base UObject, or are you talking about actual actors and actor components?

#

UObjects don't have any replication built in, that starts with Actors in the inheritance chain

crystal crag
#

so you either stick all possible properties that all of them could hold into one struct, or you replicate uobjects with inheritance, making each uobject type hold only properties related to that type of item or that type of objective

#

the struct route I have always hated

waxen umbra
#

I ask because if it's actually an actor it will have things like a transform and other data as well

crystal crag
#

I'm talking about an actual UObjecty

#

*UObject

waxen umbra
#

I just went through the trouble of adding replication to a base UObject myself to test it out

crystal crag
#

and replicating a custom UObject through an actor component

waxen umbra
#

There are some other approaches that might be enough depending on what you need to store

crystal crag
#

/**
 * RaevinNetworkObject
 */
UCLASS()
class RAEVIN_API URaevinNetworkObject : public UObject
{
    GENERATED_BODY()
    
public:

    URaevinNetworkObject();

    virtual bool IsSupportedForNetworking() const override;

    virtual bool ReplicateSubobjects(class AActorChannel* Channel, FOutBunch* Bunch, FReplicationFlags* RepFlags); // note no override because this is the FIRST declaration of this function.

    virtual bool ReplicateSubobjects(class UActorChannel* Channel, FOutBunch* Bunch, FReplicationFlags* RepFlags); // note no override because this is the FIRST declaration of this function.

    virtual int32 GetFunctionCallspace(UFunction* Function, FFrame* Stack) override;

    virtual bool CallRemoteFunction(UFunction* Function, void* Parameters, struct FOutParmRec* OutParms, FFrame* Stack) override;

    UWorld* GetWorld() const override;
};

waxen umbra
#

Yep πŸ™‚

crystal crag
#

That's my base uobject that will support networking

waxen umbra
#

That's pretty much what I'm trying out right now as well

#

you have some other approaches depending on what kind of data that needs to be stored for each instance.

You can have a struct that inherits from another struct, and have them in different tables, then if you're in C++ you can combine them all into one array and down-cast them.

crystal crag
#

I've never seen a struct inheriting from another struct... that's an interesting idea

waxen umbra
#

That allows you to refer to a particular type with just the name, and you don't need to store irrelevant data for every object.

#

It's not really supported by BP afaik :p

#

But the code that manages that functionality can live in Cpp, and you can expose type safe versions to BP.

crystal crag
#

That much isn't as much of a concern I suppose. I guess though unless there is a much higher network cost overall for using a uobject, then I would just use a custom uobject if struct inheritance isn't support by BP

waxen umbra
#

I think the network cost will be vastly eclipsed by usage patterns as opposed to UObject/Struct storage πŸ˜„

crystal crag
#

because then I still have to write some kind of wrapper to have BP support the custom data types. Not too hard, but if a custom uobject isn't a lot in overhead, why bother doing it is what I am thinking

#

Such as how often the data is updated / pushed via replication you mean?

waxen umbra
#

I'm testing UObjects for my inventory because I want to store a fair bit of instance data, and want the items to be able to "do things". I have not even bothered thinking about the cost of replication, I'll look at it if I notice issues, and try to send the information more rarely.

#

It's better to not send anything at all than to send something cheap that you can avoid sending in the first place

#

Yes

crystal crag
#

Ok, that makes sense

waxen umbra
#

With Structs I don't think you can expose pointers to UFUNCTIONs for instance, so you'd not be able to use polymorphism with an RPC, which would mean either sending a big struct with a bunch more data than you need, or have a lot of specialized functions that you dispatch to manually after casting to the correct struct. Regardless, you'd be sending the whole struct not just the changed values.

#

With UObjects I'd be concerned about restricting when and where they get replicated and to whom, as well as the potential costs of running that manual replication code for a lot of items. Again, it's not something I'd bother with until it becomes a problem.

#

But if you don't have a lot of per-instance data, like for a quest you probably don't. I'd just send the the quest id and the stage

slow pond
#

or interpolate farther into the past

#

so you can replicate 1 per second

#

like interpolate 3-4 seconds into the past

#

either that or replicate movement diffs instead

#

one you start using rpcs on top you lose all kinds of benefits you get from diffing deltas

crystal crag
#

@waxen umbraThanks for your well thoughout replies. This has been very enlightening

#

especially the struct piece

#

*thought out

prisma snow
slow pond
#

yes

#

the alternative is to send position diffs instead of positions

#

position diffs will be smaller when the replication system packs them

#

unless you are going like 4000 units per second in the x and y

prisma snow
#

it is up to 2000 per second πŸ˜…

prisma snow
#

It is an RTS game, I know that the usual is using Lockstep and a different networking system but I wanted to make some tests in Unreal just in case we can skip the troubles of lockstep

slow pond
#

I am replicating 4000 units right now

#

still working on the system

#

on a lan my interpolation delay is only like 0.5 seconds

#

still working on the system though

#
#

this madman is replicating like 1000 cubes at 10 ticks/sec

#

I am not saying rip off his code, though maybe you could

#

I am saying look at some of his ideas

#

the replications auto bit pack

#

but some of his other ideas with indices and position diffs

#

unreal does not do

prisma snow
#

Interesting. 0.5 delay on lan is a bit too much still for the kind of game we are going for, but this is definitely an interesting approach

slow pond
#

he doesn't do interpolation delay either

#

well

#

another idea

#

I am exploring

#

is what if the interpolation delay was higher the farther from the camera you were

#

like

#

units way off would have a higher delay

#

and as you move closer

#

you have them move a little extra fast

#

to catch up

#

then you could send very little data for far off units

#

so then the closer guys could have almost no delay

waxen umbra
# prisma snow Interesting. 0.5 delay on lan is a bit too much still for the kind of game we ar...

Delay is only relevant when it's noticed. If I remember right the delay in Gaffers system is basically because of the jitter buffer. His rule of thumb is that the system should be able to miss two packages in a row and still have two values to interpolate between.

If you have a sendrate of 10 packets per second, thats one package every .1 second, and you want to be able to miss two in a row you have 4 packets in the buffer (delay of 0.4s)

slow pond
#

yeah, he runs with very minimal delay

waxen umbra
#

well, thats still 400ms of induced delay, but it's nothing strange, it's only relevant when noticed.

#

What he's using that for is transform data, not commands if I remember right

prisma snow
#

Well, most RTS have lockstep systems which inherently have delay, so delay in itself doesn't worry me

waxen umbra
#

you'd still send commands (shooting, etc) immediately.

slow pond
#

lockstep systems only have input delay though

prisma snow
#

Yep

slow pond
#

tracking bugs in a lockstep system would be a nightmare

#

for development

waxen umbra
#

So you'd take a shoot command, send it instantly, the server would check if you hit it with your current snapshot, and then send the result immediately

prisma snow
# slow pond for development

it is, the main issue is to write a custom deterministic simulation which mostly implies not using Unreal's stuff

waxen umbra
#

For the record I think I remember reading about several new RTS games that don't use lockstep, and even fighting games that don't.

prisma snow
waxen umbra
#

Fair enough, I thought I'd just mention it πŸ˜„

#

I could see snapshot compression working for an RTS as well, but RTS games are really outside of the types of games I usually think about and work on πŸ˜„

prisma snow
slow pond
#

the problem with lockstep is

#

how do you debug desyncs

#

even if you were to know which frame the desync happens on

#

which would be difficult

prisma snow
#

yes, it is a challenge

slow pond
#

now you have to figure out which one of the thousands of units caused it

#

the game doesn't even crash

#

when it happens

#

nightmare fuel

prisma snow
#

what I saw done, is to implement a hash/checksum per frame, which you can use to play/replay the current frame, and check for desyncs locally in debug builds

slow pond
#

that sucks, and is also only step one

prisma snow
#

I can think of breaking the checksum into smaller ones to have a better idea of the area that caused the problem

#

And then, a matter of time and seeing what is causing the desync, most causes are obvious, if the code is fully deterministic

#

the problem for me is to have completely deterministic code, specially in Unreal, because it can be very difficult to know how things are working under the hood

prisma snow
slow pond
#

it doesn't do position diffs

#

if you are sending indices it doesn't do diffs of those

#

I looked at the sourcecode yesterday

prisma snow
#

To start with, replication works at class level right? So how can I send diffs instead of the whole position?

prisma snow
thin stratus
#

Given the whole Engine isn't deterministic...

#

UE4, currently, is in the process of moving away from polling to PushModel.

#

Not sure what you mean with Position Diffs though

#

despite something literal?