#multiplayer

1 messages · Page 680 of 1

pine sage
#

I've built a slot system using the controller, and it's not working well when I simulate ...

dark edge
#

That's nowhere near enough info to diagnose

pine sage
#

Well, one simple thing I tried: map Numpad + on the controller and Numpad - on the character and show a debug string

#
  • (controller) executes on both clients ... while + (character) shows only on each client, which is normal
#

how to make sure I have 2 different instances ? I see 2 players, and their movement are replicated, that should be enough to say that there is 2 instances right ?

#

is it normal to have this behavior with the a controller input ?

#

I am almost tempted to move the arrays I have on the player state to avoid those issues ....

limber mortar
#

I was correct, my issue is now resolved, damage wasn't applying properly

pine sage
#

Guess I'll have to do as you say:
You could do ‘Run on Owning Client’ to ensure things only run on that particular Client. You could also Spawn an Actor 'locally’, so actions will also not be replicated. Then use logic like: isLocallyControlled and Switch-Has-Authority ‘true’ to allow you to branch to that code uniquely for the Client that owns the actor with ‘all the calculations’ etc…

#

something like that ...

#

more IF XD

solar halo
#

Yep. I found out that apparently RedpointEOS plugin is causing the issue. I'll update when the issue is solved incase someone else runs into the issue.

tranquil yoke
#

Is there any way to check what objects got replicate and in what order ?

lavish dagger
#

hey all, I'm trying to figure out a network solution for a melee weapon actor that I'm programming, I'm able to make my Character do a replicated montage, but I've tried TakeDamage and ApplyDamage function in my actor and neither works on the client in a dedicated server setup. Works in standalone though.

void ASWeapon::CalculatePlayerWeaponDamage_Implementation(ASBaseCharacter* Enemy)
{
    Total_Damage = GetPawnOwner()->GetTotalDamage(bMelee, bSubWeapon, HitDamage, Enemy);
    FPointDamageEvent DmgEvent;
    DmgEvent.DamageTypeClass = WeaponDamageType;
    GEngine->AddOnScreenDebugMessage(19, 10.0f, FColor::Cyan, TEXT("Attacking Enemy on Local Game: " + Enemy->GetName() + ", TakeDamage: " + FString::SanitizeFloat(Total_Damage)));
    //Enemy->TakeDamage(Total_Damage, DmgEvent, GetPawnOwner()->GetController(), this);
    UGameplayStatics::ApplyDamage(Enemy, Total_Damage, GetPawnOwner()->GetController(), this, WeaponDamageType);
}

bool ASWeapon::CalculatePlayerWeaponDamage_Validate(ASBaseCharacter* Enemy)
{
    return true;
}

void ASWeapon::OnMeleeCompBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
    ASBaseCharacter* Enemy = Cast<ASBaseCharacter>(OtherActor);
    GEngine->AddOnScreenDebugMessage(0, 10.0f, FColor::Red, TEXT("Actor Found :" + OtherActor->GetName()));

    if (GetPawnOwner() != nullptr && GetPawnOwner()->GetMovementAction() == EALSMovementAction::Attacking && Enemy && !HurtList.Contains(Enemy) && GetPawnOwner() != Enemy) {
    
        HurtList.Emplace(OtherActor, Enemy->GetHealth());

        CalculatePlayerWeaponDamage(Enemy);

        for (auto It = HurtList.CreateConstIterator(); It; ++It) {
            GEngine->AddOnScreenDebugMessage(0, 10.0f, FColor::Purple, TEXT("Applying Force -> Actor Name # " + It.Key()->GetName()));
        }
    }

}
tranquil yoke
#

LogNetPartialBunch: Error: Attempted to send bunch exceeding max allowed size. BunchSize=70130, MaximumSize=65536
Anyone know about this error, Is it possible to increase the maximum size

novel siren
#

Kind of embarrassing, but for some reason I cannot get some "basic" replication to work (that I had working previously). I am trying to spawn an actor from client. (listen server model by the way). So far either it just appearing on the host (client or host call) or it just appears unreplicated on the person calling. My current set up is player controller on input event, store some variables (e.g., transform) -> client destroy preview (unrelated to the problem, but why the variables have to be stored) -> server spawn (passes the variables over to the server). Server spawn, stores the variables and calls multicast spawn. Multicast spawn takes the data from the server and then spawns actor from class. This set up results in just the host seeing the actor. The actor is replicated.

#

never mind I think I resolved it. (too tired to be doing this if i am making these kinds of simple-ish mistakes)

sinful tree
novel siren
#

Which is what I was attempting, when it wasn't replicating I tried to use multicast

#

when I did it as server only, client calls got ignored

#

however, fuck me... I found the reason. The variables are not being stored correctly

#

(that is why it was glitching out. I just stored the replicated variables in the wrong spot. So when nothing was showing up it was because all the settings were null)

sweet zodiac
#

does anyoneen have a bp tutorial that they know actually works for multplayer (not on the same lan)

novel siren
#

by not the same as LAN, I assume you are looking for a non-listen-server style?

#

You want a dedicated server?

sweet zodiac
novel siren
#

so a listen-server

#

So in terms of programming gameplay, LAN and listen-servers are the same. How the lobbies are formed, how people can see them are different. And that comes down partially to subsystem you are using (NULL, steam, etc.)

keen surge
#

LAN isn’t the same

hollow eagle
#

They're the same as far as unreal's server setup and networking goes. Not the same in regards to session handling/online subsystems.

#

Sounds like this is a question about online subsystems though.

keen surge
#

Think he was just asking for tutorials, in which case there is quite a bit in pinned messages

hollow eagle
#

Yeah.

keen surge
#

As well as a BP only tutorial series from unreal on youtube

bitter oriole
#

Only difference between LAN and online is that the default NULL subsystem is LAN only, so you need Steam or EOS or another service to matchmake over the Internet

#

Usually for Blueprint developers that mean downloading Advanced Sessions plugin and calling it a day

#

The rest is regular multiplayer stuff

boreal wadi
#

Having a weird issue where positions or the meshes are different on the server and client. What is the setting to make the server sync bones and animation. I know the Set Tick Pose & Refresh bones setting in the character mesh but thats not working. Example of why this is a huge problem. On my client where the simulated mesh is I'm getting a hit with my projectiles but its not registering on the server because the mesh isnt really there. This only happens when my AI are moving. I have to lead my projectiles extremely far to get a hit. Its weird.

bitter oriole
#

As far as I know there's no "setting" for that - animation is locally driven and getting it to sync is a lot more complicated than you might think

#

Shooters usually trust clients to some extent on this

meager spade
#

you you need some sorta fudge factor

#

or*

#

shooter game does that

bitter oriole
#

If the shot makes it through the player capsule and is head-height and the client says it shot the head, well, hard to prove that it didn't

meager spade
#

but yeah, games like Fortnite, etc, trust the client on what they hit

#

as bone detection is not accurate on the server

hollow eagle
#

There's always the classic source multiplayer networking article (https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking, talking about the lag compensation section), but that's the "hard" way to do things. Probably only necessary if you're building a highly competitive shooter like CS. And you won't find any built-in way to do that, it's going to be all custom.

boreal wadi
#

Im confused on how that works. Im spawning my projectiles via the server so how can the client say it hit something?

bitter oriole
#

So when you shoot someone in the head, it's fundamentally unfair because you are doing it to a character that's about your lag time + one server frame + the other player lag old

#

The other guy might have got hidden since that

#

There is no way to know but now you've shot them in the head and the game needs to decide what to do

#

Usually, games trust the client shooting to a large extent, that is, to the extent you can't prove they're cheating

#

Which is to say that games often don't do actual hit detection on the server

boreal wadi
#

So now my question is do I spawn client sided projectiles and call a server function when they hit.. I feel like thats saying hey come cheat here. lol

bitter oriole
#

If you have actual projectile weapons with slow travel time, and they don't collide at the capsule level but at actual geometry, it gets really tricky to implement well

boreal wadi
#

Right now Im using Unreal Tournaments projectile logic. Its watered down a ton though probably need to look and see what else they did for latency. Right now im testing with 240 ping..

bitter oriole
#

(240 ping is probably a somewhat worst-case value where you should expect competitive play to break down a lot, 100 has been a max ping limit for years)

boreal wadi
#

And yea Im colliding at the mesh level.. I guess what I could do is collide on capsule level on the server and let the client collide on the mesh for fx and what not. but I think my prob will still be the same.

meager spade
#

i never bothered with client side projectiles, (my projectiles are only things like sniper bullets, rocket launcher, grenades, etc) and you can kinda just mask them behind FX.

boreal wadi
meager spade
#

no, i use projectile for those

#

normal weapons are just hitscan

bitter oriole
#

My thinking is pretty much that you can have

  • accurate weapons with client-side detection on the shooter (sniper, assault rifles) with line tracing
  • explosive weapons (rocket launcher etc) that use projectiles + capsule hit detection
meager spade
#

those are client authoritive

boreal wadi
boreal wadi
meager spade
#

a lot do

#

some use fake projectiles (where they tick the bullet without using physics)

#

there are advantages and disadvantages to both

bitter oriole
#

Everything has to be completely deterministic to a very high degree

#

If your client shooting the gun suddenly has 20ms more lag, it's likely to throw off the whole thing

vivid seal
#

is there a "go-to" way to handle initializing replicated UObjects on the client? I'm running into what feels like the same issue for Buffs, Stats, Resources, etc. where I set them up on the server and replicate them using ReplicateSubobjects then have to set them up on the client as well in either an OnRep of something or in PostNetReceive, or replicate the pointers to the objects as well in an array on whatever is managing them and then check them for IsValid and initialize them there in the array's OnRep. where do you guys do initialization logic for UObjects when they first get replicated to clients?

boreal wadi
#

Well the good news I didnt build a bunch of abilities that I'll have to rewrite

boreal wadi
#

So after turning on the capsule collider in game so I can see it. Everytime my ai moves the capsule collider moves and the mesh lags way behind.. This is where my problem is coming from.

chrome bay
#

Because you don't get a steady stream of position updates, the mesh interpolates it's relative location to the mesh for smoothing.

#

Otherwise it would look snappy and jumpy in a real-world situation

boreal wadi
#

its super far off like 2 whole meshes off.

chrome bay
#

Well the default distance before it snaps is 384 units.

#

So nearly 4 meters

boreal wadi
chrome bay
#

You can adjust NetworkNoSmoothUpdateDistance in character movement to limit it

#

But bear in mind, it's got nothing to do with ping

#

Packet loss and bandwidth constraints is the reason that smoothing exists

#

But if you do want to mess with it in realtime you'll need to adjust the CMC's cached value in the client prediction data too

rain coral
#

Is it considered overkill to blast the server with RPCs every frame, for each client?
Considering that the server sends info at a limited rate, I was wondering what the recommendations are for the other direction

bitter oriole
#

If it's unreliable RPC, it's fine

#

pretty much how aiming or moving works

rain coral
#

@bitter oriole Yeah ok! I'm thinking it's mostly unreliable ones, such as aiming/moving

bitter oriole
#

Reliable RPC on tick would definitely kill your game quickly

#

Especially on a fast-running 120fps client with bad connectivity

rain coral
#

Ouch yes

chrome bay
#

You should really limit it to some cap anyway though, and try to condense things down if you can.

#

Even if they aren't sent or don't cause slowdowns they can still choke everything else you may want to send.

rain coral
#

One thing I could do is to compare if a change has been made. But that makes me wonder if I should send all the data in separate RPCs, instead of in one struct. If I send the entire chunk of data each time even if only one property has changed, that seems a little overkill

chrome bay
#

Depends, generally there's very little reason to send anything to the server at such a high rate anyway

#

Movement commands are really the only exception

#

Separate RPC's has it's own overhead anyway

#

Fewer you send the better

#

After a certain point not sending the whole struct becomes diminishing and more prone to error

rain coral
#

Yeah hmm

#

At least if there's a large amount of things that rarely change together with a small amount of things that rapidly change, it seems like perhaps there could be a compromise with using two RPCs?

#

One struct is convenient for several reasons though. For instance more simple to save a buffer/history

prisma snow
#

Is it feasible to replicate an array (up to 2000 items, each being a struct with some floats/vectors, not more than 4-5) using FFastArraySerializer, in 100 milliseconds (or 10 times per second)?

#

Alternatively, is there any way that I can calculate the approximate cost? I can get the bit size of each replicated variable and multiply, but idk if that is realistic, and to which point Unreal is optimizing it

bitter oriole
#

5 floats is 20 bytes so that's a constant 400KBps bandwidth potentially

#

Assuming 5 float vectors that's 1200KBps

#

Not impossible strictly speaking but unrealistic

#

Needs to push all bandwidth limits of the engine and it'll only actually work if only part of the array is affected

prisma snow
#

But probs it's still too big, idk

#

And in the worst case scenario all the array could be affected at the same time

prisma snow
bitter oriole
#

That's if you only have a total of 5 floats per struct, yes

prisma snow
#

Yes, exactly

#

I could do with 3, so 240KBps, is that still bad?

bitter oriole
#

I think the engine default is like 10KBps though it's a conservative value

#

But hey, try it

prisma snow
#

:D

bitter oriole
#

See in real world conditions how long it takes for each update to go through

prisma snow
#

sounds reasonable

#

is there any way I can benchmark it?

#

afaik server doesn't know when a client recieves a rep

bitter oriole
#

Build yourself a few test arrays, rig some buttons on screen for each, and then on the client test on tick whether the current value is the test one, then print which it is on screen

#

Run client and server with pktlag 50 and check visually

prisma snow
#

👌

bitter oriole
#

There's really no better test than real-world but if that works flawlessly for you with reasonable lag, it's likely that you can move ahead with the idea

prisma snow
#

Well this is going to be interpolated, so I was planning to have 2 cached values (200 milliseconds overtime)

#

and this is a very worst case scenario, usually I would have much less items

#

half or less

lavish dagger
#

okay, this sounds dumb but in C++, how can I tell the server to apply damage from an actor owned by the client?

bitter oriole
#

RPC the server and apply the damage there

lavish dagger
novel siren
#

right, I am getting cross-eyed. So probably logical issue here. Code is in C++ but I was testing some of it it in BP to see if the logic was correct. When I converted the logic (the functions were in C++ - see screen shot) the implementation stopped working (i.e., the spawned building would only show up on the host's screen). I must have changed something in my code because now neither the pure C++ or the BP version work. Screen shots show the logic used.

On Primary action, the PlayerController checks if the the preview building exists (the building is replicated). If it is and it is in a a valid spawn area, then there is an ROC for storing variable (before any asks why I am using the controller to pass information to and from the same source, I had issues with replication and that solved them). The preview is destroyed (as the preview is only visible on the person who spawned it, works for both client and host). Then there is a server event to spawn the building (under construction; again had the same issues where i needed to use the controller to pass information to and from the same source).

Here is the logic in BP. I can share code for each part as needed:

#

also as a side note to this error:
when the host spawns a building under construction, it shows up as a building under construction (only the host can see it)
when the client spawns a building under construction, it shows up as a building that is constructed (only host can see it)

winged badger
#

you only need one server RPC, and a confirmation back

novel siren
#

what the host sees (host under construction on the left, client on the right):

winged badger
#

buildings are, i assume replicated

novel siren
#

what the client sees:

#

@winged badger
to your first comment, there is only one server RPC. The other are client, just so data can be stored between the deletion of the preview and the server event
and yes

winged badger
#

preview should generally only be local

novel siren
#

preview is only local

#

the left most is not preview it is under construction (no mesh or materials. so I made a place holder)

winged badger
#

then client stores the data and sends the Server RPC to spawn the construction site

novel siren
#

yes

winged badger
#

of type at certain transform

novel siren
#

that is how it is set up currently

#

and of the row name (as it is a datatable)

winged badger
#

Server sends a client RPC confirming action suceeded/failed

novel siren
#

That part is the part I might be missing

winged badger
#

thats it

#

no other client RPCs are required

#

building should replicate its own stuff

novel siren
#

it's not though

#

based on the screen shot (with the two buildings) I can tell you that some of the server events aren't firing correctly

winged badger
#

also, using GameplayTags names for rownames makes for more convenient use/networking

novel siren
#

^that will be addressed in refactoring/clean up

winged badger
#

as you can spawn building by gameplay tag then

novel siren
#

I will tackle that issue down the road and refactor as needed (waiting on information from designers).

winged badger
#

server doesn't need to tell the client to destroy the preview

#

separately

novel siren
#

That part works fine

#

it is literally just the last node that isn't working

winged badger
#

well, i haven't seen what that function does

#

no idea what blueprint its in

#

and you haven't confirmed buildings are actually replicated

#

oh you did

novel siren
#

I did

#

and I also stated what blueprint

#

it is in player controller

#
void UBuildingManagerBase::ROS_SpawnConstruction_Implementation(FTransform TargetTransform, FName InRowName)
{

    TSubclassOf<ABuildingMasterBase> BuildingClassLocal;

    // use deferred spawn to begin all the various aspects the system needs
    ABuildingMasterBase* ConstructionBuildingLocal = Cast<ABuildingMasterBase>(UGameplayStatics::BeginDeferredActorSpawnFromClass(GetWorld(), ABuildingMasterBase::StaticClass(), TargetTransform));
    if (ConstructionBuildingLocal != nullptr)
    {
        BuildingRef = ConstructionBuildingLocal;

        BuildingRef->GetClass()->ImplementsInterface(UBuildingInterface::StaticClass());

        IBuildingInterface::Execute_TriggerSetRowName(BuildingRef, InRowName);
        IBuildingInterface::Execute_TriggerSetOwner(BuildingRef, ControllerRef);
        IBuildingInterface::Execute_TriggerSetConstructionStatus(BuildingRef, EConstructionStatus::UnderConstruction);

        // finish spawning the building.
        UGameplayStatics::FinishSpawningActor(BuildingRef, TargetTransform);
    }
}
#

that is the code for that node

winged badger
#

its a little weird, but it should be working

novel siren
#

It was earlier too

#

I know that the client isn't firing it from use of break points and because 'IBuildingInterface::Execute_TriggerSetConstructionStatus(BuildingRef, EConstructionStatus::UnderConstruction);' is the the line that made the materials different

winged badger
#

first you don't need GameplayStatics here

novel siren
#

Really? damn it ever example I saw used it. Can I just drop that?

#

(and without it I get an error message)

#

wait....

#

stupid question.
If the ABuildingMasterBase is set to replicate... do I need it to be on a server RPC?

#

can I just make it a regular function?

winged badger
#
FActorSpawnParameters SpawnInfo;
SpawnInfo.bDeferConstruction = true;
SpawnInfo.Owner = this;
SpawnInfo.SpawnCollisionHandlingOverride = whichever you need here;
ABuildingMasterBase* NewBuilding = GetWorld()->SpawnActor<ABuildingMasterBase>(AbuildingMasterBase::StaticClass(), TargetTransform, SpawnInfo);
// don't really need the interface either
NewBuilding->SetRowName(InRowName);
NewBuilding->FinishSpawning(TargetTransform);
novel siren
#

SpawnActor doesn't work for me

winged badger
#

this is deferred construction

#

2nd line of the snippet

novel siren
#

can I still do 'IBuildingInterface::Execute_TriggerSetRowName(BuildingRef, InRowName);' between SpawnActor and FinishSpawning?

winged badger
#

yes

#

GameplayStatic are just awkward wrappers for this

novel siren
#

I will try that approach, ideas about my question around the fact it is set to replicate and not needing a server RPC for the spawn?

winged badger
#

you def need a server RPC to spawn it

novel siren
#

that is what I thought, but I just wanted to double check I had not missed something bloody obvious

winged badger
#

best to have SpawnCollisionOverride set to AlwaysSpawn as well

novel siren
#

was going to adjust but always spawn

winged badger
#

if you're doing manual checking for room

#

as that pretty much makes you, instead of the engine, control the spawn checks and transform

#

and you really don't want 2 different algorithms running CanSpawn and Spawn

#

if something appears not to be spawning

novel siren
#

also I do need the interface

winged badger
#

compile DebugGameEditor, start the editor from VS, breakpoint ABuildingMasterBase::BeginPlay, add AActor::Role, AActor::RemoteRole and AActor::Owner to the Watch

#

and see what hits

novel siren
#

those variables are set to private with the setters set as private

#

testing now

winged badger
#

interface is useful to have shared API on otherwise dissimilar Objects

novel siren
#

what i have now btw is:

    FActorSpawnParameters SpawnInfo;
    SpawnInfo.bDeferConstruction = true;
    SpawnInfo.Owner = ControllerRef;
    SpawnInfo.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;
    ABuildingMasterBase* ConstructionBuildingLocal = GetWorld()->SpawnActor<ABuildingMasterBase>(ABuildingMasterBase::StaticClass(), TargetTransform, SpawnInfo);

    BuildingRef = ConstructionBuildingLocal;
    BuildingRef->GetClass()->ImplementsInterface(UBuildingInterface::StaticClass());
    IBuildingInterface::Execute_TriggerSetOwner(BuildingRef, ControllerRef);
    BuildingRef->FinishSpawning(TargetTransform);
winged badger
#

if you don't plan on something else that is not a building, running the building interface

#

then you really don't need it

novel siren
#

was cutting back on dependencies between the classes is all

winged badger
#

as far as i can see now, that interface can just be part of AbuildingmAsterBase

novel siren
#

didn't work

#

adding break point now in VS

#

might be a bit slow (just got a work call) will do the debug in a moment

#

Role = ROLE_Authority
RemoteRole = ROLE_SimilatedProxy
Owner: BP_PlayerController C 1 (which is the the client, and I removed the underscores due to discord)

#

with your version of the code, it destroys actor because the rowname isn't set

#

with my version:
Role = ROLE_Authority
RemoteRole = ROLE_SimilatedProxy
Owner: BP_PlayerController C 1 (which is the the client, and I removed the underscores due to discord)

so the same

#

HOWEVER

#

it fires a second time on my version
and the second time it fires its owner is BP_PlayerController C 0 (the host)

novel siren
#

yeah still cannot see why it isn't working

woeful schooner
#

hello friends, with 4.27, I compiled my project from visual studio as development editor and then as a developmend server. I opened maps called Entry Level Transition level and GameMap. My game will support single player and multiplayer, so I need to add a startmap other than dedicated, but I cannot add a server when the game opens, how can I prevent this?

meager spade
#

@slow mirage on your skeletal mesh component of your character, set Anim based visibility option to Always Tick Pose and refresh bones

slow mirage
meager spade
#

@grim geode void ClientTeamMessage(class APlayerState* SenderPlayerState, const FString& S, FName Type, float MsgLifeTime = 0); on the PlayerController

#

we store the teams playerstates

#

then we have a server rpc from the caller, which grabs the team info actor, grabs the teams controllers, and then does those client rpc's

#

this is done via our APrivateTeamInfo actor (based on AInfo)

#

privateteamactor is spawned unique for each team and holds who is on that team

#

yes

#

that is where it gets tricky, cause you don't want to do RPC's for that

#

we haven't actually done that, but you could use a kinda replicated array of messages

#

with a set size limit

#

and pop old messages when the buffer fills

#

the OnRep of this array can update the clients global chat window

#

well Steam actually has a way to send lobby messages

#

EOS i think also, otherwise you will need to do some kinda socket thing (or via beacons if you use them)

#

not familiar with mobile games sorry or the limitations of them

#

i am sure it does, yes

#

another way is to use beacons, but that is another big rabbit hole.

chrome bay
#

Don't have to

dark edge
#

Yeah you're not gonna get that for free. See if there's a plug-in.

#

If you have to ask the questions, you aren't going to have a thousand person lobby on mobile. Start small until you know what you're doing.

#

Yeah that's a big operation.

chrome bay
#

There's nothing like that built in on PC

boreal wadi
#

Something weird is going on. When I show the capsule in game the mesh is super far from that capsule not inside it. I thought It could be because of my network settings where i'm simulating a bad connection with 240 ping but I opened up a fresh project and added the same networking settings and the mesh is lined up perfectly with the mesh. So what would be a reason the capsule is moving without the mesh? This is happening in my AI as well as my player controlled characters

dark edge
#

Start with being able to run around and see each other on mobile, with local chat. That'll keep you busy for a while. Learn how to crawl before attempting to Sprint.

boreal wadi
dark edge
boreal wadi
#

The only code to move the mesh is when you are the client, it moves the 3rd person mesh behind so the shadow doesnt affect the fp arms.. I can double check that this is not happening on the server

meager spade
#

that feels weird

#

but yeah feels like server is being pushed behind, you want to only do things like that on IsLocallyControlled pawns

boreal wadi
#

Thats the thing. This code is only on my player character behind a IsLocalPlayerController() check.. So the AI shouldn't be doing this at all because the only extend the base class which has nothing about moving the mesh

meager spade
#

but that looks about right though for simulation, let me check how far my ai drift

#

yeah mine is very tight

#

hardly noticable even at 200ping

#

whats your net update rate

#

of the ai character?

#

then again the capsule is moving ahead

#

did you tweak any values

#

with regards to the interping?

#

these settings

boreal wadi
#

In the CMC? I did. mine look like this

meager spade
#

1.0 seconds?

#

between corrections?

#

should be .1

#

also smooth location time is a bit high

#

at .5

#

.1 to .2 i found the sweet spot to be

boreal wadi
#

Okay that was the setting that was making that happen. although it does say its not used in linear interp. Have you noticed any differences between exponential and linear.

meager spade
#

your interp is exponential tho

#

so it is used, and exponential is the best for listen servers (only one allowed on listen servers)

#

and yeah, never used linear

boreal wadi
#

Well thanks. Now that I see what these settings affect. I wonder if its possible to adjust these values by view angle. Like if you are not being rendered to a client then throttle you to update less frequent. Is that a server side optimization or gameplay side?

kindred widget
#

As far as I am aware, there is nothing of this sort out of the box. If you want some form of global chat, you are likely looking at implementing your own backend server in PHP/ASP.NET with some form of connection between Steam for profile information and game systems to send/receive the information. It's not an easy task unless you have network engineering experience.

#

Although now that I've said that I went searching and found some interesting Steam API stuff...

novel siren
#

@winged badger found that issue from earlier. Know how I said it worked earlier? I made an update from boolean logic to using enums for one of the settings. Forgot to replicate the damn enum.

kindred widget
#

There are some clan chat things that look fairly easy to implement. I'm not seeing anything past that though.

sinful tree
#

There's also a built-in XMPP client in the engine.

#

You can make it so your game servers connect to an XMPP server and relay the messages sent from the clients, then the servers receive the messages and then display them to the clients.

clever plinth
#

I'm looking for recommended reading on how to represent and transmit the state of a networked strategy game. Anybody have any references they particularly like?

peak sentinel
#

Is there ANY replication function/method that could cause my pawns reset their location back to where they spawned?

#

I'm having a weird issue that when my pawns die and start simulating physics on skeletal mesh they reset their world location to where they placed on level or spawned

#

This issue was combined with an engine rendering bug that I already submitted a report, I somehow found a workaround to avoid that rendering bug but this issue persists and only clue I have is, this happens only on server

#

Though GetActorLocation returns the location where they started simulating physics, but their mesh is resetted to their spawned location. So actor location is being reset, skeletal mesh is. What's eating me is this is only happening on server's viewport

vivid fern
#

hey there, i'm currently trying to create a local server aswell as clients in the windows command promt, the server seems to function and the clients load into a world, however i don't think they're connected to the server since there is nothing new in the server logs when i load them up and they can't see each other either. here are my instruction lines::(without ip adress lmao)
for the server: "E:\unreal engine\UE_4.27\Engine\Binaries\Win64\UE4Editor.exe" "E:\unreal engine\Kurs\multiplayer\multiplayer\multiplayer.uproject" /Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap -server -log
for the clients: "E:\unreal engine\UE_4.27\Engine\Binaries\Win64\UE4Editor.exe" "E:\unreal engine\Kurs\multiplayer\multiplayer\multiplayer.uproject" ipdadress -game
i'm glad for any help since i'm rather certain i did just like the gamedev instruction course i'm doing said, and i'm also pretty sure my ip adress is correct since i checked it with multiple websites. do you see anything i could've done wrong?

#

got it fixed using the universal IP-adress in the course, my assumption is that it has something to do with the browser security i'm using (although idk how since i don't use vpn or tor) or with me using wifi instead of ethernet to get my connection

#

ideas on how it happened are still welcome 🙂

thin stratus
#

If you do it via CMC you will ensure that both corrections and replaying moves function properly

#

Given you implemented it correctly

lavish dagger
#

is there way to call SetScalarParameterValue and SetVectorParameterValue on a server owned actor's material instance from the client? I tried to create a server function but it doesn't seem to work when playing as the client

winged badger
#

as dynamic material isntances are generally not replicated

gleaming kite
#

having an issue where im running a rep notify on the server but the rep notify only seems to be updating the other actors in my game rather than the actual client. I have it so it increments a value on the server and tells the clients to print that value out (and also store it in a local variable.) but when i manually tab into the other clients or server in the editor, its like nothing has happened, neither the local or global variable shows any difference, even on the server.

#

red and green values is the servers output of the variable before and after the rep value is set

gleaming kite
#

ok it seems like none of my attempts at replication are successful. Im running these on the server, are replicated values not possible on your player controller?

dark edge
gleaming kite
#

and this is how i was calling it. The function already run on the server.

#

its basically meant to increment the variables for all users on pickup (eg. slender but multiplayer, every page someone collects contributes to the 10 page goal)

gleaming kite
#

If anyone sees this, don’t hesitate to send an answer if you can, I’m at a complete loss

kindred widget
#

@gleaming kite What is your intention here? You said this was on the playercontroller but also said you wanted this to happen for all players?

#

I ask because PlayerController is local and server only. Client1 has it's own controller, Client2 has it's own controller. Server has Client1 and Client2's controller. But Client1 does not have Client2's controller, etc.

gleaming kite
#

I’m trying to replicate an item pickup to other players. (Player picks up item > that value is replicated to other as a sort of shared inventory)

#

And I already have an inventory system I made so I would like to use that for the items, but instead of adding it to my local inventory I want to add it to a shared inventory

kindred widget
#

If you need these values per player, I'd consider their PlayerStates. If this is just a simple single game wide value, then GameState is probably the place for it.

gleaming kite
#

Ah ok. Any reason even my multi cast for a variable wasn’t working? Is variable replication through the player controller just not possible?

#

And thank you very much for the help

kindred widget
#

Clients have only their own player controller. An object has to exist on the machine before it can receive data. So if Client1's controller on the server sets a replicated property or calls a multicast, it's only going to go to Client1. Because that controller does not exist on Client2.

#

eXi has a diagram thing somewhere.

gleaming kite
#

Ah ok! I understand thank you

kindred widget
gleaming kite
#

I’ll be sure to save this thank you

thin stratus
#

It's in the Compendium

#

:P save that one, makes more sense

gleaming kite
#

Where is it?

kindred widget
#

Yeah. Second pin in the channel.

gleaming kite
#

Ah gotcha, thank you

modern island
#

Is there a way to choose which network a LAN listen server is hosted on? I am trying to connect through a router with no internet connection through LAN while the host has another network connected to the internet. The only solution I can figure out is by unplugging the internet connection, which is not ideal. How would I go about forcing the server to go through the second router?

modern cipher
blazing sinew
#

sorry guys, do u know how can I show a widget only for the player that interact with the actor?

blazing sinew
#

becuase it shows the widget to all the players in the server

#

do u know how can I solve that, guys?

bitter oriole
blazing sinew
#

is that possible?

#

I tried to do this with the key E without colliding, and in fact when the player press it only his client can see the widget and this is what I'd like to do with the collision too

#

it works only if I use a key, do u know how can I solve that problem? (and so use the collision)

bitter oriole
#

Sounds like you just need t owire collision events to what the E key does

autumn prairie
#

it works only if I use a key? your saying that this only works when using a key on your kb/m?

autumn prairie
#

you should not be storing widget data in the blueprint of the character.

blazing sinew
blazing sinew
bitter oriole
#

Now check whether the overlap event fires

autumn prairie
#

did you try adding it to begin play?

blazing sinew
#

let me try

blazing sinew
autumn prairie
#

so you want it to only spawn on one of the players?

blazing sinew
#

exactly but only when he dies

#

so when he collides with the box int the bp actor

autumn prairie
#

so IF the character is dead, if true, display widget.

#

if false don't display widget.

#

so do you have a is dead booleon?

blazing sinew
#

no, I'm gonna creating it

autumn prairie
#

You need to think about these things bud 🙂

#

how is the game going to know if the character is dead, if you never made a value for it

#

are you using ragdoll?

#

you can always say, when the character is in ragdoll

#

display widget

blazing sinew
#

I'm a beginner, so I'm not very good at the moment 😆

autumn prairie
#

its all good man

#

make sure your replicating values like ISDEAD

#

but your doing things correctly tho i seen you replicate to client perfectly int he last screenshot

blazing sinew
#

so I should put the IF statement (or branch) into the event tick?

#

or in the event that I created before?

autumn prairie
#

question tho

#

did you add it correctly?

blazing sinew
#

yes

autumn prairie
#

When the players health turns to 0 the is dead value should be checked to true

#

okay

#

making sure

#

this is why i put everything in the playercontroller btw 🙂

#

or game state

#

i mean basicly now that the character knows he is dead, you can add the widget with a branch node.

#

Wait

#

make a custom event

#

for server

#

SV_isdead drag the bool in

#

make a client verson and drag the server to the client

#

that way you are replicating correctly.

blazing sinew
#

like that?

autumn prairie
#

yupp

#

i wish i could open the editor and show you lol i messed up.

#

recompiled engine source 😦

#

the widgets should be client only

blazing sinew
#

so did you recompiled all the engine source?

autumn prairie
#

sense there is not reason to run them on server.

#

the disable movement should be on server.

blazing sinew
#

ok

autumn prairie
#

where are you calling the server event?

blazing sinew
#

in the "On Component Begin Overlap"

blazing sinew
#

if I put the disable movement on server the others players can't move too

autumn prairie
#

thats because you are telling the server the player is instantly dead.

#

take a look at the video above.

#

got to go to work tho 😦

#

talk to you later!

blazing sinew
#

👍

frank birch
#

any resource in network prediction? I am trying to get a pawn that is NOT a Character to replicate and not be jittery 😦

#

ok, it is something

    /*
    ========================================================================
    Here's how player movement prediction, replication and correction works in network games:
    
    Every tick, the TickComponent() function is called.  It figures out the acceleration and rotation change for the frame,
    and then calls PerformMovement() (for locally controlled Characters), or ReplicateMoveToServer() (if it's a network client).
    
    ReplicateMoveToServer() saves the move (in the PendingMove list), calls PerformMovement(), and then replicates the move
    to the server by calling the replicated function ServerMove() - passing the movement parameters, the client's
    resultant position, and a timestamp.
    
    ServerMove() is executed on the server.  It decodes the movement parameters and causes the appropriate movement
    to occur.  It then looks at the resulting position and if enough time has passed since the last response, or the
    position error is significant enough, the server calls ClientAdjustPosition(), a replicated function.
    
    ClientAdjustPosition() is executed on the client.  The client sets its position to the servers version of position,
    and sets the bUpdatePosition flag to true.
    
    When TickComponent() is called on the client again, if bUpdatePosition is true, the client will call
    ClientUpdatePosition() before calling PerformMovement().  ClientUpdatePosition() replays all the moves in the pending
    move list which occurred after the timestamp of the move the server was adjusting.
    */
#

(still, if somebody has any resource on this topic, I am more than gratefull)

thin stratus
#

The only resource I can remember

#

has some interactive demo (2D, 2 balls) at the end to explain what is going on

#

It won't necessarily help you implementing it, but it should make sure that you understand what has to be done

#

Not UE4 related though

#

Just generic

frank birch
#

❤️

lavish dagger
chrome bay
#

You don't modify them directly, you send parameters that clients apply to their local instance

#

But really since it's a visual effect, networking shouldn't be involved at all (unless for some reason the client can't do it themselves)

lavish dagger
shy solstice
#

Hi. Setting up DORMANCY seems to doesn't work at all in blueprints. Anybody can confirm?

chrome bay
#

Works okay for me

#

Is this a custom class or something?

#

If so make sure you aren't calling SetReplicates() in the C++ constructor, otherwise the actor gets added to the network driver before BP settings are serialized.

#

The engine will log a warning about it, silently.

frank birch
#

When an actor is set to replicate it's physics: do I get an event/method/notify clientside when the server sends the order for that actor to be somewhere? 🤔

#

if I had to name it, it would be something like "onServerTick"

chrome bay
#

On the server you have PreReplication()

#

On the client you have rep notifies

frank birch
#

Is there a repnotify for the physics being corrected? 🤔

chrome bay
#

PostNetReceivePhysicState

#

Which is called by OnRep_ReplicatedMovement()

frank birch
#

that's the good stuff 😄

chrome bay
#

OnRep_ReplicatedMovement() is the rep notify for replicated movement, which in turn calls some other virtual functions

#

The smoothing may interfere with things a bit

shy solstice
#

@chrome bay it's Pawn class. Movement is custom

chrome bay
#

Pawns probably can't be dormant

shy solstice
#

I dont interfere in C++ code

#

i switched off Replicates - no change

chrome bay
#

If it doesn't replicate it can't be dormant

#

Dormancy has no meaning to a non-replicated actor

shy solstice
#

Is Dormancy only for native movement?

#

perhaps?

chrome bay
#

nope

#

Dormancy is unrelated to movement entirely

#

Are you using replication graph?

shy solstice
#

On host i'm setting vector and client receives it and Sets actor location

#

i dont use repl graph

#

it's 100% blueprint project

chrome bay
#

Why would you want a pawn to go dormant anyways?

#

One thing with possessed pawns is they are always force-replicated

shy solstice
#

Ok let me ask this way. Does Dormancy should impact all replicated variables?

#

in class

chrome bay
#

yeah it affects the whole actor

#

when dormant, the channel is closed

#

When it wakes, the actor channel is recreated and every property is sent again

rose egret
#

@chrome bay is net dormancy something after net relevancy ? cause if actor is not relevant its channel is closed as well 🤔 AFAIK

chrome bay
#

similar but not the same. relevancy destroys the actor client-side for one thing, dormancy does not

shy solstice
#

@chrome bay one last hope. maybe it only works with real network test, not local?

#

i tried everything, two people on the internet wrote same thing, they tried everything, still replicates

chrome bay
#

tbh it's blueprint, anything is possible. I would try with an actor that isn't a pawn

#

A pawn going dormant is probably not that common, it might be the engine has something preventing it ever going dormant

shy solstice
#

yes, ive checked, for class Actor dormancy works

#

thx

#

BUT ! Now it only works only when class default is dormant

#

But not when i trigger it from gameplay

#

A print string gave result in log

#

@chrome bay

#

Any idea? xd

chrome bay
#

no idea

#

dormancy takes a while to kick in

#

The most recent changes have to be sent and acked first

#

Blueprint might do something stupid like flushing dormancy if you change a replicated property automatically, IDK

gleaming kite
neon mango
#

Trying to test server travel in editor but I get "TravelFailure" LoadMapFailure: "Failed to load package because the map is appended with the prefix "UEDPIE_0_", is the only solution not to run this kind of test in editor?

real cedar
#

So I'm using Advanced Steam Sessions, and when I have one client create a session to host, the second client can find it in the server list, but it does not show the correct player count as it shows 0 players connected, and when I click on the server to join the session, it is successful, but when client 2 loads, it looks like it's in it's own session as client 1 is not there. Where should I start looking to get this corrected? I did see a warning message saying Script Msg: FindSessionsCallback - Invalid player state and am wondering if that's why client 1 doesn't show correctly?

I am using 4.27.

#

I have tried going through the forums of Advanced Steam Sessions and searching through here already, not sure if I was using proper search terms as couldn't find specific to this case.

neon mango
real cedar
neon mango
#

You can also try with Open "IP OF LISTEN SERVER"

#

I too am using Advanced Sessions and am having some odd issues but I don't think it is Advanced sessionis.

#

I can connect to my PC only via Open IP (SO it seems firewall isn't in the way) but Advanced Sessions "Find Session" isn't working

#

But same project on laptop connects just fine via Find Session

real cedar
#

Oh ok. Find session shows me the server is up, but doesn't seem to see the players. So maybe it is only half working, I dunno...

neon mango
#

Do you have a game mode and game state? Are you handing player starts and Event for Post login ?

#

There are a few things that I could see going wrong that would make it seem like the 2nd player isn't there even though they connected to the server

real cedar
#

I do have game mode and game state. I haven't done anything for post login yet.

#

I put a text widet on the screen that runs on tick that counts how many networked players are connected and for both clients, it only shows 1

neon mango
#

How is the counting done?

real cedar
#

Function inside advanced sessions

keen surge
#

Start by logging a lot more...

#

There’s a lot of info you can just print on joining session

neon mango
#

Hmm I think Get Num Players is called from Game Mode which is ran on server only

keen surge
#

As well as session details, and actual log file

#

You’re kind of just shooting in the dark now

#

Rather try to find out and pinpoint what’s going on, where does it go wrong

real cedar
#

Well from the server list, it doesn't seem to grab correct players, that is the first issue I notice

keen surge
#

What do you mean with “correct players”?

real cedar
#

It does see the server, just doesn't display correct number of players

#

correct number of players

keen surge
#

That’s very weird

real cedar
#

It shows 0 when there is 1 client connected

keen surge
#

As a valid session would have 1 indeed

#

How did you get that 0?

real cedar
#

So maybe as Nonlin was suggesting, I should have some sort of event post login ?

keen surge
#

Do you get it from the found session result?

real cedar
#

From the found session result

keen surge
#

That’s very strange

real cedar
neon mango
#

Are you actually joining the found session?

real cedar
#

In the server list, it displays 0/10 (max number I have set for public connections currently)

#

That I do not know for sure, as I have each server row as a button essentially so when I click on it, it is supposed to use the found session result for that row to connect me, but neither client can see each other.

neon mango
#

Should be "Join Session" node

#

Which takes search result and Player Controller

#

Player Controller should be the clients

#

not servers

real cedar
neon mango
#

Hmm

#

Get Owning Player?

#

Why not Get Player Controller (0)?

real cedar
#

I was trying something at that point because I had the Get Player Controller (0) before, but the result never changed.

#

Hadn't switched back yet.

neon mango
#

If Client is controlling their own pawn when they trigger the join then Get Player Controller index 0 should be fine

real cedar
#

Just swapped it back

keen surge
#

Index 0 should always be fine in non local multiplayer

#

But so should owning, since you only have 1

#

Have you tried checking logs in meantime?

real cedar
#

Yeah, most likely why I had no change in results

keen surge
#

When does that happen?

#

When trying to join?

real cedar
#

This showed up after clicking to host session

neon mango
#

is your DefaultEngine.ini setup correctly ?

real cedar
#

I added this

neon mango
#

Is this a LAN test or Steam test?

real cedar
#

I just enabled the LAN on the create advanced session node and no difference in results

keen surge
#

In the case of steam you can only really test a build on different steam account and device

#

So make sure you are also doing that

neon mango
#

Does it work if in PIE you set it as listen server with 2 players?

keen surge
#

Nope

neon mango
#

Because that would automatically mean 2 players

keen surge
#

Steam only runs in standalone

neon mango
#

1 server 1 client you wouldn't even have to do a Find Server and Join server

real cedar
#

Well right now I'm just in PIE running 2 clients

neon mango
#

show me this

keen surge
#

That won’t work for steam tho

neon mango
#

I think we are trying to test without steam first right?

real cedar
#

Steam was enabled which is why I believe the UniqueNetIDtoString had a bad id

neon mango
#

Why have net mode as client, set net mode as listen server so you can have at least one server

keen surge
#

Well then he should set subsystem to NULL or disabled in defaultengine

neon mango
#

If they can get it working in Editor and get player count I'd say thats a good first step

keen surge
#

If you want to test sessions manually don’t do clients

#

Use standalone instances

#

Unless that’s different in your engine version idk

neon mango
#

Also UE5 might umm have some bugs

keen surge
#

“Might”, guarantee you it has 😛

real cedar
#

So I switched it to listen server, on the server one, it brings both players in upon just the server one clicking "host". If I try the client window, I load in fine, but the server window still only sees 0/10 players

#

I'm running 4.27 right now.

keen surge
#

Well with running it as server they would both travel to your current level

#

So that would be the menu 😛

#

You can try again on an actual game level see if both players spawn

neon mango
#

Yeah with this setup, just start in the level you want all players to be in. You won't even have to click on anything to host/join/ The editor will set the main Viewport as the listen server and the second window that pops up will be automatically connected as a client.

#

If it doesn't work here, baring any odd things with your code, might be a UE5 bug worth asking in the UE5 general

keen surge
#

He’s not on ue5

neon mango
#

Ohh oops

#

Sorry the Editor looked different, made me think it was UE5 and missed his comment saying he is on 4.27

real cedar
#

Inside a level, both clients spawn

#

Although the local player looks fine, the other client is in the jump loop state until I jump lol. Then it sets the character correctly.

#

That's another issue I'll deal with later lol

neon mango
#

side note, I have no idea what I did different (aside from restarting PC after some firewall changes) but my PC now advertises and is detected via Find Sessions...

#

Are you getting the right player count?

real cedar
#

do you have a player count set up for your server list?

rancid flame
#

I want to show a health bar above stuff when it takes damage. In a single-player I'd create a WidgetComponent on each actor, and bind to an OnHealthChanged delegate in my HealthComponent. But for multiplayer I'm not sure what's best?
I have a HealthComponent that is has UPROPERTY(Replicated) int32 HitPoints; but if I make a delegate, it's only getting fired on the server it seems?
Should I make a delegate and fire it in OnRep_HitPoints?

real cedar
#

Yes, the number changed to 2

#

So that is correct

neon mango
#

Nice

#

Well it works, I just don't know why it isn't working in your other test case. Not clear to me what you are even doing for your other test case

real cedar
#

So it's something with the menu system then from creating the session to other client joining.

neon mango
neon mango
#

The widgets should be Client owned though but just gotta think if you are thinking about ownership correctly

real cedar
#

Yeah it seems pretty confusing haha.

lost inlet
#

and it can be the same delegate

rancid flame
lost inlet
#

no, usually it's just a shared delegate

rancid flame
#

I've started using functions with Server_ at the front to make it clear

lost inlet
#

makes it way easier for UI code that has to work on and offline

rancid flame
#

o right, yeah

lost inlet
#

not even sure what the advantages of 2 separate delegates would even be since you can just lookup authority if needed

rancid flame
#

so I should call the delegates both in my SetHealth function and in the OnRep_Health

lost inlet
#

yeah or call the OnRep function on the server, which mimics the BP behaviour

chilly mason
#

is there a reason for UNavigationSystemV1::NavDataSet being empty on a server? works fine in the non-multiplayer configs like dev ed, shipping etc.

lost inlet
#

might be a cooking option for it?

real cedar
#

@neon mango @keen surge Thank you both for your help. I see there is a Steam Multiplayer video posted in the discord here so I'm going to check this out and review my setup in my menu system and hope I can find something in here to fix my menu lol. Thanks again!

lost inlet
#

guess i was thinking of the inverse scenario

chilly mason
#

this is obviously incorrect, targetplatform can't be WindowsServer but there might be something indeed

lost inlet
#

we don't do anything special and our navigation works on DS

chilly mason
#

windows or linux server?

lost inlet
#

WindowsServer and LinuxServer targets

chilly mason
#

hm

#

have a cook script?

lost inlet
#

nothing special for nav

chilly mason
#

thanks, I'll keep looking

real cedar
#

@neon mango So I added ?listen to the options tag in Open Level, and now player count is correct in the server list..... lol. Does not join the same session but going in the right direction now haha.

neon mango
#

So you were not hosting it as LAN correctly then

#

No wait... this is how one does LAN

#

This would be no LAN

real cedar
#

I'm not sure. That was the only thing I changed was adding the ?listen to the options tag on the open level function. I guess the settings did not flow to the next level.

#

Client 2 still cannot connect though. I'm still watching the video though, just thought I would write that down in case someone else searches through this discord as well.

potent token
#

does localplayer/player controller will always spawn first before other player spawn ?

neon mango
#

Do spectators add to the total amount of players?

#

or how does one exclude a server from being seen as a player? I'm sure dedicated servers don't but do listen servers have to?

pseudo merlin
#

hi all, whats a smart way to interp a character from A to B in a networked way. I'm assuming the CMC will not be happy about it, do I just disable CMC on client and server and then let server interp the actor?

#

I'm talking interps that defy typical character motion, no collision moving a char 100s of units

woeful schooner
#

Hello, there is not much resource about the dedicated server system, so I need something. I am trying to make both multiplayer and single player game mode in my project. I compiled my project through visual studio, but there is a problem, I want the login map to work even if the player's internet is turned off, I could not succeed whatever I did. Any player's internet must be open and the server files must be working. The player opens the game in this way, how can I overcome this, please help

lost inlet
#

that's not really enough information

#

"login map" isn't this something game specific that you control? what is that to do with the dedicated server? the DS can have its own default map

woeful schooner
lost inlet
#

really not following

#

because if the player is offline, why are you trying to even attempt a server connection?

woeful schooner
lost inlet
#

I'm progressively now getting even more confused

#

since for singleplayer, you would just travel to a map locally

#

multiplayer, you travel to a server

woeful schooner
#

but when I export the game and run it, I can't enter the game, it wants the server in the background, otherwise I stay on the unreal engine screen.

lost inlet
#

define "can't enter the game" and "wants server in the background"

#

if your startup map doesn't travel or use the open command, then that's definitely not default UE4 behaviour

#

there is no way that UE4 expects a dedicated server running on the same machine

woeful schooner
#

i did this

#

but the server must be up to go to my login map

#

How to run i login map without internet and server

lost inlet
#

"login map" is something specific to your game

#

and I'm very familiar with what a dedicated server is

woeful schooner
#

because in my login map there are two ways, singleplayer and multiplayer

woeful schooner
lost inlet
#

did you attach a debugger to see what it's doing?

#

that's the default splash

woeful schooner
#

I get rid of this screen when I run the taki server

woeful schooner
lost inlet
#

well something specific to your game is making it connect on startup. this is not default UE4 behaviour

peak sentinel
#

Can someone remind me if root motion animation were replicated by server (with CMC) automatically when triggered from server or we had to use multicast?

lost inlet
#

?

#

this just depicts a menu map

lost inlet
woeful schooner
lost inlet
#

yes so search what in your project is trying to join the server on startup

#

which is specific to your game

woeful schooner
#

I'm saying this, I want to enter the menu map without running server -log so the player can enter single play

woeful schooner
lost inlet
#

I don't know, you probably implemented it

#

it's specific to your project

woeful schooner
#

but it doesn't work when the game starts

lost inlet
#

this is NOT default UE4 behaviour

woeful schooner
#

😦

woeful schooner
lost inlet
#

why would you do that in begin play?

woeful schooner
lost inlet
#

still

#

and what does StartLevel do?

#

do you have any references to your host PC's IP address anywhere in INI, code or BP?

woeful schooner
neon mango
lost inlet
#

but if you can add a travel arg to the client connection in BP, you'd do that

#

usually it's something like open IP?SpectatorOnly=1

#

that worked for us in a playtest and it WILL spawn you as the player controller type defined by ReplaySpectatorPlayerControllerClass in your game mode

woeful schooner
lost inlet
#

you would NEVER use a server build type for a mobile device

neon mango
#

So maybe adding that as flag along with the listen? Will make server be a spectator

lost inlet
#

use game or client

neon mango
#

I’ll look into that lead when I get home

woeful schooner
woeful schooner
# lost inlet use game or client

I have one more question, is it possible to use a savegame.sav file on the dedicated server, if possible, how can I pull it from the dedicated server and reflect it to the game?

lost inlet
#

I've not had to have a dedicated server save a game

#

and on the client we use JSON files for user preferences

woeful schooner
#

I just want an opinion sorry I may have been too busy 😄

woeful schooner
lost inlet
#

nope

#

mysql is a pretty trash RDBMS compared to alternatives like postgres and usually you use a web service to sit in the middle

#

sql injection in a game server would be a pretty interesting attack vector

woeful schooner
woeful schooner
#

it is possible to show mysql tables only in the specified field example maygame.game.com

lost inlet
#

what does "the best area" mean? I'm sure the existence of wordpress is the only thing that keeps mysql popular

woeful schooner
#

so that data can only be read from within that game, it is closed to outside interventions.

#

you write too fast I can't catch up I use google translate 😄

woeful schooner
#

I'm a web software so in that sense

woeful schooner
#

Hello, I am disturbing it again, but it did not work. When I export the project, this panel opens directly and as long as this panel is open, I can go to the menu map. When I close this panel, the game does not open at all.

lost inlet
#

So you’re doing cook on the fly?

#

That’ll be why

woeful schooner
lost inlet
#

What you’re doing is cook on the fly, not cook by the book, so a server on your dev machine will be cooking assets as they’re needed

#

That or you pressed “launch” which is not a packaged build

lost inlet
#

Yes this isn’t packaging

woeful schooner
#

enable cooking ?

lost inlet
#

This is building a binary and pushing cooked assets from your PC as needed

woeful schooner
lost inlet
#

No?

#

But if you want to test your game in an offline environment then actually do a packaged build

#

This is nothing to do with a dedicated server

woeful schooner
#

but with 4.25 I was able to test my game offline like this

#

I can't enter the game right now because I'm closing that log

lost inlet
#

Nah or you were pushing packaged builds to the device

#

Which disabling cook on the fly probably does

woeful schooner
woeful schooner
#

nothing has changed, it wants me to run the server file to open the game, otherwise it stays on the unreal engine screen 😦

red musk
#

When my pawn is possessed, its player state hasn't necessarily replicated yet, when do I know when its player state is valid?

lost inlet
lost inlet
#

the crappy BP-only workaround would be a delay node

red musk
#

Yeah I think the appropriate way to do this is basically my pawn on C++ needs to use OnRep for a variety of things, possession, player state, etc to fire a finally "everything is replicated and we're ready for initialization" event

#

👍 ty

lost inlet
#

yeah the pawn has OnRep_PlayerState which is conveniently virtual

red musk
#

Yeah was just looking at that

twin juniper
#

does anyone know how i could make dedicated server save files?

#

or can refer me to documentation on it

meager spade
#

you need some database to store that data

worthy knot
#

Im trying to make a trace on the client side, from which i want the hit results to go on the server side. but the "ServerPunchTrace" event is not firing

meager spade
#

ai always run on the server

#

so the server rpc is not really valid?

worthy knot
#

all i want is the client side hit trace info to be sent on the server so it can apply damage to actors. the reason im not running trace on server side is because the trace does not start from the hand, but on the pelvis region of the character, idk why

worthy knot
meager spade
#

@worthy knot on the skeletal mesh

#

turn on Visibility Anim to Always tick bones and refresh pose

worthy knot
#

i did

#

seems like there was an option of visibility being changed in the blueprint

#

its fine now

#

i changed it, thanks

prisma snow
#

Is there a way to measure the time that, let's say, an array took to replicate? I don't need a crazy accuracy but it would be nice to know if it is 50ms or 200ms (as totally random values) 🙂

#

My current idea is to get the time before replication, and send an rpc back from the client when the updated value(s) are recieved.

prisma snow
#

that is nice to hear 😂

lost inlet
#

Also this is still the wrong channel

woeful schooner
lost inlet
lost inlet
#

/path/to/server Map?Game=GameMode?other=params -Port=gameporthere -QueryPort=steamqueryporthere

gilded stump
#

Hello,

having an issue where a muzzle-flash is supposed to be attached to the weapon of a player, server sees the client do the shooting and the muzzle-flash moves along with the muzzle of the weapon - but the client-side (if the server shoots) spawns the muzzle-flash emitter in the world where the weapon's muzzle was at the time but doesnt move along (hope it's clear what i try to say lol) will attach the blueprint and a video of the issue. anyone sees what i am doing wrong?

the bottom emitter spawn on the screenshot is for the third person view

oak jewel
#

hi. whats wrong here? (dedicated(looping is off because it gets called again at end)

sinful tree
# oak jewel hi. whats wrong here? (dedicated(looping is off because it gets called again at ...
  1. Begin Play fires on clients as well as on servers, so your timer would be getting started on all machines when that actor comes into play.
  2. The events that normally connect up to timers are supposed to be local only. ie. When you have an event hooked up to a timer, you usually can't set it to RPC like you have here.
  3. You have a "Set with Notify" for your Sun Rotation being triggered on a Multicast RPC. Assuming that RPC goes through, all clients and the server would be setting that value, despite it is already supposed to be a replicated variable.
  4. RPCs won't work on actors that are not owned by the client. Seeing as this appears to be an actor that's meant to control the sun, I imagine it's not something owned by any specific client.

Consider doing this:
Using a "Has Authority" node on the begin play, you can make it so the timer only runs on the Authority (the server).
Remove the Multicast RPC, and the RPC call on your timer event. They aren't necessary.
The timer can then set your Sun Rotation as it needs to. When it replicates to clients, the generated OnRep Function will be called on clients that have received it.
Use the OnRep function to perform whatever you need to on the clients (and server as well) to utilize the new Sun Rotation value that was received.
If you haven't already, make sure this actor is marked as Replicated and also since it's something a bit more global to the level, you'll need to set "Always Relevant" to true.

red musk
#

PlayerState's bIsABot doesn't seem to be replicating for me correctly. It returns true on the server, but false on the client. AIController and PlayerState are both set to replicate, anyone have an idea of whats up? 🤔

strange breach
#

how to make a timer like this. And how to make it works for multiplayer

kindred widget
strange breach
#

its should be like that when its player on the glass bridge then they lose when timer go to 00 : 00

#

if they are on the platform then they go to the next level

kindred widget
#

I personally find that the best way to do timers, is to set a float of ServerTime+DesiredTimer. Replicate that to clients. Then your clients can look up how much time is left with ReplicatedVariable-ServerTime.

strange breach
kindred widget
#

Kind of sounds like something that could live in GameState. Just make a float in your custom GameState, set it to replicated. Doesn't need a notify.

#

In your widget where you're displaying that, just make a small tick that sets the text. Text would be a format of seconds converted to the display. To get seconds you GetGameState, GetServerTime, ReplicatedFloat-ServerTime.

strange breach
kindred widget
#

Then when you want to start that timer, you set it to ServerTime+TimeYouWantItToTake on the server.

#

If your Seconds are < 0 , just set the display to zero maybe. Or whatever else you want.

strange breach
kindred widget
#

But I did?

strange breach
#

so when i do this then i get the timer?

oak jewel
steady root
#

What are the best ways to test multiplayer functionality in an automated way? These would be two things I would love to be able to test:

  1. Load testing
  2. Animation replication testing
fossil spoke
#

Is there a method for detecting packet loss? Does the netdriver have anything to tell you there is packet loss occurring?

meager spade
#

not 100% sure anything built in

#

but i know games like fortnite/rocket league do detect it

fossil spoke
#

NetConnection has this that im looking at now

    using FNetConnectionPacketLoss = TPacketLossData<3>;
    const FNetConnectionPacketLoss& GetInLossPercentage() const  { return InPacketsLossPercentage; }
    const FNetConnectionPacketLoss& GetOutLossPercentage() const { return OutPacketsLossPercentage;  }
meager spade
#

so there must be something we can grab

#

ah so the InPacketsLossPercentage seems like it should work

#
    float GetLossPercentage() const { return LossPercentage; }

    /** The average loss percentage over the previous X StatPeriods */
    float GetAvgLossPercentage() const { return AvgLossPercentage; }``` seems like this is what you want
fossil spoke
#

Yeah looking like it is

meager spade
#

would probably need to sample these on tick or a timer

#

check if the loss goes above X amount, and throw a message to the player

fossil spoke
#

Id assume they would be already being sampled, grabbing it would be just for that frame.

#

Yeah for now ill be visualizing it for debug, not to the player themselves.

meager spade
#

yeah, i mean i know fortnite show it at the top of the screen (if you turn on net stats)

fossil spoke
#

Ah yeah

ancient adder
#

is it possible to access clients game instance from server?

fossil spoke
#

The GameInstance is not replicated at all.

#

Think of the GameInstance as the .exe running on the machine.

ancient adder
#

Im trying to change a value in game instance from gamemode to check it later

#

not possible?

#

with event handle starting new player

fossil spoke
#

You would have to RPC down to the Client first from an Actor with an NetOwningConnection, such as the PlayerController.

ancient adder
#

You mean, make an rpc inside the controller to get gameinstance value and sent it back to server, then call that at event handle?

#

Thats seems a good way, if i understood correctly haha

fossil spoke
#

You cant send the GameInstance through an RPC.

#

Its not replicated...

#

As i said earlier.

ancient adder
#

i'll be sending variables stored in i

#

it

fossil spoke
#

You should probably read or watch some of the pinned comments in this channel to better understand how replication and rpcs work.

ancient adder
#

I think i got it, thank you i appreciate it 👍

crisp sable
#

I'm curious how games like Fortnite / PUBG spawn interactable objects ( such as ammo pickups / breakable windows ) in a large open map.

  1. Are ALL of the actors spawned at the start of the level?

2)Are the actors spawned whenever a player enters a zone ( then the Game manager just spawns the interactable objects in that particular zone. Once the player leaves the zone, the objects are destroyed?

If the method is 1), doesn't that cause a huge network spike when the player joins the server? Doesn't the server have to send replicated info for every interactable object to all of the players?

Or does the server only send the replicated info to the players in a particular radius..

ancient adder
#

i read somewhere to replicates whats near you

hoary lark
#

you can google "ue4 replication graph"

red musk
#

I've been going crazy trying to figure out why APawn::IsBotControlled() is false on the client for my pawn being possessed by an AIController on the server. It's acting like the GameState's bIsABot isn't replicating, as its correctly true on the server. Both objects (pawn and player state) are set to replicate correctly. Any idea on what would be going on here?

unkempt tiger
#

What is this uint8 SomeBooleanVar : 1; notion? does it mean it gets serialized as a single bit?

vivid seal
#

my understanding is that these variables are packed as single bits inside one uint8, rather than sending an entire bool for each one. check out the concept of Bitmask

#

not sure on the syntax for it or where the packing actually takes place though

unkempt tiger
#

🧐

#

Gah, on an unrelated note, I'm really confused reading SceneComponent.h, there are all these replicated properties (relative loc/rot/scale, attach parents/children, visibility stuff), and they are not conditioned by some boolean property I, the user, can control...

#

And from tests, I never really understood what these properties end up doing for me, I always found I have to replicate these kinds of values myself

#

Since, well, every time I launched a server and a client, everything was desynced except object creation

meager fable
#

I need to check something in debug with -stompmalloc, the problem is that it's so slow my client gets a timeout during servertravel, is there a way to disable timeouts?

trim kindle
#

What is a proper way to do server side initiated movement of owned character in CMC? Imagine a situation when only server knows that your character is doing some movement and it wants to override to combine it with client input.

#

The problem I am facing is that server is not really doing movement on its own, its just verifying input received from client and sending response.

woeful schooner
#

hello, after the process is finished, it does not go to the map I specified, instead it opens the map I am on, where could I have gone wrong again?

winged badger
#

all predicted movement needs to start from owning client

winged badger
#

another asset with exact same name as the map can also be a candidate

woeful schooner
woeful schooner
trim kindle
#

but it sounds a bit dangerous to give client a decision whether he wants to do some interaction or not and rely on him that he won't cheat and not allow it

winged badger
#

you verify that server side in CanInteract

#

but you let client move on its own

trim kindle
#

and check after some timeout on server whether he really moved?

winged badger
#

why?

trim kindle
#

The thing is that client does not know about this iteraction. It is not player initiated but server initiated. Think about it as if server just decided that it wants to move your character somewhere. With this approach I will need to replicate the request to client and client will initiate it and replicate back to server, so the move will happen also on the server. But then it sounds like its client's decision to decide whether the move can be executed or not.

#

(at least technically, one could modify packets/game to block the move on client, so it will never happen on the server)

winged badger
#

so why would you take away control for hidden interaction that sounds bad?

trim kindle
#

Let's say some other player hit you and threw you back

#

so it is the server who wants to move you, not you

winged badger
#

then give the thrown player an ability that is using GameplayTasks

#

to implement root motion

trim kindle
#

yeah, I think have to look more into root motion and how I could drive it dynamically without having an actual animation

#

I think UE5 is doing something similar with its warping

winged badger
#

basically, you give him an ability that activates as soon as its replicated to owning client, and initiates root motion

#

still needs to start from client

trim kindle
#

just in my case it is not as simple as "move back" but follow short navigation path

#

makes sense then

#

that it will need to start from client

#

thanks, I think this is what I was looking for that it is not really worth it to try to do server-side movement.

winged badger
#

its not really possible

#

in this scenario

#

if your movement is click to move / RTS controls over navmesh

#

then it kinda is, but it will still feel choppy

#

with WASD controls, RIP

trim kindle
#

the complicating thing is that it is both. PC = Gamepad, AIController = Mouse and you can switch between these anytime while playing and while things like anims, root motion are evaluating and replicating

winged badger
#

you have predicted movement via AIController done?

trim kindle
#

skipped predicting AIController for now to simplify things

winged badger
#

need to derive a custom CMC for that

#

to break the assumption that Pawn is possessed directly by PlayerController

#

or

#

implement PathFollowing on the PlayerController, and drop the AIController

trim kindle
#

yes, I have been looking into it a few times and decided that I don't want to mess with it.

winged badger
#

and its not just CMC

#

APlayerController::TickActor is also making the same assumption

#

also need to set Roles by hand, and few other things

#

but it is worth doing, game feels much more responsive afterwards

trim kindle
#

sounds cool, would love to do it one day, when there is enough time

#

thank you!

kindred widget
#

Why not just replicate them directly?

twin juniper
#

Hlo .I am trying to build Gamelift server SDK .It is failing in msbuild.During msbuild it is failing in building boost engine.

#

Plz help me

kindred widget
#

<@&213101288538374145>

nimble parcelBOT
#

:warning: Failed to send a DM. User will not be notified.

#

:no_entry_sign: luminix6💚#9784 was banned.

twin juniper
#

Guys can anyone check my msg

kindred widget
#

Why do you need this many actors though? Curious what the actual use case is.

#

Haven't played, but first impression is that the majority of that needs to be done through components, via a manger, and possibly even submanagers for zones depending on map size. FastArray is probably a good choice for that if for no other reason than the callback per replicated struct. And you can netserialize them as well.

lost inlet
# twin juniper

this doesn't seem UE4 related and what's with the ugly font rendering? lol

sullen steppe
#

is there an unreal engine networking guru? I'm trying to further my understanding of how multiplayer works and have a lot of questions lol

dark edge
#

Have you read the compendium?@sullen steppe

crimson python
#

im trying to set up a red/blue team for my capture the flag type game, but ive been struggling to find how to do that with either c++ or BPs. i just created two different playerstarts but they both spawn the same pawnplayer (which is what i want), but i dont know how to assign each pawn instance a team of red or blue

#

anyone have any resources/tutorial for this? ive tried going on YT but to no avail

dark edge
#

@sullen steppe Just ask the questions here. Somebody will know the answers.

dark edge
#

MyTeamEnum::Blue etc

#

@crimson python you'd also use the same enum in many other places like the flag, the capture area, the spawn points, probably on the Playerstate or Controller etc

crimson python
# dark edge Enum on pawn

not totally sure how this works. if i created an enum in the pawns, how would it know which team to choose when it is spawned? i made it so there's a red and blue side and i want the pawn that spawns on each side to always be of the same color as their side

dark edge
#

Select spawn point based on that enum, set enum on pawn to be same as PlayerState when spawning or just make a getter function.

#

However you do it it'll all boil down to selecting and branching on a team enum for many of the things you want to do.

#

For example, for capturing the flag, in the capture area.

On overlap -> cast overlapping actor to flag -> if flag enum /= capture area enum -> capture flag

rancid flame
#

Does anyone know if Game Instance Subsystems will work with replication? Do I need to do something fancy other than UPROPERTY(Replicated) and GetLifetimeReplicatedProps?
Edit: Seems to work!

kindred widget
#

You shouldn't be able to replicate anything from GameInstance. And even if you could manage it, I wouldn't advise it. GameInstance is kind of meant as the one space a local pc has for it's own control. It's a good place to handle storing local data not directly associated to the current game, or handling things like loading screens and such. It shouldn't really be allowed to be altered from another machine.

lost inlet
#

no subsystem type is capable of replicating

polar lotus
rancid flame
polar lotus
#

Ahhh I see

#

"subsystem" was the more important bit

hollow eagle
#

that doesn't really change anything, GI subsystems are owned by... the game instance.

polar lotus
#

aren't subsystems just objects that are constructed and destructed along with another class

#

is there actually any gameinstance logic implemented within the gameinstancesubsustem?

hollow eagle
#

the logic isn't the point here

#

the lifetime and use of gameinstance is

#

a game instance represents... an instance of a game. On a local system.

#

It shouldn't be replicated, objects it owns shouldn't be replicated.

#

Conceptually - A replicated object is the same "object" on all systems it is replicated to. But a gameinstance (and its owned subsystems) are specific to the local game.

trim kindle
#

I am surprised too. Does it really support replication?

#

I was under the impression that subsystems are not supported

dusty radish
#

Hey does anyone know why this doesn't replicate from the client to the server?

lost inlet
#

why doesn't the RPC send that info? you can't guarantee the replication order

dusty radish
#

RPC? I'm fairly new to replication sorry

lost inlet
#

remote procedure call

#

it's what the client/server/multicast events are

#

though netcode in BP, kill me now

dusty radish
#

oh... yeah sorry

#

That's a good idea, I'll make some adjustments and retry

dusty radish
winged badger
#

it would not be even remotely worth the effort

#

UObjects need an ActorChannel to replicate them, and their Outer is generally not an Actor

#

worse yet, if an Actor replicates a UObject that doesn't have that Actor as Outer, after replicating UObject will swap Outer to Actor that replicated it, and this will happen only on clients

#

so, really not worth it, replicating subsystems

eternal canyon
#

which means that the function before that should be on the server

#

thus making the server RPC to the Multicast redundant

winged badger
#

and even if it was set on server, it would still require OnRep to actually trigger the montage

eternal canyon
eternal canyon
winged badger
#

yes, it doesn't work without pushing the montage asset pointer through the server RPC

lost inlet
trim kindle
winged badger
#

its not

viscid escarp
#

any idea about how games(like war3) make listen servers but not LAN? Trying to do it on steam but seems impossible

bitter oriole
#

Listen server with Steam outside LAN is essentially built-in

#

Get the advanced sessions plugin to skip the 100 or so lines of C++ and get simple Blueprint nodes

viscid escarp
#

I'm using it. It should work?

#

Already tried a lot of different configs

bitter oriole
#

Yes, it works perfectly well.

viscid escarp
#

thanks

bitter oriole
#

Just need to add 10 lines of config in your ini file, start the game outside editor on two machines with different Steam accounts

winged badger
#

with a lot of pain and sweat

#

physx is not deterministic

#

so it doesn't really work with networking well

#

or at all

#

if you were hoping for a quick fix, there isn't one

golden charm
#

hey, im wondering if its possible to replicate a property inside a component that isnt replicated? the component is attached to a playercharacter which is replicated however.

chrome bay
#

Not without copying it and replicating it elsewhere

#

Seems pointless though, may as well mark the component replicated

golden charm
#

ye thats what i was afraid of, i only need a rotation (fvector) replicated tho, pretty wasteful to replicate the entire component for that. Thanks for the response ❤️

jagged frigate
#

Hey, if I have a server owned actor and I want to change a property of this actor that has to be replicated to all clients from my custom playercharacter, should I implement it by calling a function in my player controller from my character, which then calls a multicast function defined in the actor?

dark edge
trim kindle
#

Root Motion sources in abilities are based on Duration, what if I want to move at constant speed instead of constant time? I could drive Duration dynamicalyl by getting distance between target and current but it feels weird and I am not sure if it would not break something if this ends up to be different on client & server.

#

This is the node I mean

#

it feels a bit weird (from gameplay perspective) that no matter what the distance is, it will take same amount of time to get there, even if the target is just a few centimeters away

jagged frigate
woeful schooner
#

hello, in the project that I compiled as a development server through visual studio, when I open a level other than entry level transitionlevel and serverlevel and want to go to that level with openlevel, that level does not open. There is no problem in the editor, but when I compile mobile, is there a solution for this?

dark edge
#

Input -> run on server event -> get whatever server side actor -> set property

jagged frigate
#

So I set up a Server ufunction on the controller and its working now, I kind of got the hang of replication now, thanks 🙂

dark edge
#

Just keep in mind that you typically should do something by replicating a property instead of multicasting an event.

#

Rep notify is one of the most powerful tools you have

jagged frigate
#

as of right now i replicate the property and set up a server function in the actor which modifies this property and then i call the modify function from a server function in my playercontroller

dark edge
#

The function in the actor doesn't need to be a server function then.

jagged frigate
#

So you have to change a replicated variable on a server object with a server function, right?

#

Okay, ill try

dark edge
#

You only need to traverse from client to server once. You don't have to do it with a server function, you just have to do it on the server. How you get from the client to the server can vary

gray summit
#

hello, i created a host menu but the host button don't want to open and i don't no what i did wrong

dark edge
jagged frigate
dark edge
#

You need one run on server event. Put it in your player controller. After that, it can call a regular event on the actor to set the property

jagged frigate
#

This works now 🙂 Thanks again for your help

gray summit
gray summit
#

i see the problem

copper portal
#

hey all! trying to implement a system where upgrading power includes aesthetic changes as well. so in my instance, if power == 1, make all the doors look one way, but if power == 2, make the doors this other way (which includes different sounds and opening animation than the first door.

i already have a master class for my doors that tell them how to operate, and that has child blueprints for each door. so my question is

  • to change the doors if the power is upgraded, is it more efficient to destroy the old doors and replace with new doors?
  • OR is it more effiecnt to replace the materials and sounds etc of the old door with that of the new door?

thanks in advance!

#

okay ty!

#

ill give that shot

gray summit
#

how to make my get owning player for all the players

random hazel
#

Hey guys, I'm looking for a way to implement a pause in multiplayer from the Host, but I can't get the clients to pause at all.

I've found 3 ways to pause so far

  • console "pause"
  • SetGamePaused
  • PlayerController->SetPause)

I've tried to RPC from host to client and none work on client side. I've tried host only hoping they would replicate, and i've tried to call it on PlayerController(1) from the host hoping that would replicate.

nothing seems to pause on the client side, several methods are able to pause the server only.

meager spade
#

@random hazel did you set bPauseable to true in gamemode right?

random hazel
#

yes, Pausable is checked in the blueprint

#

although i wasn't aware of that setting, thank you

cobalt gust
#

hey guys im pretty new to multiplayer but i have a problem. im making a top down multiplayer shooter but when i run the game all the players look at the same cursor location

exotic spindle
#

Hey! If I want to spawn a replicated actor at runtime, in BeginPlay, within a level-placed actor (which is also replicating), do I have to only do that on the Server, or can I do it on all clients, and UE is "smart enough" to make the connection between the spawned instances?

#

reason being that I would like to cut down on the amoun of statically placed actor every map of ours needs, so I would like to just spawn some AInfo actors at runtime, but also would like them to be immediately available to all clients (hence I would like to spawn the actor on BeginPlay, for all clients)

lament cloak
#

So that you only spawn on the server, the spawn function takes care of the rest

exotic spindle
#

@lament cloak but then the actor would be NULL on clients until it replicates. Which I could probably work around, but it would be cleaner if I could guarantee it to exist at all times

#

or am I misunderstanding that?

lament cloak
#

It will be null for a few milliseconds

exotic spindle
#

yeah, practically it will probably make no difference. Just curious if theres a way to avoid that

lament cloak
#

You can also use stable name replication but that means the server sends a string, and as long as the client also has the same exact name it will figure it out. I dont have a lot of experience with it but you can Google UE4 stable name replication

#

But I wouldn't recommend this if youre doing a lot of them. If its just a few actors then do that

exotic spindle
#

reason being that this is an actor that will handle an aspect of synchronized settings, which will be accessed by all sorts of different parts of the app. I just dont like the idea of there ever being a scenario where that actor is not yet available, because some other actor tried to access it shortly after begin play