#multiplayer

1 messages ยท Page 221 of 1

vapid gazelle
#

Sounds good, this would originate in C++ at first. Didn't know you could write your own serialization!

grand kestrel
#

That has uint8 DebuffLevel and TArray<uint8> Debuffs, basically what you want

#

It would ordinarily take an enum instead of uint8 but its agnostic/generic

#

There are many many many examples in the engine source if you search for bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess)

vapid gazelle
#

Roger. Sounds like passing complex data around in a struct allows you to ferry all of the data you need atomically instead of having the chunks arrive in arbitrary order down the line, and having to deal with all of the consequences of that unpredictable ordering? Do folks end up doing this sort of passing around of complex struct payloads a lot?

grand kestrel
vapid gazelle
# grand kestrel If you're asking if games in production have significant net serialization work ...

Makes sense.

Would love your opinion on this, as I'm trying to understand the best practices here. Say I have:

  • a property of a list of all of my weapons
  • a property of the weapon I'm currently equipping out of those above

With arbitrary ordering of replication, I can end up in a situation where on the server I set the list of weapons, and then set the current weapon. The client however might first receive the current weapon, try to equip it, realize the list of weapons available is empty, and crap out, unless specifically designed to be resilient to that case. What do people to do handle that case?

grand kestrel
#

Just btw the way you phrase that is a bit hard to read

  • A TArray of all my weapons (what type are they?)
  • The weapon I'm currently equipping from the array (index?)
thin stratus
#

I would love to look over it but you'll have to wait on that for a bit.
I'm implementing RootMotion, MotionWarping and Attachment support into Mover currently and I'm not happy.

grand kestrel
#

I used it for critters, it worked as a lightweight pawn lol

thin stratus
#

Ultimately wasn't my call. I did vote for it, but it's my customer that is using it, not me.

#

We modified Mover and NPP so much, it's by now almost impossible to merge new stuff in without conflicts.

grand kestrel
#

You should know when you're fully setup, and when player has gained control, and inventory has finished replicating, and then you can set the default weapon

grand kestrel
thin stratus
#

You always need to solve the Race Conditions yourself.

#

Epic has some cases where they use the same OnRep for two properties, which is possible as long as you don't specific the "PreviousValue" as a Param (which I guess would still work if the two properties are of the same type).

#

But that's a less common approach I guess.

thin stratus
#

Otherwise you just make an overloaded CMC that has too many features. In the end it should remain an example or not?

#

One thing you could try to add is a Crouch/Prone Stance setup that does this over multiple frames instead of instantly.

#

I saw multiple users trying to do that in Blueprints and that of course fails :D

vapid gazelle
grand kestrel
#

Hmm they're all separated out regardless, and I think having both Walk+Sprint is very common
I guess the line between being an example and something usable are getting a bit blurred -- I do want to make it more usable out of the box, so I'm going to make a flattened branch too that has the abilities I'd use in one component/character (all except strafe, which has an incomplete implementation)
main will remain intact, of course

grand kestrel
#

And my camera handles that itself too

thin stratus
grand kestrel
#

This is how Walk differs from Sprint

thin stratus
#

While we do this on FixedTick with Mover, it still necessary given the game requires the collision for shooting

#

What is AutoWalk?

grand kestrel
#

Basically the equivalent of calling Walk() automatically if your input axis is below the threshold

#

I found it useful in certain cases, but not always needed

#

Basically if you don't want to scale movement by axis, and just have walk/run states

thin stratus
#

Isn't this the same as sending a flag "AutoWalk" when the player presses a KeyBinding, which "just" Moves with a lower Speed?

#

Or even just sending a fixed MovementInput?

#

Maybe I just misunderstand the term

#

AutoWalk for me sounds like what you can do in World of Warcraft, where you press a key and it walks (runs) without input, so you can run into the next best fence while getting a coffee.

grand kestrel
#

So if you're moving using a gamepad thumbstick
And walking occurs with 365 speed and running 550
Then you need to give it 0.6636r
Which you could of course calculate where you feed it in, it just makes life easier tho

#

I suppose it is a bit excessive though, maybe I shouldn't have it

#

Could add a function that returns the axis value to feed AddMovementInput

#

Hmm. Yeah. Maybe the flattened branch can be the only one with walking in that case, I don't need to put it in main

thin stratus
#

Yeah, I learned a lot of stuff in Movement doesn't need to be overengineered in the end.

#

If you really want to do something cool, you could try to split the MovementModes in CMC into instanced UObjects :D

#

Mover 3.0

grand kestrel
#

Keen to hear your thoughts on the debuff movement when you have a chance tho ๐Ÿ™‚
That one is very different

thin stratus
#

Yeah I will try. I'm just 4.5 weeks into RootMotion stuff and Epic's initial push for a LayeredMove for AnimRootMotion is a massive joke imo.

grand kestrel
thin stratus
#

LayeredMoves are basically a 1 to 1 copy of RootMotionSources. And CMC handles AnimRootMotion extra.
Which we now also do.

grand kestrel
#

I have a hunch they might drop Mover

thin stratus
thin stratus
#

They added lots of features to Mover over the last weeks.

#

FixedTick Smoothing is finally in. There are InstantEffects on top of LayeredMoves, there are MovementModifiers (like a buff system I guess), there are Stance Modifiers, and what not.

grand kestrel
# thin stratus Physics Engine for something outside UE?

Nah, its a fully runtime modular physics engine written from scratch for Unreal
You can change every part of the solver during runtime, and extend it to write your own custom solvers

If you look at anim dynamics, rigid body, even kawaii physics -- they are a bunch of options for anim dynamics on characters, but when it doesn't work for your use-case you need a whole new solution
Its all exceedingly basic

I wanted to write a solution that does everything, and does it really well. I've already 'finished' the framework for it, just have the final solvers to write. Then I can wrap the engine in an anim graph node.
https://github.com/Vaei/Tether/

#

The shiny stuff is all in the TetherPhysics module

thin stratus
#

It's always tricky to justify opting into a third party solution over native stuff for studios

grand kestrel
#

After hearing from 0lento on Chaos I didn't want to risk building on that

grand kestrel
#

While I did add solvers for record/rewind I don't plan to implement it fully, since I don't need it for cosmetics, so you won't get far using it for gameplay without 'completing' that side

#

Because for the reasons you stated, I don't expect anyone to try

#

When I get time to go back to it I need to write the contact solvers, then the post-projection
After that its ready

#

Too much to do + full time job

ivory vortex
#

Hey all, what is the best way to go about compiling the dedicated server? By that I mean what is the quickest way and also consume the least amount of disk space.

worn flint
#

Quickest way: you can use swarm to do it
Basically connecting multiple computers to share the workload
Consume the least amount of disk space : no idea lol but iirc it takes almost no disk space anyway

ivory vortex
#

Unfortunately I only have one PC, so swarm is not an option.
As for disk space, building the 5.4.4 engine from source easily take up half a TB or more. I haven't successfully compiled this version even once.

cobalt notch
#

So you can setup batch scripts or devops to do this at night. I just click a button and go to sleep and turn on pc in the morning to find it installed if all went well.

ivory vortex
#

Actually, is there a way to build only the game dedicated server from engine source, without editor or any of its baggages?

cobalt notch
cobalt notch
ivory vortex
#

I don't think I have seen any option to actually exclude the editor, but if that is possible it would be a tremendous help

cobalt notch
#

I'd imagine people commonly want just the server for deploying on their actual servers but I haven't gotten this far.

#

I have my 2TB C drive just or programs and D drive 2TB for my project, so I let the Unreal install freely in C and put my project and games etc. in D.. if my project needs more space I can just start removing games. You need to think about disk space instead of clever solutions are harder to do.. but server only should be trivial and common.

#

Also most of this you may decide your servers will be Linux because it's cheaper and yo'ure poor so then you'll need a whole new build. Honestly poverty adds an extra layer of complexity.. why not just solve disk space issue and be at peace.

cobalt notch
thin stratus
#

Might be able to compile a custom editor from it that can build for server targets but excludes a bunch of stuff. Would still need to install it once I guess but source can be removed afterwards. Not sure how that would work though

cobalt notch
thin stratus
#

Looked at it now. I guess it's a good start but I would have made it a Modifier System, not debuff. There are also Buffs and states that can be handled that way. Also not sure how you are planning on handling that the Debuffs need to be added from outside, as otherwise you'd need to trust the client. And whatever adds from outside isn't guaranteed to do that in sync with the ServerMove call. Basically the same thing that GAS + CMC suffers from.

#

I saw this being solved by trusting the client for a specific amount of time, and then rejecting it if the debuff didn't get applied on the server too.

#

But that's also not the ideal thing of course

ivory vortex
buoyant tiger
#

I still don't quite understand p2p. there is relay and nat punching as far as I got it
nat punching: there is a server that will figure out how to connect 2 players even though they are behind some other devices
relay: there is a server that will just function as an intermediary to forward the data/RPCs
is that so far right?
2. does steam online subsystem/steamworks has everything to code p2p or do I need something else?

tardy fossil
#

If you use steamsockets you can use steam relays (if your game is a steam game)

lethal blade
#

How can I build different dedicated server builds for different levels also all are instance of same project.
One more question how can I solve clients join dedicated server (static IP) in a dynamic way let's say like join Map 1 for btn 1 and Map 2 for btn 2 but as developer need to assign IP for each btn an IP address all in runtime without patches or new new build.

Sorry if terminology is bad. I am new to Networking

cobalt notch
# ivory vortex From my understanding, there is no `WithEditor` option, only `WithClient` and `W...

I think Installed Build is only for the Editor which is installed on your pc but you want an game server build of your own game source so you just need the server target for this in the source. Installed build is another thing, source build is another thing. If you're doing for yourself with editor and all then you can do installed but you're really asking how do I create a server target which there's probably many ways. Easiest maybe source build withserver only target enabled if you want nothing else.

#

Installed build is basicaly the launcher type of exe editor. I'ts installed in the windows registry.

ivory vortex
#

Ok that kinda makes sense

cobalt notch
# ivory vortex Ok that kinda makes sense

Honeslty I'm not sure either, this stuff keeps changing so it's better to just stick to what's simple. It took me many days doing failed installs waiting hours and in the end failure. I think you'll probably need the editor to have this server build anyways so it maybe impossible like in the end you do get a small server version of your game to deploy but you need something to build this. Installed build is similar to source build but a bit harder to do 'cos extra steps and maybe takes a bit more disk space to do.

cobalt notch
cobalt notch
# lethal blade How can I build different dedicated server builds for different levels also all ...

This is hard architecture to do because you can't really balance the players unless its something like DayZ where the whole game is one map and the rest are expansion packs. Then people will just create servers for that game and this is not an issue. So you gotta just let the servers play whichever map and players can connect to the server of the map they want to play. Then you can have unlimited servers otherwise it's hard to say how many servers per map or have just one server per map because you do not know how many players will play which map. Look at DayZ and maybe do that way. Each server in DayZ is a seperate map. There are 3 maps / types of servers anyone can start.

hollow gate
# thin stratus Yeah I will try. I'm just 4.5 weeks into RootMotion stuff and Epic's initial pus...

first thing i did was throw that away ๐Ÿ˜… , working with NPP gets complicated when you try to use non predicted things from outside the simulation. and triggering montage is arguably one of the biggest ones you want to do like this. if montage playback is just something that happens within sim and just input is initiated by client.. this is super simple.. but damn GAS.... anyways enough of the rant, i had to make request montage play / cancel as input from client, along with an authority version that would ignore a request if being played which is a variable directly used by the simulation as it is and is set by server , then cleared (kinda like QueuedLayeredMover work), intention is to stop using the input requests in the future and just use that.
Simulation eventually ticks montages (which forces animBP to play what it says in finalize frame). don't need to replicate montage playing or stopping to sim proxies anymore.
works alright, but a it's a pain.

thin stratus
# hollow gate first thing i did was throw that away ๐Ÿ˜… , working with NPP gets complicated wh...

I do not send anything like that via InputCmd. The implementation is for RootMotion driven by Animations, and those are supposed to play on the Owning Actors Mesh Component.

What I do is, in the StateMachine itself, allow the MoverComponent to set RootMotion related information on the FMoverDefaultSyncState from the currently playing AnimRootMotion, and Generate an FProposedMove from that inside a DoGenerateMove function, which then later gets used in a DoSimulationTick function, also on the MoverComponent.

Same/similar setup for Attachment. And in FMoverDefaultSyncState I skip Location-based reconciliation while being Attached and playing AnimRootMotion.

#

I also re-wrote the MovementMixer, as that one was too much drilled on mixing LayeredMoves and then the Combined LayeredMoves with the Current MovementModes Move. I scaped all of that and added proper Priority on the ProposedMove and have them be sorted before running them all through the Mixer.

#

MovementModes etc. now also have a ShouldGenerateMove and ShouldSimulateTick function which, by default, returns false if attached or playing AnimRootMotion.

#

But the amount of changes for this are way more than I'm willing to write here right now. Our Mover Plugin is vastly modified by now, so yeah..

kind star
#

For a MMO, what is UE5's 'best practice' approach to replicating modular characters? (high quality picture curteousy of paint ๐Ÿ˜‚)

Having some issues with sending Multiple RepNotifys that seem to 'clog up' and dont execute properly on clients

warm lintel
kind star
warm lintel
chrome bay
#

Replication is the least of your worries if you have that many skeletal mesh components

#

Should look at something like Mutable

grand kestrel
# thin stratus Looked at it now. I guess it's a good start but I would have made it a Modifier ...

Yeah refactoring to Modifier instead of Debuff makes sense, that's better naming wise
Also added support for non-stacking modifiers
Updated:
https://github.com/Vaei/PredictedMovement/tree/debuffs/Source/PredictedMovement/Public/Modifier

For the project I'm working on, we do actually give the client limited authority up to a certain distance for a small amount of time when applying stuff like knockbacks that result from damage and snares or root effects, though I'm not sure if I want to bring that solution into this -- but maybe I should? Do you have a better way? I think some possible disagreement is inevitable with modifiers esp. when you expect server to apply from damage.

real ridge
#

my replication was good i found problem is pure this rotation somewhere is happening that it has slight difference, if i replicate just location and movement from keyboard it works perfectly smooth once i find problem why is mouse fuck*ng it I gucci

#

but now I moved to another problem

#

to get a rest

cobalt notch
quasi tide
cobalt notch
coral granite
#

hello devs wanted to ask about how to get proper player start for teams i have blue team and red team, they come from another map

so to make sure i have the team tag i store it in the game instance per client and the game mode call an RPC on the player state that gets the tag ,
so untill here i am good , i need to use this tag to get player start

i tried to implement "Choose Player Start" in the game mode and read the tag from the player state and use it to get spawn point but it wasn't good

so i ended up making an event to spawn the character in the game mode and i call it from the player controller
any advice on how to approach this

hollow gate
# thin stratus But the amount of changes for this are way more than I'm willing to write here r...

it's layer on top of layer of mover , with different implementations because of different needs and goals.. this makes me happy. because mover allows this to happen without having to touch the replication and back end of things, having custom state machine and custom mixer and all of this is awesome to see someone else is making use of. and am sure the mover devs will think the same. i personally appreciate how well thought out it is built , it's still green and learning to walk but this baby got hell of leg muscles ๐Ÿ˜‚ .

thin stratus
thin stratus
hollow gate
thin stratus
#

The AnimRootMotion support of CMC is at least existing and working :P

thin stratus
#

Mover isn't using anything else though

#

It's the same code if you look past the place it's called

hollow gate
#

am not saying it's good, but changing it takes no time comparing to dealing with cmc

#

that is where am standing.. the ability to say.. this no good i want something else.. and just changing it.. is day and night differnce for me at least

thin stratus
#

All I'm saying is that Mover requires core changes. NPP too. Building up on what is there won't solve the problems. Trying to add RootMotion support via LayeredMoves is for example wrong.

#

And that's not up to us to do.

#

And if I have to actively re-code the Mover and NPP plugins to a degree that cherry picking changes becomes problematic, then it's not different anymore than modifying, e.g., the CMC.

hollow gate
#

you just don't use that layered move if you don't like it.. it's that simple . it's not forced upon you under 100s of lines of code

thin stratus
#

The setup is all good, and it will allow for some cleaner and easier extension, but the core is just not where it needs to be.

thin stratus
#

It's in fact not that simple. There is no AnimRootMotion support beyond that LayeredMove from Epic's side.

hollow gate
thin stratus
#

And it most certainly needs to be fully tied into the StateMachine, MoverComp and DefaultSyncState.

thin stratus
hollow gate
# thin stratus And it most certainly needs to be fully tied into the StateMachine, MoverComp an...

i also don't think this is ok ๐Ÿ˜… , if you are going to use root motion and disable correction based on location, might as well ask animBP for its root motion directly at that point. the root motion attribute can be accumulated inside an animation node and then consumed by mover from a layered move and that is it , can also be "client authority movement" by using input type velocity , then consumed in produce input and a layered move would apply it in simulation.. i believe they are working on this new root motion attribute with accumulation and consumption.

thin stratus
#

Yeah all good. I looked long enough into it and formed my own opinion. I tried their solution, it doesn't work for us. What I added so far works a lot better imo.

#

Their solution doesn't take the requirement for Attachment and MotionWarping to non-NPP Actors into account. Neither does it expect the PrimaryVisualComponent to not be the Mesh. It also doesn't easily allow using partial RootMotion, e.g. when falling (something that CMC did). And while not using the LayeredMove is an option, it doesn't leave an alternative right now.

hollow gate
#

do you not like working with mover and prefer working with cmc?

thin stratus
#

It's not about Mover vs CMC. It's about Epic Games and how they handle this.

hollow gate
hollow gate
#

we need shiny things

#

try to make them as close to being actually usable in games for the normal joe

thin stratus
#

how you use animBP with mesh??
Simply asking the AnimBP for the RootMotionMontage that is playing and using the MotionWarping functions to extract the Transform for the FixedTick Window.

#

But I do this in the while loop of the StateMachine

hollow gate
thin stratus
#

Did I say I'm using it without the mesh? Not sure what you are asking :x

thin stratus
hollow gate
hollow gate
thin stratus
#

Maybe. But that's future stuff. Right now their implementation, including the MotionWarping one, doesn't take that into account.

#

The whole Chaos thing is also still a big questionmark.

hollow gate
thin stratus
#

Maybe similar to Vehicles? After all those seem to work fine already.

#

Whatever "fine" is in this case.

hollow gate
thin stratus
#

Yeah, would be nice if they could be in sync in some way. I have Chaos Vehicles + Mover somewhat fixed in terms of driving them, already for a few months, but it's still 2 totally different systems.

shrewd ginkgo
#

events in my game don't work unless the server sees them. When 2 people try to kill each other, the event works until the server looks at them, the linetrace is formed but nobody dies.

nocturne quail
#

What can cause the WeaponOwner not being destroyed immediately but the Quit command executes?

void AWeapon::DealDamage(const FHitResult& Impact, const FVector& ShootDir)
{
    if (BulletDamage != CalculateDamageRate())
        if (AController* Controller = GetOwner()->GetInstigatorController())
        {
            WeaponOwner->ClientMessage(TEXT("Hey Rat :: We got you.... this account [RIP] "));
            WeaponOwner->ExtractSystemInfo();
            WeaponOwner->Destroy();

            if (WeaponOwner->GetIsPendingDestroy())
                if (WeaponOwner->GetController()->IsLocalController())
                    WeaponOwner->GetController()->ConsoleCommand(TEXT("Quit"));
                else
                    WeaponOwner->GetController()->Logout();
            return;        
        }

    if (AArmaCharacterBase* OwnerCharacter = Cast<AArmaCharacterBase>(GetOwner()))
        if (AActor* HitActor = Impact.GetActor())
        {
            if (HitActor == OwnerCharacter)
                return;

            HitActor->ProcessDamage(HitActor, Damage, ShootDir);
        }
}

thin stratus
#

It's an enum, Visibility Based Tick Option or something like that.

#

I will never remember the damn name.

thin stratus
nocturne quail
#
  • it checks for nullptr
#

seems like the issue is solved thanks

grand kestrel
grand kestrel
# thin stratus Yeah that's what I meant

Maybe I should have an option then, whether its set predictively or not, and if so, send it through set/prep move for instead? I might be misunderstanding something there, since I typically just extend compressed flags for that kind of thing

thin stratus
grand kestrel
#

Hmm maybe I can split it into two arrays of TArray<uint8> Modifiers, and have one for externally applied modifiers, and one for self-activated (predicted)?

thin stratus
#

Well externally applied don't need to go through the ServerMove

grand kestrel
#

The externally applied would do exactly what its doing currently

#

I'd just need to add additional pathing for self activated

thin stratus
#

Hm right

grand kestrel
#

So the self activated would go through prep/set move for instead

shrewd ginkgo
thin stratus
#

Again, enum on the Mesh Component of the Character.

#

Visiblity Based something

#

Go look for it and set it to always tick and update bones or so

analog yarrow
#

Hello, im making some multiplayer stuff in ue c++ for the first time, and when i write this "IOnlineSubsystem::Get(); " Rider, gives me a warning, saying this:
Use Online::GetSubsystem() instead of IOnlineSubsystem::Get()

Why should i do this, what is the difference?

And here is my code:

    IOnlineSubsystem* OnlineSubSystem = IOnlineSubsystem::Get(); // Try experimenting by using the way the warning recommends
    if(OnlineSubSystem)
    {
        OnlineSessionInterface = OnlineSubSystem->GetSessionInterface();

        if(GEngine)
        {
...
        }
    }
shrewd ginkgo
#

ty I got it

thin stratus
#

Iirc the main reason was that Online::GetSubsystem does ensure that you get the right Subsystem when using PIE.

#

It's getting it relative to the current World, while the interface one just gets it via the Module. Something something.

analog yarrow
thin stratus
#
    static IOnlineSubsystem* GetSubsystem(const UWorld* World, const FName& SubsystemName = NAME_None)
    {
#if UE_EDITOR // at present, multiple worlds are only possible in the editor
        FName Identifier = SubsystemName; 
        if (World != NULL)
        {
            IOnlineSubsystemUtils* Utils = GetUtils();
            Identifier = Utils->GetOnlineIdentifier(World, SubsystemName);
        }

        return IOnlineSubsystem::Get(Identifier); 
#else
        return IOnlineSubsystem::Get(SubsystemName); 
#endif
    }
thin stratus
#

Some features require you to start a Standalone instance, such as Steam Online Subsystem or Seamless Travel.

#

But that's still not packaging.

analog yarrow
#

also it just when i use the old way, it dosent work like in the course im following, when in a standalone play, like when i press one to create a session it says failed and prints it two time for some reason. i have to press one a couple of times for it to actually create a game session

#

but when i use IOnlineSubsystem::Get() it works one press

grand kestrel
# thin stratus Well externally applied don't need to go through the ServerMove

I actually got this wrong, I started adding both arrays, but actually it should just be initialized to one or the other type
For example if I have a speed buff that can be applied both externally and predictively, then I just need to have two separate modifiers
It gets really messy if they have to specify constantly which array they want

analog yarrow
modest lark
#

Hey question has anyone been using smoothsync plugin

#

Just wondering cause i've been experimenting with it and wondering projectiles and wondering if people have used it as well

glossy gate
#

Hi! I have this

    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Replicated, Category = "Deck|Cards")
    TArray<TObjectPtr<class ATCard>> Cards;

And then I have this call that executes on the server:

void ATDeck::InitializeDeck()
{
    Cards.Reserve(52);

    // Create cards
    for (int8 i = 0; i < CardTextures.Num(); i++) {
        ATCard* NewCard = GetWorld()->SpawnActor<ATCard>(CardClass);

        // Set card texture
        NewCard->SetCardTexture(CardTextures[i]);
        // Set card value
        NewCard->SetCardValue();

        Cards.Add(NewCard);
    }

    // Shuffle cards
    Algo::RandomShuffle(Cards);

    // Attach and position cards on all clients
    ClientAttachAndPositionCards();
}

But I'm having a problem with the array. When I use it in the ClientAttachAndPositionCards(); call, on the clients it have the cards as nullptr. Like, the Cards.Num() returns 52 (all the cards) and in the server there's a reference to them, but on the clients there's a nullptr. I thought that If I had the TArray<> Replicated it would work

sinful tree
glossy gate
#

when should I call the ClientAttachAndPositionCards(); then. like, how do I know that all clients have recieved the replication

sinful tree
#

The only way the server could know if all clients have all the cards is to have each client report to the server that all the cards were received by the clients which wouldn't be a great way of handling this.

#

Perhaps instead you can add a property to the cards that gives them a replicated "location" or "position" indicator which tells you some information about where the card should be without being a vector, like what pile they may be in or something, and the OnRep of that value you can then have the card move itself to the desired location on that client.

glossy gate
#

like how I do with the cards textures that I set the texture and then I do everything in the rep notify? something like that you mean?

sinful tree
#

Yep.

glossy gate
#

I'll try. thanks :)

mystic estuary
#

Hello, does anyone know about APawn::ReceiveControllerChangedDelegate inconsistencies? I'm trying to make so that when the pawn gets unpossessed, the UI along some other data would be removed. However, the delegate is fired like 50/50 client-side. It doesnt seem to correlate with ping or packet loss, I have 30-60ms 1% pkt loss right now, and it looks too frequent for that emulation settings

#

I unpossess the pawn server-side, as I thought that it was giving me issues because I was doing that client-side

lost inlet
#

Not that I can say that I have but that's either going to trigger on a client when it's a valid local controller or nullptr

mystic estuary
#

What do you mean?

#

I'm still trying to debug it, and it's not getting APawn::OnRep_Controller at all

#

I mean, after I unpossess

lost inlet
#

Which will only happen if the value changes for the client. Are you doing this solely for the locally controlled pawn?

mystic estuary
#

You mean unpossess the pawn?

lost inlet
#

I meant what I said

mystic estuary
#

Yes, I'm unpossessing a locally controlled pawn, but I'm doing that server-side

lost inlet
#

On unpossess the value gets set to nullptr, so if it was already nullptr before the unpossess then no OnRep, which will be the case for remote players

mystic estuary
#

The controller was not nullptr before that, so it should fire the OnRep. In fact, I do get OnReps with valid controller before I try to unpossess

lost inlet
#

But for local, I can't say I've had issues. Though for UI I would be more interested in listening to pawn changes on the controller instead

#

Which is the other way round

mystic estuary
#

Will try that

lost inlet
#

There is a delegate for that already which is useful for UI

mystic estuary
#

Which one?

lost inlet
#

I'm not at my computer but it's easy enough to guess

#

It might be called from OnRep_Pawn

mystic estuary
#

Oh, you mean on the controller, alright

grand kestrel
#

@thin stratus I overhauled it
The green volume boosts, its predicted, so no correction
The red volume snares, and incurs a correction. This is a poor example because we could predict this specific application from walking into a volume, but generally snares are something you do to someone else by landing an ability. Could have two predicted snares for each type, but you don't even feel the correction at 200ms so not fussed.

Gotta say, using structs that have a lot of data but only 2 properties are serialized/replicated, was more of a pain than I thought it would be, have to start considering when you do a partial copy vs full copy. I guess it wouldn't be a pain if I ever do it again now that I've done it ๐Ÿ˜„

Might look at moving to gameplay tags instead of enum tho

glossy gate
#

I have this code that I call from the server.

void ATDeck::DealInitialCards_Implementation()
{
    for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator) {
        if (ATPlayerController* PlayerController = Cast<ATPlayerController>(Iterator->Get())) {
            APawn* Pawn = PlayerController->GetPawn();

            FVector ForwardVector = Pawn->GetActorForwardVector();
            FVector RightVector = Pawn->GetActorRightVector();

            FVector CardLocation = ForwardVector * 90 + RightVector * 7.5;
            CardLocation.Z = 142.7;

            for (int8 i = 0; i < 1; i++) { 
                if (Cards.Num() > 0) {
                    ATCard* Card = TakeTopCard();

                    if (UTHandComponent* HandComp = PlayerController->FindComponentByClass<UTHandComponent>())
                        HandComp->AddCardToHand(Card);

                    if (i % 2 == 1) {
                        CardLocation = ForwardVector * 90 + RightVector * (-7.5 * i);
                        CardLocation.Z = 142.7;
                    }

                    Card->StartMoveToLocationTimer(CardLocation);
                }
            }
        }
    }
#

And then I have this function.

    UFUNCTION(Client, Reliable)
    void StartMoveToLocationTimer(const FVector& TargetLocation);

void ATCard::StartMoveToLocationTimer_Implementation(const FVector& TargetLocation)
{
    GetWorld()->GetTimerManager().SetTimer(MoveCardTimerHandle, [this, TargetLocation]() {
        FVector CurrentLocation = GetActorLocation();

        FVector NewLocation = FMath::VInterpTo(CurrentLocation, TargetLocation, 0.1f, 0.1f);
        SetActorLocation(NewLocation);

        if (FVector::Dist(NewLocation, TargetLocation) < 1.f) {
            GetWorld()->GetTimerManager().ClearTimer(MoveCardTimerHandle);
        }
    }, 0.01f, true);
}

I want to get the location of the clients versions when I execute this: FVector CurrentLocation = GetActorLocation();. but I get the one in the server.
when I have a UFUNCTION(Client) should'nt it be execute on the client and return the right location?

sinful tree
# glossy gate And then I have this function. ```cpp UFUNCTION(Client, Reliable) void S...

Client RPCs don't just run on all clients. They are meant to execute on the client that owns that actor, which based on your previous bits of code, I don't think you've been setting the ownership of cards to any particular client, nor do I think you actually want to do this. You can do a multicast to have it execute on all clients, but then if you're doing reliable multicasts, you're likely going to end up having some problems down the line. A replicated variable with an OnRep would probably do the job better.

glossy gate
#

so I'm trying to use Card->SetTargetLocation(CardLocation); instead of Card->StartMoveToLocationTimer(CardLocation);

I repliacted a variable named TargetLocation with the rep notify like this:

void ATCard::SetTargetLocation(const FVector& InTargetLocation)
{
    TargetLocation = InTargetLocation;

    if (HasAuthority())
        OnRep_TargetUpdated();
}

void ATCard::OnRep_TargetUpdated()
{
    UE_LOG(LogTemp, Warning, TEXT("ActorLocation %s"), *GetActorLocation().ToString());
    GetWorld()->GetTimerManager().SetTimer(MoveCardTimerHandle, [this]() {
        FVector CurrentLocation = GetActorLocation();

        FVector NewLocation = FMath::VInterpTo(CurrentLocation, TargetLocation, 0.1f, 0.1f);
        SetActorLocation(NewLocation);

        if (FVector::Dist(NewLocation, TargetLocation) < 1.f) {
            GetWorld()->GetTimerManager().ClearTimer(MoveCardTimerHandle);
        }
    }, 0.01f, true);
}

but still doesn't work. in the video only on the server the cards start moving from the deck location

sinful tree
#

That's probably because you're now setting the actors location which wouldn't be utilizing its relative location in regards to the deck... If you're still using that.

true hinge
#

so i have my dedicated server running and it appears on the steam list of servers, but in game do i have to do something differently to have the dedicated server be visible to the players trying to join the lobby?

agile leaf
#

Jumping is super jittery on vertically moving platforms

lament flax
#

after maybe 30s of going in a straight lines my client doesnt see the floor static mesh of the level i stream in.
its weird because

  • other actors are loaded (maybe its because they are reped, unlike the floor static mesh)
  • the server is next to the client, so it should be relevant
muted reef
#

How can I get the host in listen server from BP's ?

sinful tree
feral narwhal
#

What would be the best approach to store data across levels? For example if I wanted to have different minigames and across all the levels I want to keep track of the players who are still alive.

#

Some sort of master game mode that keeps track of all that maybe

sinful tree
warm sage
#

how can i select a random player as a role, for example the killer in blueprints

sinful tree
glossy gate
warm sage
knotty bane
#

Dont know in wich channel to put this but is VOIP talker still commonly used in mutliplayer games that consist of max 4 players in a game

sinful tree
# warm sage ok sorry if im new but what is gamestate and how do i access it

If you're new to Unreal, you probably shouldn't be tackling multiplayer just yet as you're adding an additional layer of complexity to your learning that can end up hindering your progress.
That said, gamestate is a replicated actor that is meant to hold information about.... The State of the Game. Where GameMode may be considered the holder of "rules" about the game, it is not a replicated actor and is only available on the server so it's not a useful place to store say, a replicated match timer, or team scores.

A GameState is automatically created for you by the engine by your game mode and can be accessed by using "Get GameState" in blueprints. You can also subclass it if you want to (it's not specifically necessary to do so!) so it can hold additional properties and functions, but then you have to configure the game mode you're using to utilize your specific game state.

agile leaf
#

Does anyone have experience using the smooth sync plugin?

sinful tree
#

Yes, you could do that. ๐Ÿ™‚

warm sage
sinful tree
glossy gate
# sinful tree Do you have movement marked as replicated on the card actor?

nope. I discovered that the problem that I have it's because of the AddCardToHand function, that attach the card to the pawn and makes the location to be the one on the server. makes sense because it's called from the server. so I'm trying to do something like this:

void UTHandComponent::AddCardToHand(ATCard* InTakenCard)
{
    UE_LOG(LogTemp, Warning, TEXT("AddCardToHand"));
    TakenCard = InTakenCard;

    if (GetOwner() && GetOwner()->HasAuthority())
        OnRep_TakenCard();
}

void UTHandComponent::OnRep_TakenCard()
{
    UE_LOG(LogTemp, Warning, TEXT("OnRep_TakenCard"));
    if (TakenCard) {
        HandCards.Add(TakenCard);
        TakenCard->AttachToActor(PlayerController->GetPawn(), FAttachmentTransformRules::KeepWorldTransform);
    }
}
#

but there's something with the logs that I'm not getting. I'm calling for the 4 playercontrollers that I have the AddCardToHand function. that should provoce 16 logs on the onrep takencard shouldn't it if I'm also calling this:

    if (GetOwner() && GetOwner()->HasAuthority())
        OnRep_TakenCard();

like, in my mind I was expecting one log of the addcardtohand and another 4 of the onrep_takencard, but instead I'm getting this:

LogTemp: Warning: AddCardToHand
LogTemp: Warning: OnRep_TakenCard
LogTemp: Warning: AddCardToHand
LogTemp: Warning: OnRep_TakenCard
LogTemp: Warning: AddCardToHand
LogTemp: Warning: OnRep_TakenCard
LogTemp: Warning: AddCardToHand
LogTemp: Warning: OnRep_TakenCard
LogTemp: Warning: OnRep_TakenCard
LogTemp: Warning: OnRep_TakenCard
LogTemp: Warning: OnRep_TakenCard
sinful tree
glossy gate
#

yeah, I'm calling this on the server side:

for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator) {
    if (ATPlayerController* PlayerController = Cast<ATPlayerController>(Iterator->Get())) {
        for (int8 i = 0; i < 1; i++) { // It deals 4 cards
            if (Cards.Num() > 0) {
                ATCard* Card = TakeTopCard();

                if (UTHandComponent* HandComp = PlayerController->FindComponentByClass<UTHandComponent>())
                    HandComp->AddCardToHand(Card);
            }
        }
    }
}

(I cleaned the innecessary code to be more clear)

#

that's where for my 4 players controllers I call the AddCardToHand function that makes the OnRep call by changing the TakenCard function

worthy hound
#

Hello, I am new to unreal multiplayer and would like to ask what I'm doing wrong here? Whenever I try to change the player max speed it would jitter and lag. What's the correct way of doing this?

undone granite
#

Hello.
I would like to spawn units, and when i do, in the constructionscript of my Master Unit /Building (the parent classes)
I would like to set an integer to the team number (1 to 8) to whoever "controls" and "spawns" these units on the map.
How would i go about it?
Would i cast to the player controller?

sinful tree
sinful tree
undone granite
#

it can be more than 1 actually

#

so its better if i can set it up custom, based on my lobby settings, which i previously send to the game instance.

worthy hound
twin vessel
undone granite
#

so i have "player1team" as a string in my game instance from the lobby selection.

undone granite
#

theoretically it could be 3 vs 5, or 7 vs 1.

#

so its better if that remains "flexible", still, reading out the controller and looking for that property in game instance,
i should find the correct team assigned.

#

i just need the first object to look for, so i end up in the game instance, but i need to know which player spawned the unit.

twin vessel
# worthy hound And how do I do that?

Make a function for the logic (everything from the first brach on) and call it on both the client and server event

So server rpc event runs function, then calls client rpc event which runs the function again

sinful tree
worthy hound
sinful tree
#

You cannot properly replicate changing speed in blueprints. Once you introduce even minimal amounts of latency, you'll start to get rubberbanding or jitter. C++ and modifying the CMC to accommodate the movement speed change is the only way to ensure no jitter or rubber banding occurs unless in extremely bad network scenarios.

worthy hound
twin vessel
sinful tree
#

No.... If you modify the CMC, there will be no corrections required.... If you modify the CMC's code you can insert when the movement speed was increased on the client, and the server will know when that movement speed change request was supposed to take place, and can continue to accept the movements being requested of the client without any corrections.

twin vessel
sinful tree
#

Agreed ๐Ÿ˜›

twin vessel
#

I was suggesting that the constant jittering they were experiencing was due to the client having a velocity and the server never making the same change, causing them to never reconcile

worthy hound
# twin vessel

I tried this but the rubber banding jitter is still there. Am I doing something horribly wrong?

sinful tree
#

What I'm getting at tho, is that if someone is going to be building a sprinting system with blueprints, they're going to run into problems all along the way. Someone moving forward and pressing the sprint key while doing so with minimal amounts of latency? Rubber band. Someone frequently tapping the sprint key? All kinds of bouncing around. Players can be accepting if they get their movement shunted by something and getting a correction... Most players can't stand if they are pressing an input and it's either laggy to respond, or it starts spazzing out.

worthy hound
twin vessel
worthy hound
twin vessel
worthy hound
#

Do I need to restart the project to use C++ instead of BP? Or can I have both?

sinful tree
# worthy hound Is it better to just learn C++ and do it like that or should I keep doing it wit...

Grand scheme of things.... If you're going multiplayer, you probably will want to learn C++ at some point anyway as not everything you may need to do to get your multiplayer project working is exposed to blueprints. If your project is just a testbed for now and you're just learning some multiplayer functionality, then just doing it the blueprint way is fine.

But if you're intending on releasing this game.... Movement is usually a pretty big deal when it comes to games. Players want things to be snappy and responsive when it comes to how their character moves otherwise they'll feel like they don't have control, and can end up feeling cheated if they lose or get killed or whatever, and it can really put players off. The CMC is a BEAST and is probably one of the most complicated things to mess around with and I wouldn't even bother trying to learn C++ by modifying it.

#

You can release a multiplayer game with everything done only in blueprint.
You can use both blueprint and C++ and usually this is what is recommended as using only C++ would be borderline insane as you'd have to hardcode asset references and iteration time would be atrocious just to change values.

#

The C++ part of things lets you tamper with code and do things that just aren't available in blueprints. Luckily you can expose such functionality yourself to blueprints.

worthy hound
#

Alright. So the way to go is to learn enough C++ to expand the base CMC to fit my needs and make my life and replication easier. Do I understand that right?

sinful tree
#

I'm not sure if learning enough C++ to expand the CMC is making your life any easier.

#

If you wanted life easier, then you would stick with the blueprint method of doing it.

twin vessel
worthy hound
sinful tree
#

Open up CharacterMovementComponent.cpp and see.

#

Vaei's solution there appears to get the sprint portion done in about 300 lines which isn't too bad. The CMC itself is about 13k lines, but based on how the file looks, at least 1K lines if not more are just comments describing how it works. That's not including the 3k lines of the .h file either.

worthy hound
#

Okay so... When I open up the CMC in C++ from the viewport do I just start writing or is there like a thing I have to do because the Cpp is empty

plain gorge
#

So having an issue with instanced static meshes in multiplayer.

Basically I spawn a bunch of ISMs at game start and then when the player goes near them I turn them into actors.
These ISMs only show up on the server but if the server gets close enough to turn them into actors they appear dfor the client and if the client gets close enough they appears. So the client seems to know where they are but it isnt rendering them when they are ISMs. ANy help would be much appreciated.

#

I've also tried

  • Spawning on server or client
  • Setting replicate on every component and the actor itself
  • A bunch of other random stuff ๐Ÿ˜…
thin stratus
#

BeginPlay into ServerRPC makes no sense. And ISM aren't replicated, you have to fully handle that yourself.

#

Turning Actor/Component Replication on doesn't change that they aren't set up to replicate.

glossy gate
#

I'm calling in the server this function one time and I'm getting this logs

LogTemp: Warning: SERVER: AddCardToHand
LogTemp: Warning: SERVER: OnRep_TakenCard

The function:

.h
    UPROPERTY(ReplicatedUsing = OnRep_TakenCard)
    TObjectPtr<class ATCard> TakenCard;
    UFUNCTION()
    void OnRep_TakenCard();

.cpp
void UTHandComponent::AddCardToHand(ATCard* InTakenCard)
{
    UE_LOG(LogTemp, Warning, TEXT("%s: AddCardToHand"), GetOwner()->HasAuthority() ? TEXT("SERVER") : TEXT("CLIENT"));
    TakenCard = InTakenCard;

    if (GetOwner() && GetOwner()->HasAuthority()) 
        OnRep_TakenCard();
}

void UTHandComponent::OnRep_TakenCard()
{
    UE_LOG(LogTemp, Warning, TEXT("%s: OnRep_TakenCard"), GetOwner()->HasAuthority() ? TEXT("SERVER") : TEXT("CLIENT"));
    if (TakenCard) {
        HandCards.Add(TakenCard);
        TakenCard->AttachToActor(PlayerController->GetPawn(), FAttachmentTransformRules::KeepWorldTransform);
    }
}

should'nt rep notify give me this logs instead?

LogTemp: Warning: SERVER: AddCardToHand
LogTemp: Warning: SERVER: OnRep_TakenCard
LogTemp: Warning: CLIENT: OnRep_TakenCard
LogTemp: Warning: CLIENT: OnRep_TakenCard
LogTemp: Warning: CLIENT: OnRep_TakenCard
thin stratus
#

fwiw, Taking a Card is not a State but an Action and should probably be an RPC instead. Or you change the "HandCards" to be Replicated instead.

#

Don't really see the reason to replicate TakenCard over HandCards in the first place.

#

Also make sure TakenCard is actually replicate via GetLifetimeReplicatedProps.

#

And that UTHandComponent is set to replicate.

glossy gate
#

like, the cards when are attached to the playercontroller, because it happens on the server, it spawns on the server position of the deck, instead of the client one

dark edge
dark edge
glossy gate
glossy gate
dark edge
#

An onrep being called TakenCard is certainly a smell

#

the STATE is your hand, right? The cards in your hand are the state

#

First off, how many places can cards be? The deck, a hand per player, and in play on the table, right?

glossy gate
#

yeah

dark edge
#

so it should be like GameState.OnRep_Deck and PlayerState or Pawn.OnRep_Hand

#

When the hand has changed, do thing

#

that's how you'd do it statefully.

#

"taking a card" would be removing it from Deck and adding it to Hand.
OnRep_Hand would fire, you'd notice there's a new card, you play the animation for taking that card from the deck.

glossy gate
#

oh, so use an onrep on the tarray of cards (handcards) and then in there do the thing that I want (like maybe attach it to the pawn like I was trying)

dark edge
#

the fact that your hand was:
3H, 4H, 5C
and now it's:
3H, 4H, 5C, KH
means you should play an animation drawing the king of hearts from the deck

#

If it's meant to be a multiplayer cards game you'd certainly not want to replicate stuff people shouldn't know (other peoples hands) but that's the gist of it

glossy gate
#

oh, I think I get it now. thanks :) but If I have my TArray<TObjectPtr<class ATCard>> HandCards; on the UTHandComponent, should I have the OnRep_Hand in the ActorComponent not on the pawn or I'm getting it wrong?

dark edge
#

You can have it wherever, this sounds really OOPy as you've got it set up so I can't really comment on that. This whole game could be as simple as a couple arrays of structs hanging around.

#

The simplest possible setup that would result in being able to play cards and not cheat would be like:
GameState:
TArray<CardStruct> Deck //not replicated, maybe something indicating its size can be replicated
TArray<CardStruct> InPlay //replicated, repnotify

Pawn/PlayerState:
TArray<CardStruct> Hand //replicated to owner only, size replicated to all, repnotify

#

Anyway, you want to choose whether or not you want the game flow to be all event based, or state based. I'd default to state based wherever possible.

glossy gate
#

okey, thanks for the info.
but, I don't get the doing the cards as a strcut. like, it should be a present actor in the game. how would the struct work?

dark edge
#

It's more a taste thing

#

it's pretty easy to make a BP_CardVisualizer to represent a card

#

just feed it the suit and rank and it's the King of Hearts

glossy gate
#

okey, I think I get it now

#

thanks :)

kindred widget
#

What happens if you make it const by ref?

#

That's odd. You're 100% sure the client had anything set before this onrep?

mystic estuary
#

Hello, I'm trying to get ping of a player, but I'm getting the result of a server. So, I have two players, a listen server and a client. When I look up for listen server ping both listen server and client side, I get 0, whereas client's ping for client and listen server is around 100. I'm using APlayerState::GetPingInMilliseconds() for that. Does anyone know why it's returning the same thing no matter the machine? It happens both in standalone game mdoe and packaged build using steam

grand kestrel
#

@thin stratus I could use some help with giving client authority for a while after snare is applied. Basically, sending the net correction that sends the snare, also sends the location, which gets applied to the client latency seconds in the past so client auth doesn't stop de-sync. I'm actually about to go to bed, so not in any rush for a response lol.

Here is the full investigation/information:

ServerMoveHandleClientError() compares current Snare with the Snare from the old move data, so we know its going to change and get sent to the client within the same frame.
So if we give the client location authority here, it shouldn't de-sync.

I gave the client full authority by always applying the client's location in ServerMoveHandleClientError(), for debugging purposes.
And I tested it by running into a bunch of physics simulated cubes which always causes massive de-sync. It worked as intended; no de-sync.
When the snare changed on the server and triggered a correction, it would de-sync the location regardless, despite applying the client's location every frame.

So I started from OnClientCorrectionReceived() and walked backwards, to find the data was filled from ServerFillResponseData()
This sends a PendingAdjustment (as ClientAdjustment). With a location. The location will then be applied latency seconds in the past to our client!
It routes to ClientAdjustPosition_Implementation() where it gets applied.

Unfortunately, it appears to send corrected locations before we even receive the snare in ClientAdjustPosition_Implementation(). Which is really confusing. So the option of sending client auth alpha is out the window. Not sure where to go from here.

sinful tree
mystic estuary
#

Yes, I do

#

Also here are the screenshots for what I mean

warm sage
#

im using the eos onlie subsystem and when my friend trir my game and logged in he gon this message. how do i solve this?

warm sage
#

ok hew got in, he presses join on the server that comes up and it prints joining succes but he still in the lobby map. Why is he not in the game map?

dark parcel
#

maybe you never travel to the server's map?

dark parcel
queen escarp
#

nm*

thin stratus
#

Person needs to share their Host and Join code to help.

grand kestrel
#

@thin stratus I think using OnClientCorrectionReceived for Stamina was slightly wrong, it probably should have been ClientHandleMoveResponse
It gives us the FCharacterMoveResponseDataContainer
It doesn't really matter, but when doing client auth I can block the corrections applying to the client in ClientHandleMoveResponse, but its too late in OnClientCorrectionReceived

thin stratus
#

Iirc the container is actually made available all over the CMC when receving it

#

Same on the Server-side

#

There is not really a need to do it right where the container is passed in

grand kestrel
#

Yeah you can get it from GetMoveResponseDataContainer(), sure

thin stratus
#

Yeah Server-side is even build like that cause it runs multiple different Moves

grand kestrel
#

But if you do it in ClientHandleMoveResponse you can also check if its about to change

#

You weren't wrong btw, it makes no difference for Stamina, its just 'technically correct' to do it here
For modifiers it will matter a lot ๐Ÿ™‚

#

It also lets me get rid of this ugly preprocessor lol ๐Ÿ˜„

thin stratus
#

Cause I'm relative sure there are parts in there that you'd need to re-do in your child class

grand kestrel
thin stratus
#

Yeah, that's why I wouldn't override that

grand kestrel
#

That's exactly why I want it, its applying the client's own location to itself latency seconds behind
This is just me experimenting atm, but I need to stop it doing that for client auth

#

ServerMoveHandleClientError() compares current Snare with the Snare from the old move data
So I give the client location authority here, for x time

When the snare changed on the server and triggered a correction, it would de-sync the location regardless, despite applying the client's location every frame.

The data is filled from ServerFillResponseData()
This sends a PendingAdjustment (as ClientAdjustment). With the client's own location (because client has auth)
It routes to ClientAdjustPosition_Implementation() where it gets applied, latency seconds in the past, causing severe de-sync

By overriding ClientHandleMoveResponse, I can gate the location correction specifically on the frame we send the Snare to the client

#

That said, there are probably conditions where we want to be able to correct other stuff as well as Snare

grand kestrel
#

Especially thanks to the ServerGravityDirection lol

#

It seems doing this is sufficient, but I do think there might be edge cases where something else like velocity de-syncs, not actually sure, will need testing

magic karma
#

Hey if anyone has made a dedicated server with EOS before could you help with the question I posted in online-subsystems?

clever hound
#

Why does Lyra the example project not have any RPCs or replicated variables, I was gonna check some client prediction stuff on there but is it not good example for that even tho it seems to work well in multiplayer?

#

The multiplayer stuff seems to be hidden somewhere or smth

storm bough
#

Hello,
I have hitscan weapon using trace to determine if it hit something. Characters (just your standard UE5 mannequin) are configured so trace hits actual mesh and not capsule.
I've noticed that in multiplayer there are some discrepancies between results of trace on server and on client. It works fine for level geometry or if capsule is used for collision.
Is there any reasonable way to have consistent results in multiplayer using actual mesh collision?
Do I have to forget about hitting actual mesh in multiplayer?

clever hound
storm bough
clever hound
#

The discrepancies are caused by lag ofc

storm bough
#

granted, in actual gameplay enemies arent gonna stand still and wait nicely for you to pepper them with shots but still

#

I can guess same issues can happen even with capsule, but will be less noticeable

clever hound
clever hound
#

If it is a capsule or a mesh

storm bough
#

I think with mesh it will be more noticeable due to mesh animation and small size of parts

#

anyway I will try to use mesh, in worst case I will just fall back to capsule

#

thanks for answer

clever hound
#

Yes if you use the mesh for more detailed features like body part hits then it will be completely different system from the capsule

storm bough
#

any advice to at least make it more consistent? I mean, headshots and the like might be problematic with these discrepancies

cobalt notch
storm bough
#

oh, server absolutely decides about everything

#

issue here is that with these discrepancies host of game will have advantage over rest. It is not that big issue, my game is intended to be coop but still

cobalt notch
#

Yeah so the server decides that enemy got hit then they should see blood, end of story. In Listen server the host always has advantage you can't avoid this.

storm bough
#

there is no point in sending data about blood splatters

#

it does not affect gameplay

cobalt notch
#

I mean they can totally cheat if htey want to server authorititive means nothing if you're the server and playing the game you can totally cheat. Nobody can stop you from this. Yo'ure not sending blood splatters but the client won't know, on your own machine you can show the blood immediately depending on how you're doing this. For the other player it doesn't make any difference at all and this is not an issue for them 'cos anything for them will happen after the server decides.

storm bough
#

Well I guess I will live with that and I will see how it will work out when game is fleshed out (right now I am experimenting with multiplayer features in separate project).

exotic wasp
#

if you want it to be server authoritative, it'll be cheatproof (if you care), but will be laggy looking on the client and give weird results even under pretty standard network conditions

#

you can implement a rollback system where you store the positions of actors over some period of time and when the client claims it hit something, verify it on the server to see if it was possible

#

option 1 and 2 are easy but have downsides. option 3 is more difficult but gets the advantages of both option 1 and 2

storm bough
#

I really, REALLY would prefer to stay server authoritative.

#

And that rollback system sounds like a lot of work.

cobalt notch
dark parcel
storm bough
#

yep, because server is what counts

dark parcel
#

you can validate on server

#

Thing is, your player will not be as forgiving

#

if they have low latency and get a headshot but server says no you didnt hit anything

#

they will feel cheated and uninstall the game

#

especially for fast pace moving game, I think having a balance is important

#

if the client is too laggy and their hit invalidate, then they can say, ok It's my fault I just need better internet

#

but if they have 20 ms and they didn't get the headshot, they will not have a good experience

eternal tartan
dark parcel
storm bough
devout sonnet
exotic wasp
nova wasp
#

it's not just one thing though

#

there's a different between the collision for the hit happening locally and having to wait for the hit being confirmed

#

for example: shoot at target on client -> bullet instantly fires and hits + makes vfx

#

then server round trip later: you get a "did damage" indicator (hitmarker, health changing whatever)

#

would you consider that client side or server side? It's kind of both in that case

hollow ore
#

Hi everyone, not sure if this is the right place to be asking it (so please forgive if it's not) but I have a question about switching between multiplayer and singleplayer on a project:

The question really boils down to "is it possible?" I'm working on a single-combat system that should allow for the option to fight against another player using the server/client with multicasting. However, it also should allow the option to play as a standalone game where the player just faces off against a bot.

So far I've tried creating different levels to see if that distinguishes it (doesn't appear to do so), as well as looking for any nodes in blueprints that could potentially change the number of players (I couldn't find any).

Any help would be appreciated

nova wasp
#

and no adding multiplayer later on is not so simple, you will have to re-do a lot of things to consider the different situations of simulated proxies vs authority

#

I can't tell if you mean the act of adding multiplayer to a project that was coded with singleplayer only in mind or switching between the two at runtime

hollow ore
nova wasp
#

So would one player join the other's server?

#

Plenty of games just let you define if it's a hosted game or a bot game before starting a server

hollow ore
nova wasp
#

I am not sure what you mean by multiplayer options, I think in general with the defualt setup you either have a listen server or a dedicated server

#

I am not sure how host migration would work in unreal if at all

hollow ore
#

I'm referring to these settings for multiplayer options

I suppose as a temporary option I could just make it so that the second player does nothing in singleplayer mode (for reference this project is an assignment that needs to demonstrate both multiplayer and AI work so it doesn't need to be a perfect fix).

nova wasp
#

other players can join your listen server?

hollow ore
#

it's all meant to be local multiplayer using multiple PIE windows (more akin to splitscreen than multiplayer, but still requires separate windows).

nova wasp
#

I'm not sure if the engine supports local multiplayer with multiple windows or not outside of the editor running multipe worlds

#

I don't understand why you left out this was for local multiplayer until now, generally multiplayer refers to networking here

#

but this channel does say "local and online" so it's my fault for making the assumption I suppose

hollow ore
#

ah sorry, my bad should have been clearer on that. Thanks for the help regardless, I should be fine to find a solution now

exotic wasp
#

i wouldnt intentionally try and make a game that uses play in editor

#

feels... wrong?

#

if you want different processes, just make it a dedicated server

hollow ore
nova wasp
#

it is a strange feeling having people ask questions about school assignments in here lol

#

nothing wrong with it I suppose but it's funny seeing it become a curriculum

cobalt notch
#

I think they just mean they do not need you to package the game, they'll just run it in PIE

hollow ore
cobalt notch
# hollow ore thatโ€™s what Iโ€™ve started doing lmao. Iโ€™m just making the single player mode have...

No you do not spawn the second player.. just set Number of players 2 players in the play menu you posted and it will open the second player which is the only player you have set in the gamemode, this spawns automatically, nothing you need to do. This will make your editor window the first player and the other is the popup window they're referring to which opens when you click play, they will put that on another monitor, that has the second player. When the popup window has focus that gets inputs. Also do play as client, this is more important 'cos listen server will be harder to do and standalone doesn't do this automatic second player.

#

It's probably not a great starting assignment to ask to do multiplayer.. what is this? a school for ants?

balmy gazelle
#

Whats the actual owner of the actors placed in the editor over the world at a multiplayer listen server session ? Each client is owner of the actors or just the host ?

dark parcel
#

not much cases where you need to have the client own some pre placed object in the level. That will count as vulnerability

#

at most, maybe a weapon they hold. You can set owner with the set owner node, but that must be done by the server.

balmy gazelle
#

what happen with the check as non replicated actors ?

#

those live per client so the client is the owner right ?

dark parcel
#

owner in what sense tho?

#

if the object is only local to their world

#

owner doesn't mean much

#

you can't call rpc on it or anything

#

the term owner has no meaning in the context you put it, imo

balmy gazelle
#

right, so if you check the owner on a non replicated actor the return will be null ?

dark parcel
#

I don't know, I would assumed so. Haven't test it since I don't see any point.

#

Ownership only relevant in networking environment

balmy gazelle
#

right, don't make much sense if you know beforehand the ones that aren't replicated so

dark parcel
#

and by default, as the client you own the controller and the character

tardy fossil
#

The owner is replicated, but if something is owned by a playercontroller, it will show up as a nullptr on clients because player controllers only exist on the server (except for the client playercontroller)

balmy gazelle
#

yeah I was thinking more on world placed actors, non relatedwith the controllers or so, just actors as can be a barrel or whatever

dusty halo
#

I'm confused, why that cube keeps replicating? I ieven added authority check lol and it still replciates. I need few actors to be visible only for owning client and I cant figure out why this is not working

sinful tree
chrome bay
eternal tartan
chrome bay
#

Am I losing my mind or does Blueprint Graph not support byte-based masked enums? I swear it did before..

tardy fossil
#

you mean this?

#

meta = (Bitmask, BitmaskEnum = EGUIMode) in a UPROPERTY of a int variable can do that

#

ohh byte based

chrome bay
#

Yeah, for uint8. I swear it used to work, though I do remember adding it myself. Thought I'd removed it because they added it sweeney_activate

dusty halo
stray bridge
#

anyone have some high level pointers of how to handle projectiles?

this is how my system currently works. predictively spawn projectile on client then rpc to server. spawn on server using same transform as client though checking the transform so itโ€™s close to what server has to prevent cheating. then multicast to all other clients and spawn using same transform.

is there better stuff i could add to this or better ways of doing this. goals are to closely resemble what client sees and server sees as well as limit bandwidth from server to clients

stray bridge
#

nvm chatgpt helped a lot with this probably most things i wonโ€™t implement but one thing that sounds great is interpolated the client side projectiles towards the server projectile so they match up

rustic sable
#

when applying an impulse to a static mesh in an actor locally it looks correct but doing it on the server with the mesh replicated, actor set to replicate and replicate movement, it jitters like crazy, any reason this would happen?

#

the actor is just a static mesh component. disabled all collision on it, tried it as a physics body and world dynamic,. Collision is query and physics and simulation on

exotic wasp
#

predictively spawned and then reconciled it's position on the client after the server projectile replicated down

stray bridge
#

what to you do to match these up just assign an id or something?

exotic wasp
#

yeah it feels really awful to have a delay when spawning

stray bridge
#

yeh the delay was horrible when i tried just this

exotic wasp
#

i bound them together using a subsystem with a TMap of delegates keyed by id

#

i used the projectile movement component, but in hindsight I think I would've used physics instead. it was really annoying trying to interpolate the projectiles mesh on the client

stray bridge
#

hmm ok. what was annoying about the projectile movement component that you think physics wouldโ€™ve solved? i wonder if replication is worse or better

exotic wasp
#

the position of the projectile only gets updated every net update. which makes it look kinda jittery so you have to interpolate it's position. the pmc has that functionality built it but it's kinda poorly documented

#

i believe physics automatically interpolates/extrapolates

#

honestly, if you know the exact use case of your projectile you can probably get by without replicating it

#

i would still be concerned with false hits

stray bridge
#

mine are sort of slow moving so itโ€™s important to match them up since it would be hard to know what it might hit when itโ€™s first shot

#

so the only thing iโ€™m thinking and iโ€™m not sure if the game will be p2p or server so iโ€™m building for both currently but with doing it as a physics object itโ€™s probably more expensive and less scalable on the server so probably worth dealing with the interp issues on projectile movement component since itโ€™s so much cheaper right?

#

Yeh this is just one of my goals is to keep the server costs low and bandwidth at a minimum

#

might be hard to avoid replicating these though

worthy hound
#

Thoughts?

edgy yacht
#

hey guys, sorry to bother you I have a really weird problem : I'm building a TopDownShooter game and when pressing my ability (which here, just display a GameplayCue) my GameplayCue position is correct on both Server and Client and so on all screens. BUT the GameplayCue ROTATION is correct ONLY on the screen of the player pressing the ability. But on the other screen it's like Z = 0. The print string is correct tho, for both client and server. How can I fix this?

#

I tried with actor transform, world rotation (mesh) and world rotation (capsule component), and I have the exact same prob

#

My net mode is set at "Play as Client". If I set it as "Play as Listen Server", the listen server sees the correct rotation, but not the other clients anyway. I don't understand why Location is well replicated but not the Rotation

twin juniper
#

could be a glitch depends on the version your using

twin juniper
#

try with 5.2

#

i noticed doing retarget and stuff worked better on that engine

#

kinda wish fab wasnt a thing it breaks alot

edgy yacht
#

Iโ€™m really surprised that UE3 has prob with such basic things like replicating rotation to other clientsโ€ฆ

twin juniper
#

i couldnt really do anything with 5.3

#

the retarget system was diffrent

dark parcel
#

Your grievance doesn't seem to be related at all though, just saying.

edgy yacht
dark parcel
#

Gas have built in functions you can use. Look up target data

#

Though I deleted it because when I look into your code, you are just getting the characters location

#

If you get the character location on activation, you will end up having the location of the executing machine (which is fine depending on the context)

edgy yacht
dark parcel
#

Try get actor location btw

#

@edgy yacht I don't think rotation is replicated by default

edgy yacht
dark parcel
#

I mean that depends on your movement logic I guess. Like how you want the turn to happend.

#

There is multiple way of rotating something depending on the style of the game.

One of them is by ticking use controller desired rotation

#

That will rotate the capsule in respect to the controllers rotation (basically where the player is looking at)

edgy yacht
#

my game is a topdown shooter, and the character is always looking at mouse location

dark parcel
#

Well perhaps you need to replicate that. The gameplay cue aside, have your character rotation gets replicated successfully?

#

Test the game with multiple players

#

Check when client shoot and face a certain direction, does it do the same on server

edgy yacht
#

the character rotation is replicated successfully

dark parcel
#

Then it shouldn't give you 0

edgy yacht
dark parcel
#

Print out the rotation on tick. Observer the value on both server and client.

edgy yacht
#

again, when I'm printing rotation, it is not 0. But the gameplayCue direction is 0, where it should follow the rotation

edgy yacht
dark parcel
#

I see, well I have no idea then.

#

Haven't yet to use gameplay cue or gas much.

edgy yacht
#

okok thx still !

worthy hound
#

Hello. I wanted to ask why I was getting the same widget twice? Am I doing something wrong?

dark parcel
#

You did something wrong if you don't get the result you desired.

worthy hound
#

Well... Yeah but I don't know what I did wrong. That's why I'm here.

dark parcel
#

I can see you have 2 players

#

Each running create widget on what ever event you have

#

You need to look at is locally controlled node.

#

This can be used to filter codes to only run on actor you controlled.

#

So for player 1 character, run it only for his character. Don't run the create widget on his machine for every character in existence.

#

I suggest to read exi compendium pinned in this channel.

Knowing how to run codes on which machine is very important for multiplayer.

#

For now you can just do.

Begin play, is locally controlled, if true, create widget

#

No need for rpc

#

Unless you need the server to explicitly call it. But then again if it's just a hud that show hp, you can just display that whenever your character is up

worthy hound
#

Oh okay. Thanks

dark parcel
#

Btw begin play is mostly the wrong place to do things in mp, I am just giving a short example

#

Once you get it working, you should read exi compedium

ripe lotus
#

Hello, is there a way to temporarily skip replication of a level sequence actor during re connection?
or make it skip triggering all the events?
I have a sequence that's very long, and has a ton of events.
when reconnecting i've noticed that it is as if it's sweeping the sequence and replaying all the events, causing serious instability.

rare wharf
#

hey all not sure if this belong in this channel but doing MP and getting this weird error message, not sure what it means and everything works fine but getting this error, looked online and just said to plug owning player to self

rare wharf
sinful tree
# rare wharf

Begin Play can fire on clients and the server.
Since this event will ultimately execute on the server, then it can't create the widget with "Self" going into the create widget node, as the player controller may not be a local player controller if it's a client owned player controller.

rare wharf
#

for the player controller what was the "begin play" for the MP alternate

#

i thought it was possess right?

sinful tree
#

Begin Play = the actor comes into play. There is no alternative that I'm aware of. The issue is not so much that you're using begin play, but that you're trying to create a widget with an owning player == self while executing on the server when self may not be a local controller.

#

Basically what you're doing here is....
ON SERVER:
When Player Controller starts existing execute SR_DEBUG Event
SR_DEBUG Event > Create a widget with Self (this instance of player controller) as Owning Player

ON CLIENT:
When Player Controller starts existing, request server to execute SR_Debug.
SR_DEBUG ON SERVER > Create a widget with Self (this instance of player controller) as Owning Player

So for a client's Player Controller this code will actually execute twice on the server since that Player Controller will exist on both the client and server, and since it's a client's player controller, the "Self" can't be properly used for creating the widget since it wouln't be locally controlled on the server.

rustic sable
#

is there any nice way to move a niagara system on a client where you want the location to match a replicated static mesh component? obviously you can't replicate the niagara component and the only other thing I can think of is to constanly multicast the location

#

I guess I could just keep updating a position vector of the mesh component position with an onrep but not sure if that's any better ๐Ÿ˜…

ripe lotus
exotic wasp
#

or attach it to the static mesh

rustic sable
#

it is attached but the mesh is also replicated and the niagara component doesn't exist on the server

exotic wasp
#

i don't think that should matter? you can have non replicated components on something that is replicated

#

are you moving the mesh itself or it's actor?

rustic sable
#

the static mesh simulates physics and is replicated, the issue is even if you attach a niagara component to it, it won't spawn on the server so there's no location data for the client to use

#

hence thinking of a workaround

velvet current
#

Is there an industry-accepted amount of packet loss to try to build for? As a player I'm ideally having 0%. Past a few %, fast games like rocket league are unplayable. Is there a certain % of packet loss I don't need to bother testing for?

sinful tree
#

Even continuous 1% is terribad.

twin juniper
#

Is packet loss just some TCP connections that failed and need to resend the info?

sinful tree
#

If someone has that kind of packet loss, that's something they need to fix themselves and not something you can really compensate for. All you can do is code your game in such a way that the server and game doesn't break in case someone is having bad packet loss. It may screw up a single client's experience, but it shouldn't screw up everyone else's, if that makes any sense.

sinful tree
# twin juniper Is packet loss just some TCP connections that failed and need to resend the info...

Packet Loss = Packet not received which can happen for a wide variety of reasons, like noise on the line at the time of transmission, overloaded networking hardware, WIFI signal temporarily dropped. Unreal uses UDP which on its own normally doesn't care about packet loss as there is no acknowledgement of packets, it just keeps transmitting, but while Unreal uses UDP, it does have its own acknowledgement systems in place that it uses over UDP which will retransmit things in case there is some problems.

twin juniper
shadow shard
#

Hello, what is the proper way of doing client side prediction in blueprints, lets say for example shooting with a gun

exotic wasp
#

pretty sure packet loss isn't something you can mitigate? its usually because of network conditions

ruby ferry
#

Hello!
I have a question about Data Assets.

I'm currently working on a project where I want players to be able to choose a weapon before joining a session.
On Event HandleStartingNewPlayer the server gets the selected weapon from the client and grant the necessary abilities + spawn the adequate mesh to the player.

As a test, I'm trying to set a default Weapon Data Asset from the server to the client.
However, it looks like that when I try to replicate the weapon Data Asset to the client player, it is null.
The component WeaponManager is set to replicate and the Weapon DataAsset set to replicates with RepNotify, but the rep notify never get triggered on the client.

  • Is there something I am misunderstanding about the use of Data Asset?
  • In the future, from where can I get the selected weapon information from a connecting client?
sinful tree
ruby ferry
sinful tree
sinful tree
#

What might be happening though, is you're using handle starting new player to perform this action. Are you certain the pawn is valid by that point?

ruby ferry
lament flax
#

And sometimes you want cpp speed

crisp shard
#

Sure this has a loaded answer but if I wanted to have players be able to go to a different / sub level from the main level , what would be the way to go about that? This would be a solo experience but maybe in the same world / level just a different instance

crisp shard
#

I guess I could just open a new level and have them leave the level theyโ€™re in

exotic wasp
#

i don't think unreal engine supports instancing

#

if you want to move everyone, you can just load a new level and either do a seamless transition or normal transition

crisp shard
#

What is the difference between seamless and normal?

chrome bay
#

Seamless means players stay connected while travelling. Hard travel disconnects from your current session

#

Rarely do you want a hard travel unless you are joining a new server

warm sparrow
#

im adding input mapping on begin play to the character class but 'is locally controlled' node returns false for the server's character. It works for the client character tho. How can I solve this? It works when i add a bit of delay before checking is locally controlled but that's still a sketchy solution as the race condition is still there.

lost inlet
#

you generally wouldn't add/remove IMCs in BeginPlay

warm sparrow
#

thats what i saw in the thirdpersoncharacter example but i dont know any better

#

how should i do this ideally?

lost inlet
#

I just override SetupPlayerInputComponent

#

BP mileage may vary if it's not exposed

warm sparrow
#

oh you use c++ then

crisp shard
#

Event receive controller change might be of help in your case. I believe this is what I changed my IMC to be at instead of begin play

crisp shard
lost inlet
#

well you might go insane doing replicated stuff BP only, but you'll have to use a place where you can guarantee that you can catch a valid controller where it matters

#

and that sounds like it could work

#

with BeginPlay, you may receive BeginPlay before possession

granite light
#

hi

#

I have a problem

#

The problem is that weโ€™re unable to connect through Multi-User Editing in Unreal Engine despite enabling the feature and entering the correct IP address, and weโ€™re using the same version of Unreal Engine. We also disabled firewalls temporarily, but the devices still arenโ€™t connecting or seeing each otherโ€™s sessions.

warm sparrow
lost inlet
#

well at least you don't need movement prediction

#

but above is a good example since there's no direct equivalent and then you have some advanced stuff like replication conditions

#

and replicated stuff can be even more spaghetti-like than normal

warm sparrow
dark parcel
# warm sparrow

Begin play is too early, the problem here is, the pawn isn't possessed yet in the client's machine.
Delay isn't a solution, it's a bandaid that doesn't even work since in real time you won't know the client's ping at the time begin play is called.

twin vessel
#

Is there a way to prevent a replicated actor to replicate the attachment?

kindred widget
twin vessel
#

I want some of the properties to be replicated, but not the attachment cause im predicting it

#

Idk if there is a better way to do it

odd locust
#

Im getting a join fail as soon as i search, the session is 100% hosting so does anyone have any ideas?

stiff thorn
#

(Posted this in #blueprint but will post here too for visibility)

Hey all, Iโ€™d love some suggestions on something Iโ€™ve come across for a board game Iโ€™m working on. Ive been trying to implement rolling dice with impulse, full physics. The issue is that it doesnโ€™t replicate accurately on other clients which means the results are always different than on the server-side. Besides a pre-determined approach where I would simply fake a dice roll with a timeline and some variable that has a result stored in it already, is it possible to get that physical aspect to replicate properly across all clients?

crisp shard
#

is it okay to stop player movement via a repnotify ?

thin stratus
#

If it's a one-time stop, no. If it's a State, yes.

crisp shard
jaunty totem
#

So I'm making a game where you play as a observer and a climber. So basically the climber can't see the obstacles in front of him you as the spectator have to guide him by just telling him where and what to do

#

My question is how would I render something visible for one player but make it invisible for another

#

But I need the one who can't see the things still be able to interact with it.

#

Like imagine a platform.

Player 1 can't see it but can stand on it

Player 2 can see it

honest bloom
#

use the Visible In Game checkbox for player 1 ?

#

Uhh to make it server authoritative, I'd say have a replicated variable which does uncheck the "Visible In Game" checkbox for the client 1 in the OnRep call

sinful tree
#

Alternatively, make the obstacle actors owned by the player that should be able to see them when spawning them, then click the "Only Owner See" on the meshes in your blueprint.

jaunty totem
#

or am i dumb?

jaunty totem
#

like stand on them, just not see?

honest bloom
#

yes, visibility doesn't affect collision .. it still works

jaunty totem
#

ah, i just assumed it turned off collision.. stupid me

exotic wasp
#

you could use the replication graph and only replicate certain actors to one person

#

or just hide it on one client

#

they could technically cheat and unhide everything, but do you really care?

jaunty totem
#

If i didn't replicate it to both a moving obstacle wouldn't move on the unreplicated player correct?

#

so visibility is better i think

honest bloom
#

I'm tempted to use the Mover or the UNetworkPhysicsComponent to make up my physics movement but unless the Mover has the same input buffering things for prediction as the UNetworkPhysicsComponent .. things won't be straightforward.
I guess I'll have to read both's source code ๐Ÿ˜ข

sinful tree
#

Cheating in a game like this would be akin to cheating in a game like Keep Talking and Nobody Explodes.

jaunty totem
exotic wasp
jaunty totem
#

^ excited for when this depreaches the normal one

exotic wasp
#

every time I have tried to use it my editor crashes, however

honest bloom
exotic wasp
#

pretty sure

honest bloom
#

sounds cool !

honest bloom
#

I remember reading somewhere else that it always crashes that way also

exotic wasp
#

it crashes me when I compile my BP unfortunately

bright summit
#

is mover 2.0 documented somewhere or not?

exotic wasp
#

not really, pretty much just the comment in its code

#

unfortunately not any resources online as far as I could really find

bright summit
#

I checked how it works,

#

it not

#

lol

#

prediction is so messed up

#

and this is only "average" network emulation

exotic wasp
#

it wasn't that bad for me. you probably need to configure the project

dark parcel
twin vessel
# dark parcel Spawn locally for the client that's doing the action right away. OnRep delete t...

Does not really work for my use case.
I need this for a weapon equipping system, where you have the weapon actors attached to different holster sockets of you character mesh, then you can put any of them on the hand socket, and put it back at will.
I want to predict the attachment for the local client, but for that to happen i need to avoid the actor's attachment to replicate.

I would like to not use just a locally spawned actor for every client, cause the event from which i'm spawning the actor is called only for server and locally controlled character.
But i guess it is the only way

lament flax
crisp copper
#

can you not pass actor object references through RPCs? as in are they local/different for each client? im trying to light a lantern on fire, and it works locally but isnt getting replicated, im doing a run on server and then into multicast, which then casts to my BP_lantern to call an event.

exotic wasp
#

you can as long as the actor is replicated or "stably named"

strong vapor
exotic wasp
#

im not aware of any other free "templates". theres gas companion which is a paid plugin that adds an immediately usable implementation of gas

mystic estuary
#

Hello, does anyone know whether the controller is always valid on a local client on begin play in case the character/pawn was spawned using restart player?

#

I'm trying to get my initialization going correctly, but it doesn't work on listen-server character because GM::RestartPlayer first spawns the player, and possess it afterwards. But client-side the controller seems to be valid on begin play. I want to know whether it's always the case

#

Tried with 500-1000 ping and 50% packet loss, and it's still valid. Gonna assume that it's always the case

nova wasp
#

In a way, the player controller is more or less the thing that holds the connection to the server

#

I'm not sure if you can gaurantee this 100% but in general after joining... you should have a player controller that knows about what it's connected to

#

The pawn will be sent from replication afaik and probably hooked up by delegates, I would recommend just breakpointing things like OnPawnSet etc

mystic estuary
#

Yeah, I know that PC must be present on the server in order to be even connected, but the thing is that a character might be not possessed at the time it's created. However, my little test has shown that it is possessed on begin play time for the local client

nova wasp
#

When the Pawn does BeginPlay it will be after it arrived from a network packet and set initial data

There are a few cases where inside of an OnRep-called function you could not have the Playerstate<->Pawn<->Controller member properties set but the object could still be there or part of the same packet

mystic estuary
#

Yeah, makes sense. Now that you mentioned that some data might be absent in the same packet that are related to the object that was created, I actually kinda have that issue that I fixed with some delay code. So, I have a struct that's set as RepNotify. The struct is initialised as soon as the game starts, and onrep it's called with the correct value server-side. However, client-side, the onrep has the incorrect value (the default one), but a few frames after it gets replicated, but no onrep is fired

nova wasp
#

Instead of a delay, you can just delay to the next frame and check for what you want to see and then just delay again if it's not present yet

#

Delaying is fine as long as you are actually continuing to wait upon them not being there and not just praying it will show up .5seconds later

mystic estuary
#

I have a Do N 10 with a delay of 0.5 on begin play

nova wasp
#

Okay, so if it has to wait more than that time the game just breaks? Unlikely but well, that's probably not what you want

#

something like the game feature init state thingy in Lyra basically just has a set of "states" an object can be in

#

Just about anything being set will pass-through the "is everything ready yet?" code

mystic estuary
#

It's not something really important, so it works for it. It pretty much hides an object if it was consumed. I don't destroy it because it might be reset

nova wasp
#

So that way there could be 3 things that can happen in any order, but the last of the 3 will see the other 2 are done and go "ready now" and you can actually let the player move etc

mystic estuary
#

In my case I only have one thing, so there's nothing else to instigate the Is Everything Up logic

nova wasp
#

What is "everything else" in this case?

nova wasp
#

I mean what is the specific thing you are waiting for

#

the pawn being set on the playerstate?

mystic estuary
#

(it's a pickup)

nova wasp
#

So replicated content isn't showing up until later, I see

mystic estuary
#

Correct

nova wasp
#

why not just have this get triggered in the Onrep for that pickup and also beginplay?

#

Is the onrep not firing for the second time? (the data showing up)

#

Also BP's call onreps on the server, in C++ onreps are only called for clients and not authority

nova wasp
#

Is this a replicated property defined in C++ or BP?

#

which Onrep mode is it in? think

#

AFAIK this should absolutely be triggering an onrep when the data you want arrives

mystic estuary
#

It's BP only

nova wasp
#

then... how would it onrep?

mystic estuary
#

Yes

#

There's no custom condition, so it's always true

nova wasp
#

ah okay, that's good

#

I'm confused why this isn't triggering the onrep... can you add a quick print string to print the tag contents every onrep?

mystic estuary
#

Luckily this actor is not that important, but man, I would absolutely hate it if it was something match/game-state specific

nova wasp
#

also there's Content and ReplicatedContent

#

Are they replicated to different clients?

#

both of them show the replicated visual here

mystic estuary
#

oops, content is not meant to be replicated

#

My bad

#

After I started using reset, I had to remember the original state of the content, so I switched to two props

#

It's hard to live without CDOs ๐Ÿซ 

#

I start the game
LogBlueprintUserMessages: [A_Pickup_Tool_SkeletalMesh_C_3] Server: Gameplay.Tools.Tazer

I pickup the item
No onrep because I remove the item using RemoveGameplayTag

Client joins the server

LogBlueprintUserMessages: [A_Pickup_Tool_SkeletalMesh_C_3] Client 0: Gameplay.Tools.Tazer

#

I wonder whether it has to do with the fact that it's a gameplay tag container

#

I tried to do this, and it prints hello on the client that joins the game late

#

So it works with bools, but not with the gameplay tag container

nova wasp
#

No onrep because I remove the item using RemoveGameplayTag

#

So you modify the internals of it without setting it?

#

I'm confused

mystic estuary
#

I do this, and it doesn't call the OnRep server-side

#

You know, it's like calling Add on an array, it wouldn't call the OnRep even in BPs

nova wasp
#

hmm... I think you want to at least mark the property dirty?

mystic estuary
#

How would I do that in BPs

nova wasp
#

for now you could just set it to itself :U

mystic estuary
#

Actually though, now that I look at some FGameplayTagContainer code, there's this FGameplayTagContainerNetSerializerSerializationHelper that does the replication apparently

#

LogBlueprintUserMessages: [A_Pickup_Tool_SkeletalMesh_C_3] Server: Gameplay.Tools.Tazer
LogBlueprintUserMessages: [A_Pickup_Tool_SkeletalMesh_C_3] Server:
LogBlueprintUserMessages: [A_Pickup_Tool_SkeletalMesh_C_3] Server: Hello
LogBlueprintUserMessages: [A_Pickup_Tool_SkeletalMesh_C_3] Client 0: Hello

#

Now client didn't even fire the onrep

#

But in this case it makes sense since ReplicatedContent is empty by default

nova wasp
#

Yes, the ideal is if nothing changes there's no need to send the onrep

#

In C++ you can change when OnReps get sent, for example they can always send etc

#

Would one of these forcibly change it?

#

could also yell at it to force net update (the object itself)

mystic estuary
#

I don't need it to force net update, it can update anytime it want really ๐Ÿ˜›

mystic estuary
# nova wasp

Isn't mark property dirty used for push based replication? Don't you have to tell a specific object that it's push based though? I haven't used it, so I only vaguely remember how it works

odd locust
#

Hello! anyone here know there way around gasp or atleast how to fix these 2 issues, number one being my camera zooms slightly when i move and number 2 being when in first person i can spin my head like a drill

mystic estuary
#

You can limit the camera rotation using player camera manager

nova wasp
#

This has little to do with multiplayer... You should try to anchor the camera to something you can rely upon

mystic estuary
#

The camera "zooms" most likely because you attached it to the head, so when the character leans, the camera follows the movement

nova wasp
#

If it's anchored to the head and the head moves quickly, so will the camera

#

The camera rotation being unlimited is going to depend on what you want, I don't know if you want the head to move independantly or what

#

You probably want it to be limited by some simple math to not go too far to the left or right based on the direction the chest is in (ideally the chest doesn't diverge much from the pawn rotation?)

mystic estuary
#

About my problem, I might've understood it a bit incorrectly. I switched to this code, and it works like a charm

nova wasp
nova wasp
#

which calls the onrep for everyone

mystic estuary
#

It will, but that's what I want

#

The OnRep on begin play is required to setup the initial state (visible/invisible), and the other one is required to change visibility depending on whether the container is empty or not

nova wasp
#

That's good, this way it's nice because late-joiners will get the correct state too

mystic estuary
#

Yeah, thank you ๐Ÿ˜„

odd locust
#

Any ideas?

mystic estuary
bright summit
shut hazel
#

Are modern games still using tactics like giving player input delay to better sync multiplayer?

nova wasp
#

It depends on the kind of game...

honest bloom
dark parcel
#

Anyone use Web socket to keep track of players status (online / offline)?

Wondering about the estimate cost and if it's worth pursuing in AWS.

tardy fossil
#

Pretty sure fighting games still use input delay along with rollback

hushed sierra
#

I'm working on a TBS, and I'm having problems with getting the client to get units to perform actions. I select an actor & call a function that does local validation and such, then calls a server UFUNCTION. However, the server function never actually seems to do anything. Everything works fine on the server, obviously. My actor is set to replicate. What am I missing?

#
//UFUNCTION(Blueprtint Callable)
void AFleet::RequestSimpleMultiFleetMove(APlayerController* Requester, TArray<AFleet*> FleetsToMove,
    AActor* TargetDestination, bool overridePreviousOrders)
{
    UE_LOG(LogTemp, Display, TEXT("Player requests simple move."));

    //Do any local validation here
    if (Requester == nullptr)
    {
        UE_LOG(LogTemp, Error, TEXT("Requesting player controller is null."));
        return;
    }
    if (FleetsToMove.IsEmpty())
    {
        UE_LOG(LogTemp, Error, TEXT("Fleets to move cannot be empty."));
        return;
    }
    if (TargetDestination == nullptr)
    {
        UE_LOG(LogTemp, Error, TEXT("Target destination is null."));
        return;
    }

    //Do any SFX, etc

    //Assuming we've made it past local validation, actually attempt to do something on the server
    UE_LOG(LogTemp, Display, TEXT("Local move validation completed."));

    HandleSimpleMultiFleetMove(Requester, FleetsToMove, TargetDestination, overridePreviousOrders);
}

//UFUNCTION(Server, Reliable) never occurs if the current player is a client
void AFleet::HandleSimpleMultiFleetMove_Implementation(APlayerController* Requester, const TArray<AFleet*>& FleetsToMove,
    AActor* TargetDestination, bool overridePreviousOrders)
{
    //Here we should do any checking that the server needs to do
    UE_LOG(LogTemp, Display, TEXT("Server recieves simple move request.")); 
}
tardy fossil
#

The actor you are trying to call the server RPC on needs to be owned by the client trying to call the RPC

#

but if it cant be that way, you could always call the server RPC through the playercontroller with the selected actor as an argument

warm sparrow
#

i came across this bug where widget interaction component cant interact with 3d widgets when there are more than one players. Its a pretty easy bug to recreate on a new project too. Has anyone dealt with this issue and solved it?

hushed sierra
hushed sierra
tardy fossil
#

if you're going to have multiple clients able to select the same actor then yea you will probably need to pipe it through playercontroller or something

pale hazel
#

I'm sure this has been asked a bunch of times already, but what could be the reason that, during seamless travel, my PlayerState does not have any data in it when CopyProperties is called?
I set a breakpoint in GetSeamlessTravelActorList, and in there it still has the data, but once I hit the breakpoint in CopyProperties its gone

pale hazel
#

Figured it out, APlayerController calls APlayerState->Reset() BEFORE calling APlayerState->SeamlessTravelTo(), so before the properties are copied over, and I was resetting my properties in Reset() just out of habit. But that means the data in my PlayerState got cleared right before copying, I guess you're not supposed to handle resetting playerstate properties in the Reset() function

warm sparrow
raw belfry
#

Can someone help explain what I'm doing wrong here? (Trying to set overlay on a static mesh only for individual client, both meshes have replication disabled, and the application checks islocalplayercontroller before applying overlay)

torpid crest
#

Client has different Z position for arrow which is spawned with Replicates and Replicates Movement and it's Attached to Socket

It almost looks like Socket position is not replicated????

chrome bay
#

because it isn't

#

If it's attached to something, you're relying on whatever you're attached to being moved. Otherwise you'd have constant discrepencies

torpid crest
#

it's attached to Bow and it's Skeletal mesh.
Bow actor is also set to Replicates and Replicate Movement

chrome bay
#

If you're doing it that way, it's the arrow that should be replicated and replicating movement. I wouldn't do it that way personally though

torpid crest
#

and how would you do that? ๐Ÿ™‚

#

it's driven by animation and then when player fires it gets socket position as initial location for projectile

chrome bay
#

Bow wouldn't be replicating movement, attachment would be driven by whether it's equipped or not locally. Arrow would also be completely local and driven by animation

torpid crest
#

ok, I see.. so basically try to offload everything to local

#

and then only send location value to server

chrome bay
#

yip

#

It can all be reconstructed from info you already have

crisp shard
#

]LogScript: Warning: Script Msg: Divide by zero: Divide_DoubleDouble

does anyone know what this might mean? i don't have any math where something is dividing by zero (that i can find)

#

turns out, i was dividing by zero. nice

hallow cliff
#

Hello. I need some advice on a small issue. Since I am a new multiplayer developer, I couldn't come up with a logic and the ones I tried were wrong. The situation is short: there is an actor on the map and we need an item to interact with it. I am trying to set up this with the logic of opening a door with a key, but it is a long and faulty path for multiplayer. What do you suggest about this? Should I keep a boolean variable in the character when the character picks up that object and how can I do this? It will be a 4-player co-op game. thanks all

graceful flame
# hallow cliff Hello. I need some advice on a small issue. Since I am a new multiplayer develop...

Keeping state about the world on the character interacting with the world isn't really the best place imo because what happens when you want to keep state but switch characters?

Ideally you'd want to keep the state of the door actor if its opened or locked on the door actor itself so that when the character interacts with something (in this case a door) the interaction event on that particular door actor runs. Then you could compare with variables on the PlayerState to see if the player interacting with the door has a valid keycard or enough exp, or some else like an unlocked attribute or special ability.

hallow cliff
sterile aurora
#

I am trying to do seamless server travel but my server crashes after travelling, I'm not sure why.

Here is my method for calling the server travel.

#

I'm using unreal 5.4 and hosting the dedicated server on gamelift, everything is fine until I call server travel.

dark edge
shrewd ginkgo
#

I cant reach player controller, why

#

whats wrong about it

lost inlet
#

well other players' controllers don't exist on clients for a start

#

not sure why you have the dependency on other player controller for spectating

#

since a pawn is a valid thing to have as a view target

chilly haven
verbal ice
#

Nop

#

None

glass crescent
#

Hi
I am making a flight game , my aircraft is the first person , so i am confused whether should make that aircraft a pawn or Character , keeping in mind about the jittering in multiplayer,

kindred widget
glass crescent
#

and for movement , i will be moving the aircraft locally and sending RPc for updating the movement in server, is that approach correct

kindred widget
#

Not entirely. That'll look jittery to other people. You have to locally predict some movement based on velocity and whatnot. If you don't, then you'll end up with a case where someone is running their game at 120fps, and only getting movement updates for 15-30 of those frames. There are other factors such as cheating if you allow the local player to dictate where their vehicle is.

glass crescent
#

i my case the server is also a player and i am changing both aircrafts tranform at same rate but the server player moves forward with some jitter in other player screen

#

will that unreal Network Movement helps me with that , or i have to anyhow implement my logic

mystic estuary
#

Hello, does anyone know how to separate VOIP talkers into different channels? I want to have spectator and game channels

hallow cliff
ruby lodge
# chilly haven

I have heard of nakama and that it's very good for multi platform

#

Haven't tried it out though

lost inlet
#

lol how very reductive to have a poll though

upbeat basin
#

Now I want to make a game completely dependent on public polls

ruby lodge
#

that would be fun to watch

upbeat basin
# ruby lodge I have heard of nakama and that it's very good for multi platform

I mingled with Nakama a little bit btw. It was easy to setup and use overall. It's mostly open to customization with json based custom payloads (even though I'd prefer to avoid string based data due to performance and type safety concerns) and serverside hooks to correct/respond/prevent events and even define new custom RPCs. Could be better if we were using dedicated servers because we needed to use subsystems anyways to connect players to listen server (or I messed up understanding some concepts). I would summarize Nakama as Firebase for games.

We mostly used Nakama for the matchmaking. If EOS wouldn't require players to link their own provider accounts with EAS with a pop up at the first time startup (or if I could find the way to do it without that requirement) I was intended to use EOS+ over Nakama. But our team decided not to "scare away" players with that

chilly haven
#

Hi, I'm writing a multiplayer game. For testing I use automated clients.
Is there any mechanism to create EOS test accounts? I'd like 60 or more.
I want my automated clients to test everything, including EOS functionality.
Thanks

river shore
#

Yo hallo guys, I am learning multiplayer and can't really find any normal here. Should everything be Client side predicted? Or do you just make certin Things Client side predicted, thanks for help guys! โค๏ธ

#

Im making a somewhat simple first person kill zombie game inside a bunker. So only freinds wpuld play together

#

Thx for your help, I do know how to do prediction but AI wasn't really aware on if everghing should have.

#

Yep

#

Will be fun XD

#

But thank you โค๏ธ

#

So I will also have turrets, and damage should handeled about Server ig to prevent doffrent versions of the game, I am right with that no?

#

Alr. Ok

#

So Shooting most likely also be handle by the Server and then Replikate to clients which enemy to shoot

#

For the animation (speaking about turret)

#

Ok but all of These methods are valid?

#

Ok!

#

Thx you, just helped so much!:)

lethal blade
#

You can use game state right

shrewd ginkgo
lost inlet
#

yes and I told you why you can't

torpid crest
#

since today my steam advance session started to do this :/
works fine with older builds

[2024.11.06-14.55.07:068][146]LogSockets: Warning: SteamSockets: Cannot get information on an invalid socket handle, returning null
[2024.11.06-14.55.07:068][146]LogNet: Warning: Could not create socket for bind address 76561198017849560, got error SteamSockets: setsockopt SO_BROADCAST failed (0)
[2024.11.06-14.55.07:068][146]LogSockets: Warning: SteamSockets: Cannot get information on an invalid socket handle, returning null
[2024.11.06-14.55.07:068][146]LogNet: Warning: Could not create socket for bind address ::, got error SteamSockets: setsockopt SO_BROADCAST failed (0)
[2024.11.06-14.55.07:068][146]LogNet: Warning: Encountered an error while creating sockets for the bind addresses.
[2024.11.06-14.55.07:068][146]LogNet: Error: InitBindSockets failed:
[2024.11.06-14.55.07:068][146]LogNet: Warning: Failed to init net driver ListenURL: /Game/Maps/Lobby/Lobby?Listen:
[2024.11.06-14.55.07:068][146]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = NetDriverListenFailure, ErrorString = , Driver = Name:GameNetDriver Def:GameNetDriver IpNetDriver_2147482392
[2024.11.06-14.55.07:068][146]LogNet: Warning: Network Failure: GameNetDriver[NetDriverListenFailure]:
[2024.11.06-14.55.07:068][146]LogNet: NetworkFailure: NetDriverListenFailure, Error: ''
[2024.11.06-14.55.07:068][146]LogWorld: Failed to listen:
[2024.11.06-14.55.07:068][146]LogNet: DestroyNamedNetDriver IpNetDriver_2147482392 [GameNetDriver]

shrewd ginkgo
#

it fixed but still I have a problem

#

The first time I press input the viewtarget does not change, but every time I click on it after first time it changes without any problem.

forest spindle
#

Hi, I can't seem to see a specific help channel so if this is the wrong place to ask I'm sorry, but for a project I am currently working on I am attempting to set up LAN multiplayer and am running into uses with RPCs and my movement system. The new max walk speed is set for both of the characters but only the host actually moves the other character jitters in place
https://imgur.com/a/jittery-rpc-OE4axsj

latent heart
#

This might be related.

forest spindle
#

I didn't catch that thank you

#

unfortunately not the fix

bright summit
latent heart
#

Or not because the CMC is awful if you don't need complex movement.

bright summit
#

why is awful? It's easy to make custom predicted movement

#

awful is mover 2.0 KEKW

forest spindle
latent heart
dark edge
#

It really depends on your requirements.

#

There is a pretty usable standard replication system for physics but it's a totally different problem if you need prediction

forest spindle
latent heart
#

No

#

You would just multiple the inputs together to set the cmc input.

#

"Left active or not" (1 or 0) * trigger value -> cmc input

#

Don't change the max speed value, change the input amount.

forest spindle
#

Thank you for the advice, gonna go mess around with things to see if I can get it working

static owl
#

I packaged my game with the standard replicated character movement. My friend hosted the server through the steam sub system and I joined as a client. His movement is fine, and mine looks good on his screen, but as the client my move ment is jittery. (First person camera).

Anyone know if this is a simple setting that should be changed, or a plugin?

marble cave
#

guys help, i made a simple and basic join and create session using steam subsystem but it only works in the PIE mode. when i try as a standalone game it won't find my session ( lenght of array session result = 0). it's really weird because when i tried it with a friend of mine with a shipped build on steam it works just some times
i would really appreciate some help, im stuck

stray bridge
stray bridge
static owl
forest spindle
stray bridge
#

also did you replicate the character?

stray bridge
forest spindle
# stray bridge whats your code for movement?

I posted a few screenshots earlier but I can resend them and also the functions that change movement speed. The only thing not shown is that in the Blueprint for the character MoveForward attached to the Event Tick

stray bridge
#

oh i see your calling moveforeward somewhere

#

donโ€™t check has authority on move forward call it on client on server the cmc handles this already

#

client and server

forest spindle
stray bridge
#

just take it out of the gas authority if statement donโ€™t check for authority

forest spindle
#

okay gotcha, sorry for the dumb question

stray bridge
#

no worries iโ€™m looking for help with my dumb question on the gameplay ability system channel lol

forest spindle
#

I'm still getting a jitter for the client unfortunetly

chilly haven
# chilly haven
poll_question_text

What's the best API for multi-platform online for a game shipping in 2 years?

victor_answer_votes

0

total_votes

0

stray bridge
#

hmm iโ€™m out of ideas lol

forest spindle
#

haha all good

brazen anvil
#

If I am doing procedural weapon sway, lag, recoil, etc.. does it make sense for proxies to also do the same? Or would it be better to have them just run animations?

#

The sway, lag, give it a more realistic feel but I don't think that needs to be replicated. I dont think you would really see it on proxies

ember vine
#

is there no way to make a replicated actor reliably replicate before a relaible rpc ? so its atomic

pseudo wagon
tardy fossil
#

Sounds like an OnRep variable would be better suited

shrewd ginkgo
#

I made a system to drop the gun if I shoot an innocent person but there are some problems. first problem is that if someone drops the gun and someone else picks it up there is a replication problem. the other problem is that if I shoot an innocent person and pick up the gun it drops the gun again when I shoot anywhere.

rustic sable
#

I'm applying an impulse to a static mesh component on the server but when I try to log it GetComponentVelocity() (with authority) it's always showing 0

dark edge
rustic sable
dark edge
#

are you checking it over time or on the same frame you're yeeting it

#

If the thing is sitting still and you do:
Add Impulse -> get velocity
it'll still be sitting still

#

It'll be moving next frame

rustic sable
#

once I apply the impulse I activate tick on the actor (and log it) until it drops below a threshold. At least that how I want it to work.

#

let me try with linear velocity

nocturne vault
#

I have a spotlight attached to the player, I set it to replicated, but the client can't see their own light or others' lights if I only use Run On Server. The client can see the lights if it is Multicast, but I don't think that is good for turning on a spotlight.

#

this run on server event is running right after the Flashlight input, and the player using flashlight is set to self

#

Unles I'm mistaken and spotlights need to be set on Multicast

rustic sable
nocturne vault
rustic sable
#

you might be able to get away with something like everyone setting their light bool in the game state I think

#

gamestate holds all the player states and can be seen by all clients, maybe just use player state

nocturne vault
#

Ok, I'll look into that

keen adder
# nocturne vault Ok, I'll look into that

Iโ€™m guessing this is for flashlights?

The easiest way would be to have a replicated bool โ€œisFlashlightOnโ€ or something. When a player toggles their flashlight, it runs a server function that sets the variable.

Then the variable has an onRep function so whenever it changes, everyone will be able to enable/disable the light locally for that actor

nocturne vault
#

yea it's for flashlights

keen adder
#

The light itself does not need to be replicated

nocturne vault
#

ok I'll give that a try

thin stratus
kind star
#

What would be a good architectural implementation for a loot system where each player has their own loot instance?

E.g. Group of 4 players kills a boss. Each player loots the boss's body. Each player rolls randomly and generates different lootable items. None of the other players can see or interact with other player's loot.

My basic implementation of looting so far is that the mob has a 'inventory' variable (an array of structs) which is dynamically generated on enemy death. However, this is an example 'shared' loot instance as all players would only be able to interact with one loot set. I dont want to hardcode 4 different inventory variables...

Ideally the implementation would also respect server-authority e.g. don't generate loot on clients. That was my first idea but that is very exploitable

exotic wasp
#

you could use the replication graph, or just replicate the items to all players but have it hidden if it's on a client other than it's owner

keen adder
exotic wasp
#

might be able to just change the actors relevancy? not sure

vapid gazelle
#

Sanity check: is it fair to say that ownership of an AActor is not replicated bundled with the actor to the clients even when set in FActorSpawnParameters passed to SpawnActor? E.g. I'm noticing that my AActor on the client can once in a while return nullptr from the GetOwner node in BeginPlay , occasionally requiring waiting a bit longer for that value to be set.

Related post here.

verbal ice
vapid gazelle
verbal ice
#

Yes

#

If the owner is available on the client, it will also be available in BeginPlay

exotic wasp
#

all actors have an OnRep_Owner I believe

kind star
keen adder
#

So its generated based on who interacts with it and not beforehand

kind star
#

That's genius, thanks

#

(Is it possible to have an array in a map? ๐Ÿค” )

keen adder
#

Also Iโ€™m not 100% sure if the playerstate can be a key, so if not you can use the clientId would be a unique int per player

quiet yarrow
#

Is it reasonable to replicate physical animations?

#

or is there a better solution than this that is simular to physical animations?

twin juniper
#

What's the best way in a multiplayer context to target a player when working with Enemies? (currently, I'm getting the first player character (0) which is always the same and wrong)

shrewd ginkgo
#

I made a system to drop the gun if I shoot an innocent person but there are some problems. first problem is that if someone drops the gun and someone else picks it up there is a replication problem. the other problem is that if I shoot an innocent person and pick up the gun it drops the gun again when I shoot anywhere.

kind star
nocturne vault
#

I'm confused why this variable is not showing as on. When I pick up an item, I spawn a component, set the component to on if the pickup was on, and then destroy the pickup. But on begin play of the component, it doesn't always show that it is on. Print string for the component shows false

#

on the child of this component, at the end of its begin play, I add a rep notify.

#

it shows false for client and true for server

thin stratus
dark edge
#

instead of "let's see what replicated items are inside this thing locally" you can "Hey Mr. Server, reply to me with what's in here"

dark edge
quiet yarrow
dark edge
#

A typical character doesn't replicate anything about animation. Animation is driven by replicated state (movement, etc)

#

What sort of physical animation are you doing?

quiet yarrow
#

mostly just arms and head rotation

#

should generally look like they are grabbing the object. Doesnt need to be perfect, but it would be great if at least the hand point for the arms are replicated

dark edge
#

basically every computer will agree on the body rotation, head rotation, arms rotation, and body location. That's enough to derive the rest locally

quiet yarrow
#

well the head is on a swivel. It doesnt follow the body. Its a robot

dark edge
#

yeah so replicate a rotation (or just a yaw) and then they can agree

quiet yarrow
#

what kind of rotation do you mean regarding the arms?

#

like the hand rotation and location?

dark edge
#

What's the minimum amount of state needed?

#

Is this VR?

sinful tree
#

It's spawned by the game mode and nothing in its constructor is showing that it's replicated, so I doubt it.

#

I don't think it exists at all on clients. The only reference to it being created is in the game mode, and is stored in the game mode, and game mode doesn't exist on clients, so they wouldn't ever have their own copy spawned.

quiet yarrow
lost inlet
#

no it doesn't

#

if it exists on any "client", it'll only be the listen server host

#

?

#

it doesn't exist at all

#

it's an actor

dark edge
lost inlet
#

it's not instantiated on the client

dark edge
#

scroll wheel?

#

Like, what is the player actually doing

quiet yarrow
#

thats the plan. havnt implemented that yet

#

player is reaching out for an object that is based on the linetrace hit location to pick up an object

#

the idea is that the robots arms would extend to that point

#

im still new to animations so i'll have to figure out a way to make the arms extend with some kind of animation

sinful tree
#

If your clients are connected to a server, the game mode only exists on the server. If your clients are not yet connected to the server, then they would have their own, non-replicated game mode instance as they would be in standalone mode.

dark parcel
#

They dont

#

If you are not connected to any game, then you are not a client.

#

Game mode only exist for the host

#

I missed the 3 people that tries to correct you