#multiplayer

1 messages · Page 107 of 1

magic furnace
#

here is an example, create talker for player and the boolean are just randomly picked

#

you would run your own function and set your own boolean

#

For communication you can cast to your own playerstate or use a blueprint interface. Most of the time you want to use interfaces, but in this case casting is fine.

#

I recommend watching some tutorials and reading the docs about replication

azure vessel
#

So something like this? I'll definitely watch that, I havent seen the talker before. thanks!

magic furnace
#

the talker and the relevancy

#

as I said were only examples

#

since I didn't want to create new functions in the playerstate real quick

azure vessel
#

Oh xD shit

magic furnace
#

the cast is correct but not the get player state

#

you already get the player state in the for loop from the array

#

with the get playerstate u made, you would always make the player at index 0 a teammate

magic furnace
azure vessel
#

😅 ?='D

magic furnace
#

yup

#

now you could also add a function in your custom player state

#

what to do when the player is an impostor

magic furnace
azure vessel
#

I have this in the player state, just to see if it works who is who

azure vessel
magic furnace
#

so to explain further with the repnotify

#

in the notify function you would put everything you would want other players to see because of this change

#

but outside of that you would modify things for the current player

azure vessel
#

Oh so i could put the ui in that function?

magic furnace
#

that would make the other players see that ui

#

thinking about it

#

you don't need the repnotify, just replicated

#

since other players shouldn't see a change

#

as well, that would expose the imposter

azure vessel
#

ok! ye hehe

magic furnace
#

you would keep everything the same, just set the variable to replicated instead

azure vessel
#

everything the same from which of the images above?

magic furnace
#

every single one

#

but usually, you wouldn't create UI on the player state

#

the player state is just there to keep variables and inform if a variable changes

#

so in this case you would inform the player controller that he is the imposter and then the player controller adds the UI

#

well and also the beginplay in the playerstate fires way before you would assign the player as an imposter

azure vessel
#

ah so i move the ui branch to controller and have a delay before?

magic furnace
#

no delay

#

create a custom event

#

call it from the gamemode

azure vessel
#

ah oki

magic furnace
#

an example

#

again, remove team widget is just a placeholder for your function

#

this is what you would call in the gamemode

azure vessel
#

Okay, so game mode:

#

Player state

magic furnace
#

perfect @azure vessel

#

one last thing

#

so this works is setting what runs on client, what runs on server

#

set impostor UI and Set teammate UI both need to be "run on client" in the replication settings

#

and Set UI in the playerstate would be "run on server"

#

gamemode beginplay and so on is automatically on server

#

at least I believe it is, doesn't hurt to use a switch authority before and only do things like setting impostor on authority, as that means server

half umbra
#

Hi

#

I have 10 skills and I need to check if the skill has loaded while updating the Widget which displays the current Cooldown. How can I make it the most Optimal?

#

10 timers? One Event Tick? Or what?

#

Someone can give me good idea?

magic furnace
half umbra
#

Right now I use Event Tick for whole 10 skills

half umbra
azure vessel
half umbra
magic furnace
#

and to answer that question, why not have the skills just send an event when they're done

#

why use timers and poll

#

or tick which is even weirder

#

that would be the most optimal way

half umbra
#

Because I have to constantly check when the spell will load

magic furnace
#

why would u have to

#

I don't see any reason to

#

you set your cooldown timer in the skill, or wherever, once it's done it reports that it's done

#

simple as

half umbra
#

Bad idea

dark parcel
half umbra
#

Then every actor would have to wait for time to run out before could be destroyed

dark edge
dark parcel
#

You could have more Skills as well, your cooldown should be contained in your skill

dark edge
#

polling is fine if the data is usually changing

dark parcel
#

not some event tick somewhere that tracks all 10

dark edge
#

I would just Tick -> update widgets

magic furnace
#

you would get timer remaining, set a new timer

#

no need to poll

dark edge
#

You still need to update your VIEW of the time remaining unless it is not visible, so something somewhere needs to tick

magic furnace
#

visualizing the cooldown is easily done without polling as well

dark parcel
#

I don't see anything wrong updating Widget Info with ticks

magic furnace
#

It's all down to scale

dark parcel
#

have the cooldown inside the skill but the widget can update with ticks

magic furnace
#

with 10 skills

#

sure

#

ticking is fine

#

doesn't matter what you do

#

it was asked about optimal

#

optimally you tick as little as possible

#

which a timer will accomplish

dark parcel
#

It wouldn't make difference, performance wise

dark edge
#

How do you suggest updating a visualization of something smoothly changing over time without tick?

quasi tide
#

A timer still ticks

#

You're not getting away from tick

dark parcel
#

Calling timer every 0.0001 is more expensive than ticks I heard

quasi tide
#

It's not the boogeyman

dark parcel
#

it's actually more things to call

magic furnace
#

but it ticks less information

#

less executed code

#

as stated, as little as possible

quasi tide
#

Wha...

magic furnace
#

a timer counting down ticks the time remaining

#

a skill ticking might check whatever amount of variables and whatnot

dark edge
#

I mean you could do something fancy like having a parameter on each material instance with the time info needed to do the shading of the bar or icon.

magic furnace
#

but more like, a second

dark edge
#

How do you show a sliver of time remaining?

dark parcel
#

I won't call mine a second, I have to displey Cool dool down to the decimals

#

like 5.05

magic furnace
#

like I am not debating that the widget will tick regardless

#

it will depending on what he wants to do there

dark edge
#

I mean the UI like this

#

how do you do the clock fade on the icon and the decimal cooldown

magic furnace
#

that needs to get updated every 100 milliseconds, I would throw it into tick

#

but again

#

question was optimal

dark parcel
#

I used tick to display my Cooldown, need the decimals to have a smooth circle

#

It wouldn't make difference doing it 0.01 second or on tick

#

performance wise

dark edge
half umbra
#

Okay, thanks everyone. I guess I'll leave it as it is

magic furnace
#

material thing is probably the worst idea lol

dark edge
#

I bet the material approach would scale pretty great for something like WoW where you have 100 icons doing an animated GCD wipe

magic furnace
#

shader updates are expensive and you wouldn't want it processed on the gpu

#

which nowadays will most likely be your bottleneck

dark parcel
#

You should move stuff in the GPU side when possible?

#

instead bottle necking your CPU

quasi tide
#

No - you profile and see where your bottleneck is

dark edge
#

The shader approach would cost like zero

dark parcel
#

I see

magic furnace
#

with modern games it will most likely be your GPU

quasi tide
#

If you are CPU bound and can get away with doing things on the GPU, then do it. If you're GPU bound and can get away with doing that same work on the CPU, then do it.

dark parcel
#

Someone was suggesting to Rotate things like Coin using world position offset instead setting the rotation

#

I thought GPU should be opted instead of CPU

dark edge
#

Yes that's generally a good idea

#

same reason Fortnite wiggles their trees on the GPU

magic furnace
#

that is quite common

#

it's easy to do that in unreal engine

#

for whatever reason

#

probably some legacy stuff

dark edge
#

A progress bar material is going to update anyway, there's approximately zero difference between it having its progress % fed to it by game code or figuring it out on the fly by doing math on game time.

magic furnace
#

You're right, it depends what you do

dark edge
#

instead of:
Tick -> Hey material instance, your progress is 69%
You'd instead:
OnAbilityCast -> Hey material instance, the ability will be ready at 420.69 seconds.

and the material updates itself based on that parameter. No need to tick to tell it anything.

magic furnace
#

but it's easy to do shaders wrong, I wouldn't touch them if you don't need to

dark edge
#

mite b cool for something with tons of icons like WoW

magic furnace
#

but honestly, performance isn't to be gained here, so our entire conversation is pointless

#

any way you do it, nobody would notice, nor would the performance change with 10 skills

dark edge
#

So anyway, how do I do predicted physics on BP only, anyone got a tutorial? Just started gamedev this week btw

magic furnace
#

you get all the bones

quasi tide
#

Make everything client auth. Leave it to the bit gods on what happens.

magic furnace
#

and then you update them on server

#

on tick

#

replicate to all clients

dark edge
magic furnace
#

make the server do some calculations

#

by creating a actor for each bone with a projectile component

#

you send all the info back to the server

#

where it gets processed

#

do get all actors of class bone

dark parcel
magic furnace
#

and then set the variables

#

on tick

dark edge
#

and no my C++ is very bad

dark parcel
dark edge
#

So what's the elevator pitch for how CMC handles char vs char collisions?

#

I think I'm there, and other dude thinks he's there. Who's there?

#

Since we're both in the future on our screen

magic furnace
#

disable collision

#

ez pz

dark edge
#

A and B are running towards each other

#

A gets there first on their screen, B gets there first on their screen

#

What happen on server?

limber gyro
#

i assume that the predition wont let it happen

#

in cases where the network is bad u probably get rubber banded back

dark parcel
#

Server will always be the truth isn't it. If both of them running on equal speed, the one with better ping will probably be there first. And the other one will get rubber banded (corrected from the collision?)

#

Pure speculation tho, I have not try to race anything

dusk spire
#

someone mentioned with custom code someone could replicate TMaps are there any pointers/docs on that?

quasi tide
#

Source code most likely

dusk spire
#

its supported now?

magic furnace
#

on the rare edge case they hit the server just collides them and one gets a net correction at most

dark edge
#

Yeah that's the core of the biggest problem with my project, except mine isn't characters. Right now I'm pretty commited to serverside vehicle physics and letting lag be lag, but if prediction wasn't a total bugbear then I'd maybe consider it

#

In my project they'll be hitting all the damn time, like destruction derby

magic furnace
#

oh vehicle collision, big pain

dark edge
#

Yeah and they're player-built vehicles, can be anything from a dirt bike to a Mad Max monstrocity

quasi tide
#

IE - the odds of there being something out there for this specific thing is quite low.

#

NetDriver.h is a decent place to start I'd say.

limber gyro
#

i have a "blueprintImplementableEvent" that is called when HP reaches 0, in that even im just detaching the players weapons and making them simualte physics, this works fine from an oposing players perspective but doesnt work for the owning player and i have no idea why

#

i feel like im missing a key aspect of the architecture here

dusk spire
#

what could go wrong

#

lol

#

ok it was a joke

trim kindle
#

Is there a way to replicate only subobjects which changed? Let’s say I have 1000 of rep subobjects and I don’t want replication to try to rep all of them. I have a dirty list of ones which contain changes.

pallid mesa
#

lmao, i know ur memeing around, but ironies aside, its now possible.

dark edge
pallid mesa
#

as long as they are physical objects they run the simulation predictively and server provided the correct result, resimulating the physics state for the affected bodies

dark edge
#

I'd have to really think about how my system is set up but it might be plug and play. Basically my system is like this:
Input -> state on devices -> 1D physics network -> forces/impulses

#

Right now my networking is like:
Input -> RPC to server -> set replicated control state on devices -> 1D physics (runs everywhere) -> forces impulses (runs everywhere)

#

I think I might be able to just skip owner on the replicated control state and use locally provided control state?

pallid mesa
#

the way i tested it is by having the same move commands in owning cli and server

#

and it (kind of) worked

#

still very experimental, it hard snaps more than I'd like

#

reviewed it over the top with 0lento

dark edge
#

Yeah so something like
UNPREDICTED:
Input -> run on server -> multicast -> impulse
Predicted:
Input -> impulse -> run on server -> multicast skip owner? -> impulse

#

What does a non-owning client do? Are they applying forces locally ever?

pallid mesa
#

no, the predicted would be: local move, rpc server move

#

without the multicast

dark edge
#

move or force/impulse?

pallid mesa
#

force/impulse

dark edge
#

so a non-owning client is just interpolating between updates from server, never doing any physics of their own?

pallid mesa
#

i didnt dig too much but essentially... theres some form of interpolation. Maybe if you multicast it it will work better, but havent tried it.. maybe you can try it and see if the likely hood of hard snaps get reduced

#

maybe i missed that part and you are supposed to multicast it!

#

but again - blank canvas - no documentation - gotta try to know haha

dark edge
#

yeah i think it would depend on what your physics is doing. Like say you have some value driving a hover, you might want the client to use that replicated value to drive the hover locally instead of basically falling and periodically being corrected by server

#

I'll check it out though, it might be useful. It'll all depend on how collisions are handled as I have a lot of vehicular sumo

pallid mesa
#

yes it is definitely a bit of a change in paradigm

#

i think that at some point this will all be also brought to characters

#

but long overdue

dark edge
#

I only replicate the physics of the vehicle body and physics turrets, not the individual wheel colliders, so it should be pretty easy on data anyway

#

I don't care if everyone doesn't agree on if a wheel bounced or not, just that they agree on the movement of the actual vehicle

pallid mesa
#

indeed indeed, thats what i was doing aswell

#

#ue4... couldnt get my vehis to work in ue5 (chaos)

#

:(

#

would have to work quite a lot to make them feel 1:1

dark edge
#

If it was soft constraints, they seem broken

#

I changed to linear motors

pallid mesa
#

noo, it's just no substepping support

dark edge
#

which is fine as now I can do hydraulics like a westside lowrider

#

I havn't found a need for substepping honestly

#

but I haven't really tested at like 30 fps or anything like that

#

What did you need substepping for?

pallid mesa
#

in physx had it smooth as butter at 15, very close sim results at 60

pallid mesa
#

also i noticed the suspension bounces way more now in chaos

#

noticed it was partially the phys particle physical material and partially my suspension damping

#

i basically need to adjust all the values

#

had also to change the car mass from 1.3KG to 1.1KG

#

many "arbitrary" changes to reach equivalence on system simulation - didnt liked that and I ended dropping the ue5 support

#

(I want to code, not to move values up and down type of deal hahaha)

dark edge
#

as constraints or your code outputting forces?

pallid mesa
#

just simple arcade stuff

#

one linetrace per suspension and apply basic spring forces

dark edge
#

That's probably why, you're probably hitting the critical stiffness problem

pallid mesa
#

w some damping, bound/rebound ratio, stiffness... etc

dark edge
#

If you aren't clamping you need to

#

even that won't be perfect as your code runs after phys sim and not during it, so it can only respond to displacement

pallid mesa
#

yes the bummer is that it was perfect (for me) in physx

dark edge
#

I haven't found any way to do suspension forces that behaves well at high stiffness vs just using constraints

pallid mesa
#

so i get annoyed by these "new" problems

dark edge
#

Might be a PBD thing

#

since forces aren't really all that fundamental to PBD

#

I'd try reformulate to impulses (not sure if that needs doing but it might be more stable) and 100% for sure do the clamping explained in that article

pallid mesa
#

i will (if i ever get back willpower) take a look

#

because i believe im clamping already

#

if not it would have been shit in physx aswell

dark edge
#

The core of the problem is that for any given delta time there is a certain stiffness and damping which will return the sim to the equilibrium state in 1 frame. Any higher, and it'll overshoot (that's your instability)

#

so as framerate varies, that stiffness/damping coefficient will vary

#

you need to clamp by that

#

you also have the problem that you just know the last frames deltaT, not this upcoming one, that's why I use impulses and handle the frame time myself.

pallid mesa
#

gotcha yeah i believe i compute the suspension delta, so should be easy to apply (if not done yet)

dark edge
#

I do that for my tire model's friction. For suspension I just use constraints and linear motors as they do this stuff behind the scenes in Chaos

#

and as far as I can tell they are perfect, can crank the stiffness up to infinity and it behaves

#

You also have a coupling problem as you have 4 sping/dampers supporting 1 body, so there's a rocking couple and such. You'll need to divide your critical coefficient by at least 4

pallid mesa
#

yes well each susp can compute its own coefficient, but i see what you mean

dark edge
#

Yeah computing the coefficient requires knowing the effective mass attached to the suspension, it'll be something around mass/4 but will depend on distribution of mass and moment of inertia.

#

I'd probably do mass/5 or mass/6 and see how it behaves, that might be stiff enough. You won't get it F1 stiff tho

pallid mesa
#

i did have a mass distributor actually

#

working perfectly on ue4

#

after upgraded to chaos its all jittery

#

essentially it looks like all the systems i had to make the car more stable for sensitive calculations produce jittery results now

dark edge
#

Have you turned up your chaos iterations? I think they default to really low

pallid mesa
#

no i havent

#

just worked with everything stock Adriel

#

maybe its as simple as tuning that up?

dark edge
#

won't hurt to try

pallid mesa
#

will give it a shot, didnt know about this setting lol

dark edge
#

also I would consider formulating your suspension into 1 force/impulse and 1 torque/angular impulse

pallid mesa
#

too used to "physx" just works™️ situation

dark edge
#

basically do the math, add them all up, and apply 1 force and 1 torque. Should help with angular oscillation if that's a problem

pallid mesa
#

yep

dark edge
#

they are force at position right?

#

not at COG

pallid mesa
#

yes all 5 forced are at position

#

and torque is using this principle

#

of doing the math

#

and then apply it in one single place

#

so 1 force per wheel

#

and.. 1 force in the "acceleration source"

#

that also aplies lateral friction (very arcadey)

#

gtg now

#

thanks for the chat Adriel

stoic lake
#

Hey, if I have the serverside player pawn, how do I pass this onto the client in such a manner that it doesn't return null for the client?

loud frost
#

and search session with this

void UW_MainMenu::SearchSessions()
{
    IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
    if (OnlineSub) {
        IOnlineSessionPtr SessionInterface = OnlineSub->GetSessionInterface();
        if (SessionInterface.IsValid()) {
            SessionSearch = MakeShareable(new FOnlineSessionSearch);

            // Fill in the session search settings
            SessionSearch->bIsLanQuery = true;
            SessionSearch->MaxSearchResults = 20;
            //SessionSearch->PingBucketSize = 1000;

            //SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);
            //SessionSearch->QuerySettings.Set(SEARCH_KEYWORDS, TEXT("MySessionName"), EOnlineComparisonOp::Equals);

            // Bind the delegate for search completion
            SessionInterface->OnFindSessionsCompleteDelegates.AddUObject(this, &UW_MainMenu::OnFindSessionsComplete);

            // Start the session search
            SessionInterface->FindSessions(0, SessionSearch.ToSharedRef());
        }
    }
}

void UW_MainMenu::OnFindSessionsComplete(bool bWasSuccessful)
{
    if (bWasSuccessful && SessionSearch.IsValid()) {
        UE_LOG(LogTemp, Warning, TEXT("Found %d sessions:"), SessionSearch->SearchResults.Num());

        for (const FOnlineSessionSearchResult& SearchResult : SessionSearch->SearchResults) {
            UE_LOG(LogTemp, Warning, TEXT("Session Name: %s"), *SearchResult.Session.OwningUserName);
            ;
        }
    }
}

but every time it shows find 0 session

hallow hare
#

We have a server-authoritative inventory system that works by having clients request actions of the server (Add/Remove/Destroy Item) via a UFunction declared like UFUNCTION(Server, Reliable) and passes on a RequestId and the server then validates the request and does the work and calls a NetMulticast. In some cases the RPC payload back to the clients is the new "state/result" and the clients just overrides the local state (basically replication) and in some cases it askes all the clients to do the same work as it and all the other clients will do (since we assume the state is always consistent between the server and all clients so the outcome should be the same). The same RPC sends back the RequestId so the requesting client can handle an optional callback function at that time (e.g. maybe update the UI to show the action failed/succeeded).

What we don't like about this design is the clients can call NetMulticastAddedItem_Implementation() and essentially have client authority over the inventory -- which is one thing -- but now that we have NetMulticast implementations that share logic we have had to add helper functions like AddItem() that where before we only had AsyncAddItem() and AddItem_ServerOnly() and the potential for misuse of these functions starts to be more of a concern.

There's no way as far as I can tell to "lock out" _Implementation() or the helper functions like checking if we're executing on server or not because the NetMulticasts are executed locally and so any helper functions are also necessarily executed locally.

We brainstormed about using replication instead of NetMulticasts but we're not sure how we would facilitate the callback/response behavior we have going with that. We're also not sure how that would work w/r/t reliability and timing of replication of different UProperties that would be altered by a single inventory action.

Any feedback or advice is appreciated!

sinful tree
#

Use a replicated variable, use an OnRep function to then drive changes.

#

Also, a client calling a multicast means they are only changing it on their side, not anywhere else, which really, you shouldn't care about. The server would have the real copy of the inventory which you can always validate what the client is trying to do based on what the server has.

limber gyro
#

hey guys, i got some niagara warnings in my server logs, is there anything i can do to make them go away? should i be worried at all?

plucky prawn
#

Are you spawning particles on the server?

magic furnace
#

null object as world context

#

gonna take a big guess

#

the server has no object associated and you're spawning systems in a weird way

limber gyro
#

since those characters are only spawned after a player joins

#

and that log is from when the server starts

#

i have quite a few warnings to be fair

#

they are mostly particles tho

plucky prawn
limber gyro
#

just stuff like this in the constructor

#

to be honest i have no idea how the server handles this kind of stuff

valid bough
#

Why is it that when I have Super::RestartPlayer in the beginning of this , i experience ghosting (a copy of the player spawns twice) but when its on the bottom it works fine? ```void AFPSMMOGameModeBase::RestartPlayer(AController* NewPlayer)
{
//when Super::RestartPlayer(NewPlayer); is here, ghosting happens
if (NewPlayer)
{
APlayerInfoState* PlayerInfoState = NewPlayer->GetPlayerState<APlayerInfoState>();
if (PlayerInfoState) {
FVector SpawnLocation = DetermineRespawnLocation(PlayerInfoState->TeamId);
FActorSpawnParameters SpawnParameters;
SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;

        AFPSCharacter* NewCharacter = GetWorld()->SpawnActor<AFPSCharacter>(BP_PlayerClass, SpawnLocation, FRotator(0.0f), SpawnParameters);
        if (NewCharacter)
        {
            NewPlayer->Possess(NewCharacter);
            NewCharacter->SetOwner(NewPlayer);

        }
    }

    return;
}


Super::RestartPlayer(NewPlayer); //good here

}``` I feel like if it works I should be good but im not sure if this is supposed to happen and if its good practice.

sinful tree
# valid bough Why is it that when I have Super::RestartPlayer in the beginning of this , i exp...

If you check what RestartPlayer does in the game mode class, it itself can end up spawning a pawn for the player. By calling super after, the game mode is checking if there is a pawn for the player already, and if so, it doesn't spawn it - since you're spawning and possessing a pawn, this is why it's ok here, but you also return from the function anyway before it could be called if the NewPlayer is valid, so it probably doesn't ever get called.
By calling it before, then it proceeds with spawning a pawn since there isn't one available, and then in your code you're also spawning a pawn for him, so then there's going to be 2.

Depending on what you're doing, you may not need to call Super::RestartPlayer at all.

valid bough
stiff fractal
#

Is there something I'm doing wrong when it comes to binding to a Multicast Delegate on a client? I'm trying to do this in a HUD widget. Ignore that Delay and GetControlledPawn nonsense (unless it's part of the issue somehow). Hand is a replicated actor that being spawned on Server when the Pawn is possessed. I'm not seeing any of the invalid checks show up in the output log, so I'm very sure that it's valid by this point. This setup works fine on Server not on client. Setting a breakpoint in the native code shows me that when it's the Client, the OnCardEnterBank delegate has 0 entries in its invocation list while the server has 1. This indicates that the Bind is failing on the client. This is the server code that both cases are running and where the Broadcast is going out.

void ACardBank::PlaceCardAt_Implementation(const int32 Space, const FGuid Card)
{
   if(IsSpaceAvailable(Space))
   {
       OnCardEnterBankDelegate.Broadcast(Space, Card);
       Cards.Add(FCardMapStruct(Space, Card));
   }
}```
Any insight?
sinful tree
#

ie. Cards variable gets replicated, OnRep is called, OnRep triggers event dispatcher.

stiff fractal
#

What difference would that make if it's still not bound?

sinful tree
#

So you're receiving the "Invalid hand bank" message?

stiff fractal
#

No. No invalid messages. I'm pretty sure the Hand actor is valie by the time we're in the blueprint.

sinful tree
#

Event dispatchers aren't network replicated. They run only on the game instance they're called on. So if your Implementation function is only running on the server, then it only gets called on the server.

#

It's likely your binding is working fine if there's no message, it's just that there's no event dispatcher being broadcast on the client side for it to receive the message.

stiff fractal
#

I see, and your suggestion is to somehow move my Broadcast into OnRep to get around that?

#

Because OnRep will be client side?

sinful tree
#

Well, in this scenario, you're dealing with something stately - a hand of cards. Adding to the array can then cause that variable to replicate. If you have an OnRep set up, then that OnRep function will be called on clients when it is replicated, and if you're using a listen server, you'll have to call it manually when the server sets the value. When the OnRep trigger happens, you can have it call the Event Dispatcher, which your UI is bound to, so then your UI would do what you want it to do when the dispatcher is called.

stiff fractal
#

Very interesting. Sounds like more what I'm after. But will there be a way I can make differentiations of what happened in OnRep? I only want this Delegate to fire when a card gets added to it. I have another one for when a card exits.

#

Does OnRep give you Before and After states of the property?

sinful tree
#

It could be as simple as adding it as a parameter to the function.

stiff fractal
#

Okay cool. That sounds promising. If that's possible then I can probably figure out what just happened and broadcast the right delegate.

quiet mortar
#

How do I find out which player is interacting

#

because get player pawn or controller doesnt work because it always gets the host

#

so what do I use as the object wildcard

#

to find out exactly which player has interacted

sinful tree
# quiet mortar How do I find out which player is interacting

Typical multiplayer interaction:
Client Presses Input on Controller or Pawn >
Does a trace to detect an "Interactable" actor >
Server RPC (can be on controller or pawn) requesting Interaction with the actor, passing an actor reference in the RPC >
Server validates player's pawn (Self if on Pawn, otherwise Get Controlled Pawn on Controller) is close enough to interact with desired actor >
Interaction Interface passing in a reference to the controller/pawn performing the interaction >
Interaction Implementation on actor can read the passed in reference to determine who made the interaction call

thin stratus
#

@feral narwhal Clients locally also keep track of the session they are part of. Even if the Server and your backend removed them, they might still have the session entered locally and then the session nodes will fail. So you have to "destroy" the session for them too.

#

You do that locally

#

Whatever/whenever it fits for your game

#

If you never expect to be part of a session in your lobby/main menu, then destroy it when that GameMode gets created

#

Otherwise you could blindly destroy it whenever you try to host/join/find

#

As "just in case" destroy

dark parcel
#

Isn't that what he just said?

queen escarp
#

hey guys im having a hard time understanding the sessionn create/Join from Ues built in system

#

it isw only working localy ?

#

on the same ip ?

dark parcel
#

just @ing so you get your closure 😄

chrome bay
compact flame
#

How would one make this work in multiplayer?

loud frost
#

One more ques
Just tell me am i correct
While learning multiplayer i got this

Let 1 server (s) and 2 client (c1 c2)
All have variable test and it is replicate so everyone has their variable instance called (stest c1test c2test )
So there is a function called testing() which has if (HasAuthority) and else RPC called (server , reliable )which increment test variable by 1
So if its called on server then stest and its instance changed for all client
And if i call from c1 then it tell server that change c1test to increament and it is replicated so all got to know that ok c1test changed

blissful talon
#

Hello, does anyone know how client online beacons should be treated in regards to the destruction?

When dealing with regular replicated actors we usually destroy actors server-side, which is then replicated to the client. However beacons are a bit different, in fact it's the local machine that creates them, however they then establish RPC-like connection with the server.

So should it be the server to destroy the connected beacon client actor client-side, or should it be the client to destroy its beacon client actor?

oak oracle
#

hey devs i bough some asset with weapons , characters, pickups etc. and i noticed it is fully replicated , but my game is single player , how this will impact on the project? i don't know performancevise , project size etc , is it neccessary to remove all replicated code?

shrewd ginkgo
#

I want to do amongus like game but I dont know how I decide is he sus or crew anybody can help

winged badger
tame crypt
#

Hi! If I add a mysql connector into my unreal project and set it to run on the server only, will the clients have the copy of it as well? (they will not be able to run it, i know, but will they have it mentioned?) I am trying to avoid a player in any way to gain access to the database which holds the player data. How does one go about this issue? Is there a better solution to run real-time data for playerstates and gamestates in my multiplayer game?

cedar swift
tame crypt
cedar swift
#

if you're using a dedicated server, the http requests happen on the server, server sends that request via string commands to sql

blissful talon
#

Does anyone know how to check whether a port is occupied or not using UE?

nocturne quail
#
COND_InitialOnly

replicates the thing only once on Initialization?

chrome bay
#

Initial replication frame, so not necessarily actor initialization.

#

Whenever a connection receives that actor from a new "channel", that value will be sent. Usually you only use it for properties which never change once initialized, otherwise relevancy/dormancy can result in clients having different values for it.

magic furnace
#

Why are animation notifies so unreliable?

#

like seriously, in a multiplayer scenario it is a dice roll whether they will fire on server

#

they seem to always fire just fine on clients

#

it renders them unusable

#

animation notify states for whatever reason never fail me, but anim notifies always do

#

and it's not that anything is blended in, or the animation is blended out

#

they just don't fire

#

my guess would be from my observation, that if a player is laggy for the server, the animations don't always go smoothly

#

and it skips the notify

nocturne quail
hoary spear
magic furnace
#

Yeah, that's why it is confusing to me

#

why is it different

hoary spear
#

Ugh, not looking forward to dealing with those kinda things

valid bough
# sinful tree If you check what RestartPlayer does in the game mode class, it itself can end u...

Just a follow up question, so on initial spawn my player runs begin play. Which spawns the weapon, sets the health, etc. (not gonna show the full code, but here is just the relevant code: ```void AFPSCharacter::BeginPlay()
{
Super::BeginPlay();

if (HasAuthority())
{
    ensure(GetOwner() != nullptr && "Character should have an owner on the server.");
}
bCanFire = true;

if (SpawningWeapon && HasAuthority()) {
        // Create an instance of the weapon object
        AWeapon* Weapon = GetWorld()->SpawnActor<AWeapon>(SpawningWeapon);
        Weapon->SetActorLocation(GetActorLocation());
        Weapon->SetOwner(this);
        EquipWeapon(Weapon);
}    if (HasAuthority()) {
    SetShield(MaxShield);
    SetHealth(MaxHP);
}

}Which works on the initial spawn. But upon death and respawning, for the client it works correctly. But when the server dies (client killing the server) , it wont set the health nor the weapon. Unless I add the code to the restart player. As shown herevoid AFPSMMOGameModeBase::RestartPlayer(AController* NewPlayer)
{

if (NewPlayer && NewPlayer->IsLocalPlayerController())
{

    APlayerInfoState* PlayerInfoState = NewPlayer->GetPlayerState<APlayerInfoState>();
    if (PlayerInfoState) {
        FVector SpawnLocation = DetermineRespawnLocation(PlayerInfoState->TeamId);
        FActorSpawnParameters SpawnParameters;
        SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;

        AFPSCharacter* NewCharacter = GetWorld()->SpawnActor<AFPSCharacter>(BP_PlayerClass, SpawnLocation, FRotator(0.0f), SpawnParameters);
        if (NewCharacter)
        {
            NewPlayer->Possess(NewCharacter);
            NewCharacter->SetOwner(NewPlayer);
            NewCharacter->SetShield(NewCharacter->MaxShield);
            NewCharacter->SetHealth(NewCharacter->MaxHP);
            if (NewCharacter->SpawningWeapon) {
                AWeapon* Weapon = GetWorld()->SpawnActor<AWeapon>(NewCharacter->SpawningWeapon);
               Weapon->SetActorLocation(NewCharacter->GetActorLocation());
                Weapon->SetOwner(NewCharacter);
                NewCharacter->EquipWeapon(Weapon);
                Weapon->SetPickUp(true);
            }
        }
    }

    return;
}


Super::RestartPlayer(NewPlayer);

}``` which seems redundant. Am I approaching this correctly or should I refactor this and fix the issue at hand or is that okay?

chrome bay
# magic furnace Why are animation notifies so unreliable?

Character animations are updated in lockstep with the character movement updates. If you have logic dependant on animations updating, you will also need to force the animations to always tick even if not rendered on the Server. This is obviously a performance concern, which is why you usually consider alternatives.

magic furnace
#

I guess that answers that, thank you

chrome bay
#

IIRC notifies should be set to "branching points" too, rather than queued.

#

There's a lot of factors, can't remember them all

magic furnace
#

I guess a delay will do the trick...

hoary spear
#

Ouch

#

Extract notify timings

chrome bay
#

If you want to drive gameplay logic from animations, they should pretty much always be forced to tick regardless of render state.

hoary spear
#

Automatically 😅

chrome bay
#

Which is obviously a performance concern.

hoary spear
#

Id imagine server could just not do any anim stuff except the notify track(s)

#

No bone updates, nada

chrome bay
magic furnace
#

but I have that

chrome bay
#

Yeah, should be okay then, the anins will always be updating at least

magic furnace
#

and it happens with this setting

#

makes me question, with the interrupted nodes and so on

#

why aren't they just delays

#

why not have delays, that check whether the animation was interrupted before firing

chrome bay
#

IIRC you also to use branching notifies not queued, and I'm not sure but you may also have to use notify states as well

#

Because presumably you might change the play rate etc. Probably not efficient to do it that way

hoary spear
#

Playing only the notify track would account for that

chrome bay
#

Wouldn't solve the problem anyway

magic furnace
#

well, no gameplay from now on will be on notifies I guess

#

only cosmetics

silent valley
#

As long as you set them to Branching, they seem to be 100% reliable for us.

#

This is triggered from montages, not sure about anim sequence

hoary spear
#

Id be surprised if it was sent by delta

robust linden
#

Hey, I've got a very simple ability that fails to predict on 300 ms for some reason

#

Are my "Wait Net Sync" nodes placed incorrectly?

#

the way I simulate ping is by adding this:

[PacketSimulationSettings]
PktLag=150

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

to DefaultEngine.ini
#

and that's actually 150 ms not 300ms

fathom aspen
#

Only what changed

twin tree
valid bough
hallow hare
# sinful tree Use a replicated variable, use an OnRep function to then drive changes.

If we use a replicated variable and an OnRep function how do we use that to trigger the callback functions we have on the client? For example, if the client consumes an inventory item and we want to show a UI element saying it was successful. The client will get the OnRep after requesting the server to consume the item but how will it know if the OnRep was in response to their request and how will it know if it was successful?

quartz iris
#

Would anyone be able to help as i'm still stuck on this. I can't figure out how to make the gamemode play widgets on the respective winner/loser playerstate variables

sinful tree
# hallow hare If we use a replicated variable and an OnRep function how do we use that to trig...

Your inventory would need to be the thing that has the OnRep, not the item itself. Notifying a player of successful usage of something could be an RPC itself.
An example:
Your inventory is an array of some kind that holds whatever data is necessary to store your items for replication. This array is what is replicated and uses the OnRep function.
A player walks up to an item, the server detects the overlap, and "picks up" the item, adding an entry to your array at index 0.
The OnRep triggers on your inventory notifying the client that something was updated. The OnRep calls an event dispatcher your inventory. The dispatcher is bound to by your UI which then can update the display of the inventory.
That item that was picked up was consumable.
The client sends an RPC to the server indicating they want to use the item in the array at index 0. The server receives the RPC, validates that there is an item at index 0, and executes whatever that item is supposed to execute when it is consumed - the server then removes the item at index 0. The server can also send back a Server>Client RPC indicating the item was consumed. The OnRep triggers on your inventory notifying the client that something was updated, and the OnRep once again calls the same dispatcher which then allows your UI to update based on the new state of the inventory variable.

sinful tree
quartz iris
hallow hare
sinful tree
# quartz iris Would anyone be able to help as i'm still stuck on this. I can't figure out how...

If only one player can be the winner, all you need to do is call a multicast on the gamestate that includes the PlayerState reference of the player that won. That multicast can then create the widget, but you should have a PlayerState variable set to exposed on spawn and instance editable within your widget so you can pass in the reference of the player that won. Within the widget, you can then check if the Owning Player's Playerstate == to the winner, and if not, display the loss screen, otherwise, display the win screen.

quartz iris
#

Datura I think i've been bamboozled is what i'm trying to say aha

magic furnace
#

multicast is good enough

#

an onrep is the wrong thing to do in this case

#

you would set the variable to replicated, then multicast the widget most likely

quartz iris
#

How can I check if the player is the winner/loser?

#

I know how to set the player as the winner/loser but not sure about checking which player is what

magic furnace
#

I'll wait for Datura, he will give you a detailed explanation most likely

#

been at it for a while

sinful tree
# hallow hare Ok, so there's no way to avoid adding the extra RPC call then? This seems less o...

Probably not. Using the OnRep doesn't make sense as you wouldn't know why the item was removed in the OnRep. Like, the player could have sold it to a store, or traded it when it gets removed from the inventory. So that means it only makes sense to RPC the reason why the item was removed, and you wouldn't want to RPC to the client what the change is to the inventory as then you have to constantly maintain the copy of the inventory that exists on the client - it's possible, but it is messy.

magic furnace
#

and well, you could just get the reference to Game Winner

quartz iris
#

oh wait

#

yeah.. lol

magic furnace
#

assuming that is not part of the question

sinful tree
quartz iris
sinful tree
#

Ok, and the code you've shown where you're setting the winners/loser variable, is this in your game mode?

sinful tree
#

Ok, game mode does not replicate. It only exists on the server. No point in having those variables as replicated if no one can receive them.

magic furnace
#

then the loser the loss screen

#

in sequence

quasi tide
#

Are you still on this Paradoxed? What have you tried in the like 3 weeks since we covered this?

magic furnace
#

lmao

magic furnace
#

watching the basics of unreal engine and the basics of replication might help

quartz iris
#

Idk some guy said I should do it with on rep and I basically fucked my understanding of it

sinful tree
magic furnace
#

oh wait, it's game loser in the second

#

yeah

#

that's better

#

but won game screen

#

and loss game screen

#

need to be run on client

#

so it runs on the client, not server

quartz iris
magic furnace
#

no need to multicast

#

at this point

magic furnace
#

and it's done

quartz iris
#

oh

sinful tree
#

And again... Game Mode doesn't replicate. You can't do any network communication in it - no replicated variables, no RPCs.

quartz iris
#

is this because its only effecting one person?

#

I was told to use gamemode

sinful tree
#

That's fine, but you can't use it to do network communication.

quasi tide
#

By who? I told you to use GameState a few weeks ago.

magic furnace
#

variables into game state

sinful tree
#

You'd have to use something else and you can have the Game Mode go into a different class to do it too.

quartz iris
quasi tide
#

That person doesn't know UE's networking then

quartz iris
#

no shade im just confused from that

quasi tide
#

GM simply cannot replicate (as Datura said) because it does not exist on the clients. GameState's entire purpose of creation was to convey information from the game mode to clients. It's an extra wall of protection pretty much. You have to be deliberate on what information you send.

#

So, the overall process is as such:

  1. Player does something that causes them to win the game
  2. Do the check on the server (I see "killer", so I'm assuming some kind of pvp) IE - when they slay the other, the server then gets the game state and says "hey, this player won"
  3. The game state then does a MC that lets all connected clients know who won
#

You can pass that info in from the person who killed the other person. Flip some flag. W/e you want really.

quartz iris
#

So this would work for showing the winner in the text?

#

(theres some other random stuff too)

quasi tide
#

Yesn't. In this case it would really depend on if that variable value got there before you did your RPC

#

"Game Winner" may not be the value you expect. Due to latency and networking shenanigans

quartz iris
#

It doesn't play the widget though only the sound effect

sinful tree
quartz iris
#

It also plays both the win and loss sounds on the one who killed the player

#

I'll send over the whole code one sec

#

Below is the player related code

#

Here is the gamestatebase code

sinful tree
#

You can't take lines across network executions - you're setting those Winner/Loser variables using the values from the previous event. If the server was executing "Player Died" the client wouldn't know the values, luckily in this case, because you're using gamestate, there is no owning client other than the server so it, sort of? works, but only for the server.

Additionally, because you're calling both of these bits in sequence, of course you're going to see/hear both.

#

If you look at the example I just made, it simplifies it. You're creating a widget on gamestate after a multicast, so both players will receive notice that they need to create widgets. When the widget is created, it is owned by the local client, so the server will own the widget they create, the client will own the widget they create. From there, you're able to get the playerstate of the owning player and verify if they are the winner or not.

quartz iris
sinful tree
#

I just explained why. You're calling a Run On Owning Client event (Gamestate is not normally owned by clients, so it only executes on the server) and then you're calling those functions on the respective playerstates.

#

Playerstates exist everywhere, so if you call functions on them, regardless if it is on a client or server, it'll execute them.

sinful tree
#

No. You should not use the code you're using as it's doing what you want and it doesn't matter if you mark just that single event as a multicast.

quartz iris
#

How can I fix this?

sinful tree
#

I already gave an example.

#

The first image can still be used if you've moved it to gamestate, you just wouldn't need the cast.

quartz iris
#

I moved it from the gamemode

#

Do I actually need to use the gamemode?

sinful tree
#

No

quartz iris
#

Ok

#

I'm still not understanding the replication

sinful tree
#

If you're following my example, then you'd be calling "PlayerDied" on GameState when running on the server.
You are multicasting in the GameState with a reference to the winning player - that value is passed through the RPC to all others. That's all the "replication" involved in my example.

quartz iris
#

So I should remove the owning client ce

sinful tree
#

Do you know what marking an event as "Run On Server" does?

quartz iris
#

Yes

#

It does it on the server

sinful tree
#

Nope.

quartz iris
#

So all the clients see it

#

It has priority

sinful tree
#

It marks an event as being allowed for a client to potentially call it for the server to run it, but only if the client is the owner of the actor.

quartz iris
#

Ok

sinful tree
#

Do you know what marking an event as "Run On Owning Client" does?

magic furnace
#

Hey quick question, for shutting down a server quit game is not the way? Is it FPlatform exit or another way?

quartz iris
sinful tree
#

Nope.

#

It allows the server to call to a specific client to execute something, but only if that actor is owned by a client.
A good example would be PlayerState -> Something that is replicated to everyone, but owned by a client. If you did a Run On Owning client on PlayerState, then it would only execute for that particular client.
One way that wouldn't work, is running a Run On Owning client event on an NPC actor that is not owned. This call wouldn't do anything as there is no owning client for a "Run On Owning Client" call to work - in fact you'll get a warning in the log.

quartz iris
#

Multicast does it on all clients right?

#

I kinda see

sinful tree
#

A multicast can be called on any replicated actor. And yes, it'll execute for all clients, but only if that actor exists and is relevant for that client.
So again, an AI controlled actor, you could call that multicast on and this time it'll be received by all clients who have that actor as relevant.

#

If you called a multicast on Game Mode, only the server would execute it as Game Mode doesn't exist on clients.

#

If you called a multicast on Game State, it will be received by everyone as it is an actor that is always relevant.
And of course, a caveat with both Run On Client and Multicast is that they must be called by the server to actually work 😉

quartz iris
#

Nice

#

Thanks im gonna refer back to this

#

The gamestatebase DOES need a execute on server then?

#

Even if its already the server?

sinful tree
#

No.

quartz iris
#

Got it

sinful tree
#

Unmarked events (so no Run On Server or Run On Owning Client or Multicast) and functions will execute wherever they are called from.

quartz iris
#

So it is like this

sinful tree
#

So if I'm already running on the server and call the PlayerDied event on your gamestate, then the logic afterwards should already be executing on the server.

quartz iris
#

Otherwise im having the server do it twice

#

or something?

#

Got it

quartz iris
#

Like if the winner/loser is the server it works?

sinful tree
#

The server can call Run on Owning Client on an actor that is owned by the server and it should only execute on the server.

quartz iris
#

Ok

#

So what i'm doing here is not correct

sinful tree
#

It is not correct.

quartz iris
#

its on the server

#

or not?

sinful tree
#

As this is on the gamestate, the gamestate is owned by the server, so running on owning client means it is executing on the server.

quartz iris
#

Ok

#

But it's not doing the code right?

sinful tree
#

It logically doesn't follow what you want it to do.

quartz iris
#

In my brain it makes sense for it to be only with a server not a owning client idk why

sinful tree
#

What you want is:
Player Died > Notify all clients who the winner is > Clients display the appropriate widget.

What this is doing:
Player Died > Server is running events on playerstates

quartz iris
#

this correct?

sinful tree
#

Nope.

quartz iris
#

What am i doing in this code

dark edge
shrewd ginkgo
#

I want to make amongus like game but I dont know how I decide is he sus or crew and how can I give them different colors anybody can help

sinful tree
#

Player Died > Running Multicast that attempts to set values both on the client and server even though the values only exist on the server, then trying to again run on owning client on the server (which is the server when dealing with gamestate) and then running things on playerstates.

dark edge
#

Color Color on pawn or playerstate

#

onrep for color to apply it

#

Color gets set on server, replicates everywhere, the onrep is called, the actual color changing is done

shrewd ginkgo
#

I cant understand Im very new at it

dark edge
#

Then don't even think about multiplayer

#

Start by making something dummy simple and singleplayer

sinful tree
shrewd ginkgo
sinful tree
#

What for?

quartz iris
#

To count the wins/losses of the entire game

sinful tree
#

Ok, but counting the values doesn't mean you need to store who the current winner is.

#

Eg.
I win a round. You'd add +1 to my count. You don't need to necessarily store that I am the current winner.

quartz iris
#

If a player leaves I do

#

I might need it in the future for other things

sinful tree
#

If a player leaves, then their playerstate is gone anyway.

quartz iris
#

That's why I store it in the gamestatebase

#

I removed the custom events as i'm not sure

sinful tree
#

If you store a reference to a playerstate in the gamestate and that player leaves, that reference is then invalid.

quartz iris
#

I'll tackle that afterwards as I still don't understand the win/loss widget

#

I can't see how that fails to work

#

I'm literally referencing the winner/loser

sinful tree
#

You're running on server when this is executing. You're then still executing on the server and calling those functions on the playerstates while still running on server.

sinful tree
#

You're literally not internalizing anything I'm saying T_T
If you're running on the server, how are the clients going to know?

robust linden
#

hey, is this too much for a fast paced fps?

#

or okay?

#

my game doesn't have a lot of entities

quartz iris
#

It's directly targeting them with the code?

sinful tree
#

No its not.

#

Functions and Events (when not marked to RPC) run where they are called.

quartz iris
#

So basically the clients have no idea

sinful tree
#

Exactly.

quartz iris
#

But the server does

sinful tree
#

Yes.

quartz iris
#

So the server thinks its the winner and loser

sinful tree
#

Yes, because you're calling both of those Win and Lose events while running on the server.

#

Now don't touch anything, leave it as is!!

#

All you'd need to do...

#

To at least get it somewhat working...

quartz iris
#

Run on owning client on the winner first right?

sinful tree
#

Is mark these events on your Playerstate as Run on Client.

#

It's not the best method, but you'll probably get something working as you want at least 🙂

quartz iris
#

is that bad

sinful tree
#

That should be ok.

quartz iris
#

what would the code do if it were like it was, without run on owning client

sinful tree
#

It's already doing that - the server is both winning and losing while the client doesn't know about it at all.

quartz iris
#

so the gamestatebase which is the server is carrying over to the play sound and widget etc

sinful tree
#

Yep

quartz iris
#

which makes it not function

#

but the run on owning client makes it work only on that specific character

sinful tree
#

It's not just GameState, but the PlayerDied event is running on the server.

#

Makes it run on the specific client that owns that character.

quartz iris
#

Gotcha

#

So if it's running on the server obviously the client wouldnt have the widget be displayed

#

I see

#

That's correct right?

sinful tree
#

Yep

quartz iris
#

So when the server kills the client it works perfectly, when the client kills the server it only shows the widget on the server

#

I probably missed something

sinful tree
#

When the client kills the server, does it show that the server lost at least?

quartz iris
#

Yeah

#

It shows the client won

#

But theres just no widget or sound effect on the client

sinful tree
#

Do you have any error messages in the output log?

quartz iris
#

Nope

sinful tree
#

Check to see if the values on your PlayerDied event have values - like plug them into a print string.

quartz iris
#

ah I see

#

The killer was the loser

#

Hm the problem is still there though for the client when killing the server

sinful tree
#

When you're doing those prints, are you seeing
Server: .....

Are you seeing any
Client: ...
being printed?

quartz iris
#

On the gamestatebase?

sinful tree
#

Yep

#

Are you also perhaps destroying the player's character at any point before trying to display the widget/play sound, or even just momentarily afterwards, in the same frame even?

#

And sorry, I need to go out, but I'll be back shortly.

quartz iris
#

I have to go for dinner I will be back too

#

This is the text

valid bough
pale edge
#

Hey all, i've got a dialogue system in my game and im adding the widget i made to the viewport through the HUD blueprint, the problem is, when a remote player wants to access the HUD blueprint, it throws errors. Any idea why it would do this?

latent heart
#

UI elements generally aren't replicated.

#

Are you creating it on teh remote player's client? Do they see it? And what error does it throw?

pale edge
#

I'm creating the widget through the HUD bp, so im not specifically doing anything extra to make sure the widget is created on the client, and it throughs read access violation because the HUD is null on the remote

#

for reference, the players are not meant to share this widget (at least for now) they should be able to go up to the character and get their own dialogue going

sinful tree
# quartz iris

So yea, you'll have to check backwards. Check the values that you're passing into your PlayerDied call. Check how you're ending up with the values for The Killer and Player Who Died. Whatever logic you have in Player Died is correct, so the problem is no longer in there.

latent heart
pale edge
#

this is in the hud

latent heart
#

So where does the null error occur?

pale edge
#

it occurs in the player controller when it tries to access this variable, which is set OnBeginPlay

sinful tree
latent heart
#

If it's created locally it shouldn't be null, though.

pale edge
#

yeah thats why im confused, i honestly set it to replicate to see if it would fix it without knowing that in this case it does nothing lol

#

on begin play of PC

sinful tree
#

Begin Play executes on clients and server. Server can't access another player's HUD class.

pale edge
#

the crux is that it can't use Get HUD for some reason on remote clients

#

the problem isnt serverside its clientside

latent heart
#

You're not trying to access another player's hud are you?

#

(from a client)

pale edge
#

nope, just the local player's hud

sinful tree
#

HUD can only be clientside. But if you're getting null errors, it's because the server is trying to access it.

pale edge
#

at least thats the intent

#

interesting

#

let me put a has authority there

#

yeah that doesnt seem to work, i also just tried using Is Local Player Controller and added a print statement, looks like its set on the client and server now but its still null on the remote client for some reason

dark edge
pale edge
#

i think the rest of this might just need some checks/proper replicated events to make sure that the client is the only one trying to call these events

#

yep just needed to set this to replicated on top of that previous fix and it works, thanks all!

sinful tree
#

Only the local client can have a reference to HUD.

plucky prawn
#

What if I make it replicated in player state /s

pale edge
#

yeah i got that part lol, i just meant for some reason the remote client's was null, but actually it was the possessed pawn that was flipping out because on possess is serverside only

rocky kestrel
#

I have car in my multiplayer game and character can posses it. What could be best way to not delete that car when player disconnect from server while driving car? Spawn another car in game mode disconnect?

fossil spoke
#

The default behaviour is for the PC to destroy its possessed Pawn upon disconnection.

#

This cant be changed in Blueprint, unless you have C++ capabilities to override it.

rocky kestrel
#

Okay I need to override it and make it only destroying actual player

quasi tide
#

As an FYI, wizard's pinned post about data covers this

quartz iris
sinful tree
#

Keep printing values - see who your damage causer is.

#

make sure it's not the same as "self"

#

if it is, then you may be feeding in the damage causer inconrrectly.

lost inlet
#

Anyone know what RemoteRole should be expected to be set to for a listen server host? Is it ROLE_SimulatedProxy or ROLE_Authority? I wanted to implement a "should I bother sending this RPC" check, which will be pointless doing for the authority player

#

do I have to dig for the player controller and run IsLocalController

fossil spoke
#

I would expect it to be Simulated.

lost inlet
#

though for a remote player on a server, then RemoteRole would be ROLE_AutonomousProxy?

fossil spoke
#

No I would think that would still be Authority.

#

Id just load up the Editor and run a quick Blueprint to verify

lost inlet
#

why would RemoteRole be ROLE_Authority on the server?

fossil spoke
#

Oh I thought you meant from the perspective of a Client

#

RemoteRole for a Client on the Server, it should be Autonomous yes

lost inlet
#

then I can just compare GetRemoteRole() == ROLE_AutonomousProxy for determining whether to send the RPC then

quartz iris
fossil spoke
fathom aspen
sinful tree
# quartz iris

It can. What the problem is right now is that if both the damage causer and self are the same thing, then you likely are calling Apply damage wrong/feeding in the wrong values into it.

lost inlet
fathom aspen
#

Yeah then just call the client RPC. For the host player it will run as a normal local function

#

The reason is since the host player is server-owned

lost inlet
#

No? because that won't call the delegates serverside if it's a remote player

sinful tree
#

That's looking better.

#

At least the first one.

lost inlet
#

I think checking ROLE_AutonomousProxy as the RemoteRole is the move, but just need to get the rest of everything in a compiling state

quartz iris
#

So when the server kills the client (left image) it works fine, but when the client kills the server (right image) it doesnt work properly

fathom aspen
#

Multicast on PlayerController sounds like a viable solution KEK_Waddle

sinful tree
quartz iris
#

I can send over the saber damage code.. I suspect i've been doing something wrong

#

From what I can see, the server and clients take damage as they both have health bars

sinful tree
limber gyro
#

im trying to make a spectator system, my current aproach is to simply give the spectator pawn the spectated player yaw and pitch. The thing is, it looks choppy when things move, is there any option in the CMC or anywhere else to make movement smoother?

fathom aspen
#

Camera should be attached to the mesh, not to mention that my website has an article on the subject

limber gyro
#

if its attached is it going to be smooth?

fathom aspen
#

Ah yeah it was written with TPS in mind, but technically speaking implementation shouldn't be too different

limber gyro
#

my third person is working fine lol

#

its just the first person that altough works, doesnt look good

#

my 3rd person spectate is free tho

#

u can rotate around and stuff

fathom aspen
#

Not that I'm familiar with what you ended up doing, but the jitter issue usually results from the fact that the camera component is attached to the capsule which is teleported rather than interped (which is the case for the mesh)

fossil spoke
#

You arent going to get smooth or accurate FP Spectate without doing a lot of work.

limber gyro
#

this line for example " PlayerState->SetIsSpectator(true);" does this do anything special?

#

or just lets the server know ur a spectator?

limber gyro
#

is there no way to hack things to make them look decent "enough"?

fathom aspen
#

It's part of a puzzle that initiates spectating

fossil spoke
#

Depends what "decent enough" means to you I guess

limber gyro
#

so what is exactly in the chacracter is smoothly interpolated?

fossil spoke
#

The Yaw of the CharacterMesh will be smoothed, Pitch is what you will have trouble with

limber gyro
#

i managed to make the camera feel smooth with interp but tthen i had an issue with the meshes lagging behind

fathom aspen
#

The simulated character is already interpolated for you, and you are just counting on the CMC's vanilla implementation

fossil spoke
#

You probably need to setup some sort of stream where the Server passes you a higher rate of Pitch (of the spectated player) changes than normal.

fathom aspen
#

As was mentioned that's not enough for other uses not just spectating, and since why, you need your extra touches ^^

#

If I'm not mistaken, Lyra has a Camera Something that looked decent

#

Saw it in vori's article about Instant Replays

limber gyro
#

i messed around with this var and it seemed to help a bit

#

the one with the yellow arrow

#

by the way, do u guys know how to acess them in c++?

fathom aspen
#

Yeah it's a matter of accessing them from the Actor

limber gyro
#

could u show me?

#

ive tried everything

fathom aspen
#

GetReplicatedMovement?

#

GetReplicatedMovement_Mutable if you want to modify it

limber gyro
#

so thats what i was missing

#

i didnt know "GetReplicatedMovement" was a thing

#

i was trying to access the cmc

fathom aspen
#

private vars usually get getters

#

Not to mention that it exists in the Actor Class Defaults, so everything you see in that picture exists at the level of the Actor

limber gyro
#

ye i figured that much i just didnt know the name

#

i think something like this "GetReplicatedMovement().RotationQuantizationLevel = ERotatorQuantization::ShortComponents;" is probably gonna make the rotation decent enough

#

now i gotta worry about the pitch

fathom aspen
#

You want the _Mutable version

limber gyro
#

oh, i missed that part

#

what exactly is the diference?

#

why would there be 2 of the same thing?

#

by the way

#

messing with any of these vars

#

would it help?

fathom aspen
fathom aspen
twin juniper
#

is it possible replicate void* pointer?

winged badger
#

what would be the purpose of that?

#

the other machines don't have a memory mapped in exact same way as yours does

#

you can replicate the data it points to, as TArray<uint8> but that requires some custom work

#

you can't UPROP a void*

#

you'd also need to replicate the size of the data

twin juniper
# winged badger what would be the purpose of that?

I need to send MessageData and MessageDataSizeBytes from EOS to client

/**
 * Structure containing details about a new message that must be dispatched to a connected client/peer.
 */
EOS_STRUCT(EOS_AntiCheatCommon_OnMessageToClientCallbackInfo, (
    /** Caller-specified context data */
    void* ClientData;
    /** The identifier of the client/peer that this message must be delivered to. See the RegisterClient and RegisterPeer functions. */
    EOS_AntiCheatCommon_ClientHandle ClientHandle;
    /** The message data that must be sent to the client */
    const void* MessageData;
    /** The size in bytes of MessageData */
    uint32_t MessageDataSizeBytes;
));```
twin juniper
twin juniper
#

any example? should I iterate through data?

half umbra
#

hi, let's assume that I have created a structure and in it I have: Texture, Montage, Health, Mana. If my game is multiplayer, should I keep texture and montage variables separate?

#

only Health and Mana should be Replicated

#

and is there anything wrong with that, for example, I would have many such constant variables in a structure that is being replicated

blissful talon
#

Hello, did anyone succeed to use online beacons hosting on them on public IP?

I'm trying to change the URL.Host that I feed into the beacon's NetDriver->InitListen(), though log then says LogNet: Created socket for bind address: 0.0.0.0:7787, which is definitely not the IP address that I've set (the port is correct though).

The code snippet:

bool ATextChatOnlineBeaconHost::InitHost()
{
    const auto* SocialSubsystem = USocialSubsystem::GetChecked(this);
    const FString& PublicIpAddress = SocialSubsystem->GetPublicIpAddress();
    
    FURL Url(nullptr, TEXT(""), TRAVEL_Absolute);
    Url.AddOption(TEXT("NetMode=ForceIP"));
    Url.Host = PublicIpAddress;
    Url.Port = ListenPort;

    if (!InitBase())
    {
        return false;
    }
    
    if (IsValid(NetDriver))
    {
        FString Error;
        if (NetDriver->InitListen(this, Url, false, Error))
// ...
twin juniper
#

I also have no idea.

I wrote something like this:

const TArray<uint8> NewTmpArray(static_cast<uint8_t*>(InMessageData), sizeof(InMessageData));
``` now how to cast array to void*?
chrome bay
#

The real question is why are those things linked together in the first place

#

But that aside you can mark struct members as NotReplicated provided you're in C++

chrome bay
#

You have no choice but to separate them then

#

Otherwise the references will also be replicated

blissful talon
half umbra
#

and that will be better than keeping all these variables directly in the structure?

chrome bay
#

The data table and the row name, which is probably more expensive than just replicated references since now you'll have a reference and a string

#

Just separate the data, it makes little sense for them to be together

half umbra
#

ok thanks

half umbra
#

so now i have only replicated Row Name in structure

#

instead of these references

chrome bay
#

But that's a string, so it's probably more expensive than two references

#

Anything more than 4 characters would be in fact

#

The setup just seems bizarre to me, not sure why you'd pack those things together

#

Data locality matters a lot more in MP

half umbra
#

ok, i'm creating a spell system and in the replicated structure it currently stores mana cost, cooldown, image, montages

#

after separating these unnecessary variables, I somehow need to figure out which spell to which mana cost to assign, etc.

half umbra
#

but i don't know

#

maybe is better way

#

@chrome bay

#

indexes?

chrome bay
#

Another way to approach it would be with a data asset which contains the spells "configuration". You just create an asset for the spell and replicate that reference should you need to.

#

Right now you're replicating a struct of presumably static data

#

If you have a mixture of fixed + dynamic data, create a "spec" struct of some kind, that includes the static data (as a data-asset), and the runtime-modifable data next to it.

half umbra
chrome bay
#

Not really, but if you have a static configuration for a spell it might be better off in an asset, rather than replicating a struct of info the client can find for themselves

half umbra
cosmic marlin
#

Having Issues with Dedicated server setup, I deployed a Dedicated server on Playfab , but Cannot connect it using the client.
I was able to connect it when setup as Mock server on my local machine. Help would be appreciated

chrome bay
half umbra
chrome bay
#

yes, to store the static data, which presumably all of those properties are

half umbra
#

if i change the replicated variable on the server will all clients see the actual value of that variable?

#

or i need use multicast?

chrome bay
#

That's the point of replicated variables so yeah, assuming the owning actor is also replicated.

#

Never change state with multicasts

#

Quick way to make a broken game

half umbra
#

thanks

trim plume
#

Hi.
Is it possible to join a listen server by IP, and still have the onlinesubsystem initialized?
Currently, we create session, then openlevel.
And then the clients will openlevel with the IP as level name.
But that method doesn't work with VOIP as the online subsystem isn't initialized it seems..
Any help is greatly appreciated.
Best,
Matias

chrome bay
#

Clients need to join the hosts session to benefit from most of the OSS logic.

thin stratus
#

@chrome bay @trim plume Some knowledge:

VOIP in the Engine "requires" the Client to be in a Session. That's why you might think "Oh, if I connect directly via IP, without joining a Session, I can't use VOIP.", which in theory is correct.

However, the VOIP doesn't actually need the Session. It's a local condition that just checks if the client, locally, is in a Session.

I don't 100% recall where the check was, but it might be this one:

void FOnlineVoiceImpl::Tick(float DeltaTime)
{
    if (!OnlineSubsystem->IsDedicated())
    {
        // If we aren't in a networked match, no need to update networked voice
        if (SessionInt && SessionInt->GetNumSessions() > 0)
        {
            // Processing voice data only valid with a voice engine to capture/play
            if (VoiceEngine.IsValid())
            {
                QUICK_SCOPE_CYCLE_COUNTER(STAT_FOnlineVoiceImpl_Tick);

                VoiceEngine->Tick(DeltaTime);

                // Queue local packets for sending via the network
                ProcessLocalVoicePackets();
                // Submit queued packets to audio system
                ProcessRemoteVoicePackets();
                // Fire off any talking notifications for hud display
                ProcessTalkingDelegates(DeltaTime);
            }
        }
    }
}
#

Easiest fix for this is to just add a fake session locally :P

#

Doing that requires C++ of course

trim plume
thin stratus
#

Not sure why that would lag

#

But no, you have to do that in cpp

#

You need to get the subsystem and manually add a named session

#

Cause all it cares for is there being one in the array

trim plume
# thin stratus Cause all it cares for is there being one in the array

I'm sorry, but could you be more specific? I'm not sure to where I would be adding that and to what array exactly?
I'm guessing the FindSessions? But that would mean creating a struct of the BlueprintSessionStruct, and I tried follow into it, but didn't give me an answer.. Also, if we ever figure out how to make such struct, the IP address isn't within it either?
I apologise for all these questions, but I've been trying all day.. 🙈
To me it's just a bit weird there isn't a JoinSessionByIP or something like that 🤔

thin stratus
#

There is no JoinSessionByIP cause that makes no sense

#

A session is just some data on the master server fwiw

#

You need to locally, in c++, get the OnlineSessionInterface and add a NamedSession by hand if you want to have VOIP without joining a session

#

Nothing with FindSessions, nothing with Join or Create ever

#

Also nothing with Blueprints

#

This can't be done in BPs

#

If you aren't able to use c++ then you might need to give up on the connect by ip stuff and properly utilize session with a subsystem of your choice like Steam for example

#

Gotta head to the gym now, so won't answer for a while

trim plume
# thin stratus Gotta head to the gym now, so won't answer for a while

That makes a lot sense actually. I appreciate your replies a lot. It really helps.
I do know cpp a bit, it's more figuring out exactly where to add the session.
However, you definitely pointed me in a direction that sounds promising.
Thank you very much!
And happy gym time ☺️ 👍

cosmic epoch
#

I always wondered, if I have a COND_InitialOnly property, and I set it after the actor has finished spawning, but still within the same frame, is it still guaranteed to be replicated to the client (and before the client calls begin play on the actor)? Because some properties of APlayerState are like that (PlayerId, UniqueId etc.)

#

And APlayerState isn't even deferred spawned, the game simply sets the Ids mentioned before after spawning it, and yet they seem to be always guaranteed to be replicated. So I assume it's 100% safe if I set a COND_InitialOnly property within the same frame that the actor spawned (or had bReplicates set to true), despite not using deferred spawning?

chrome bay
#

Yeah it will replicate

#

Replicated properties aren't checked until the very end of the game frame

cosmic epoch
#

nice, thx, so basically using COND_InitialOnly gives me guaranteed pre begin play (on the client only ofc) replicated variables which come with the initial bunch, as long as I set them within the same frame that the actor was spawned/set to replicate, excellent

chrome bay
#

yeah, and so long as the actor isn't map-startup actor or something

cosmic epoch
#

yeah ofc

chrome bay
#

(and is always relevant)

cosmic epoch
#

I wondered why they used it for PlayerId, but it makes a lot of sense when considering this

chrome bay
#

Yeah. COND_InitialOnly is really for stuff you never expect to change once initialized with the actor

cosmic epoch
#

this also has some funny consequences, for example PlayerId won't be set when BeginPlay is called on the server PlayerState, but it will always be already set for clients. In general, the BeginPlay of PlayerState is a really terrible place....

#

Not even the controller will have been set yet at that point (at least on the server)

chrome bay
#

Player State lifetime on the Server is a total meme honestly

#

You login.. it creates one, then it searches for an inactive one that matches, then it restore that, then it spawns a new one to replace that one etc.

#

It's absurdly stupid

#

It smells of legacy code from UT/gears

cosmic epoch
#

yeah it is quite frustrating

#

this in turn also means that anything COND_InitialOnly set during Copy/Override Properties of the player state will be guaranteed to be set pre begin play on the client, which is pretty nice. I assume it will not be set pre blueprint CS execution though?

chrome bay
#

ahhh.. I did know the answer but forgot it.

#

I can't recall now if initial bunch properties are applied pre or post construction script

cosmic epoch
#

no worries, uve already helped me a lot with confirming my theory. according to bing, PostNetInit is called after the Blueprint construction script has run, but who knows if that is correct...

shrewd ginkgo
#

I want to write player name front of message but it doesnt work

#

why?

cosmic epoch
hoary spear
#

If they're considered at the same time, i dont really see why it wouldnt be the same

shrewd ginkgo
#

if I connect it with event tick its work

#

but with event construct it doesnt

sinful tree
# shrewd ginkgo if I connect it with event tick its work

Probably because you're constructing the widget before you're setting the name values.... Either way, you're better off not sending the message with the player name like this to both save bandwidth and to prevent people from spoofing their name. All you should need to send to the server is the message the player wants to send. The server can then grab the playerstate of the controller sending the message and send the message as a structure containing both the playerstate and the message. When anyone receives the message structure, they should then read the player name from the playerstate received and construct the message format locally.

magic furnace
#

probably because the name is set after construct

solar adder
#

Hi! Can someone please tell me what is the correct approach to working with Team specific data in multiplayer?
Lets say i have top down multiplayer game with 2 teams. Enemies only see each other if they are in a certain range. I Can achieve it using "only owner see" and a client RPC, when there is a collision of an actor with a field of view.
But how do i make it so that only the enemy Team has "only owner see" on, but teammembers have it off?

hollow eagle
#

ownership will not help you with filtering things per-team because only one player can own an actor. It won't let you know anything about teammates.

#

Alternatively, you can manually hide/show actors if relevancy is a bit too big of a hammer (it means that actors could pop in if the process making them relevant takes too long)

solar adder
#

Thanks! Ill take a read on that!

whole pine
#

whats the best way to make it rain in my level for all players at specific times retrieved from a datetime

twilit radish
# whole pine whats the best way to make it rain in my level for all players at specific times...

You could probably just have the game state on the server check if it should rain or not and then have an OnRep (replicated variable with a callback) notify the others if the state changed or not. This does assume that at most 100-200 milliseconds of latency won't make a difference. It seems pointless to me to replicate down all those timestamps when the server could also just indicate with far less data what the current weather state is.

I would also recommend looking more into the basics of Unreal's networking if this might still be confusing. There are some great resources in the channel pins. Specifically Cedric's website is awesome and there's also a video somewhere in the pins going over the basics 🙂

whole pine
#

i dont understand how the server can run code without a client telling it to

#

i googled it but idk what thats even called

#

do you mean a third party server or server within editor

hollow eagle
#

any of the above

#

the server is running a full instance of the game, albeit without graphics/sound/anything client-only

twilit radish
#

@whole pine I would recommend with first looking up some articles / videos in general about how Unreal does networking things instead of jumping straight into making something work. I like this video a lot as an example: https://youtu.be/JOJP0CvpB8w

An overview of the essential concepts for writing multiplayer game code in Unreal, in under 25
minutes or your money back.

Sample project: https://github.com/awforsythe/Repsi/
Patreon: https://patreon.com/alexforsythe
Twitter: https://twitter.com/alexforsythe

00:00 - Introduction
01:24 - Net Mode
03:33 - Replication System Basics
05:13 - Acto...

▶ Play video
hollow eagle
#

it does not simply respond to queries to clients, it runs the game.

whole pine
#

i know how to replicate and stuff i just dont understand how you run unreal engine code on a server, unless you mean i use a cloud script in playfabs website for example

hollow eagle
#

generally by running on bare metal or a VM/VPS, not some managed web hosting service.

#

playfab multiplayer servers require you to upload the server build and it runs that build on a VM

#

and playfab cloudscript has nothing to do with any of this. You'll note that cloudscript is not the same as their multiplayer server offerings.

twilit radish
#

I don't see what Playfab or whatever has to do with this though? Wasn't the question how to synchronize rain? 😛

whole pine
#

idk, i dont get how the game can only call code if its open, and if its open a client is playing it

#

so how does the server call something on its own

#

lets say i have a random float generator in my game state, how do i make the same float outcome for all clients

twilit radish
#

I would like to ask trying to make it more clear what your current issue is and just in general elaborate on what you're trying to do as at this point I'm not sure what the question is any more. Are we just trying to get multiple players to see the same weather? What do those floats have to do with that? If the question is how a client can communicate with the server or vice versa then I would again like to point you towards the pins / the video from above. How to do that is covered in there with examples etc. and is generally a quite basic thing to learn about 🙂

whole pine
#

yes, just see same weather at same time

#

the floats were to generate random types of weather

#

i know how to replicate but i dont understand how rpc applies to the situation

#

cause a client needs to call the code

#

therefore a client is initiating the weather

twilit radish
#

I never mentioned RPCs though. That was in response to this:

sludge — Today at 22:02
idk, i dont get how the game can only call code if its open, and if its open a client is playing it
so how does the server call something on its own

twilit radish
whole pine
#

i just want all players to see same weather at same time depending on which one is chosen by a random float generator

#

currently i have it so that on a timer is an event that checks the time and depending on what hour it is, it makes a certain weather type play

#

if i want a random weather to play, and i play the weather based on the random float

#

every client will see different weather types

twilit radish
#

As I mentioned in the first message it would come down to the server having a replicated variable somewhere. I suggested using the game state for that as it seems like an appropriate place. All that variable has to do is tell clients "Hey this is the current weather". Whether that's a float, an enum or even a string in the end doesn't matter. Then you can use a so called "OnRep" which is just a callback to have clients change the weather when the server sends a changed weather state.

whole pine
#

oh i didnt know what a game state did til now

#

lol

#

thanks

whole pine
twilit radish
#

What does a pawn have to do with the weather?

whole pine
#

nevermind

thin stratus
hoary spear
#

Like some compendium you say?

twilit radish
thin stratus
#

Yeah I only read that last message

hoary spear
#

I was gonna say theres a pin for it even, but theres a boatload of pins these days 😕

thin stratus
#

Back to the top we go

#

Shameless but I consider that one of the first places to go for beginners. Everyone with more questions can scroll :P

hoary spear
#

I agree, most of the other stuff is for more advanced users

twilit radish
#

I do like that video from Alex as well. For me it was a good one in the beginning 🙂

sinful tree
#

The compenium is super helpful and helped me with learning multiplayer. Still reference it often 🙂

thin stratus
#

I can try shuffling that video up a bit. Not sure if one can reorder those easily

whole pine
#

this is in my gamestate, based on what hour it is its generating a random float once and activating the cooresponding weather

#

so if i have this running on a server, regardless if someone joins later they will see the same thing?

thin stratus
#

Well let'S assume that's the cleanest way to do it, so we don't move the problem away:

You do realize that only one of your brances is connect, right?

whole pine
#

ya

thin stratus
#

In addition, your RandomFloatInRange will produce 4 different random values, that's also clear, right?

#

And that a RandomFloat can also be 1.1 and never satisfy any of your 4 conditions is also clear, yeah?

#

Probably want the integer version of that

hoary spear
#

(Switch on int?)

thin stratus
#

Yeah that too...

twilit radish
#

With all the respect but this seems extremely chaotic / unmaintainable 😅

hoary spear
#

If possible /desirable

thin stratus
#

But again, improving the code itself doesn't help right now. I think it's better to get the code working first

#

Less confusing for them

thin stratus
#

This is currently the bigger problem

#

Not sure what comes after that

sinful tree
#

Yea, essentially will never be true.

hoary spear
#

The thing defining if they would see the same thing would be the replicated variable

#

OnRep would give late joiners the chance to update the local weather

thin stratus
#

Right, but none of those 4 branches will ever trigger

#

Unless lucky as hell

whole pine
thin stratus
#

Once every 325th moon

#

Almost

#

You only want one of those to fire or?

hoary spear
#

Again , random int into a switch on int