#multiplayer

1 messages · Page 201 of 1

thin stratus
#

No idea what "This Plugin" is and the Team probably has to be set in a Lobby or so?

#

No one here knows what your game or that plugin is

#

No one can answer it with the little info you give.

magic furnace
#
{
    NetMultiSetAimOffset(InAimOffset);
}

void UAGRAnimMasterComponent::NetMultiSetAimOffset_Implementation(const FRotator InAimOffset)
{
    if(OwningCharacter && !OwningCharacter->IsLocallyControlled())
    {
        AimOffset = InAimOffset;
    }
}```
#

I hate it

#

it's multicasted even

#

what does my Replay not like about this multicast

thin stratus
#

I mean, that feels like it should just be a Replicated Variable

#

And fwiw just the Pitch cause the rest should already be available

#

Which is what GetBaseAimRotation utilize in the background already

#

It's also what 99% of aim offset use iirc.

#

The AnimBP should have a node/function to calculate the rotation based on the Actor Rotation and the Base Aim Rotation

magic furnace
#

it always comes back to bite u with random stuff

#

still, it shouldn't behave this way in a replay

#

very confusing

#

but why does get BaseAimRotation go crazy as well

#

I don't get that either

#

how is the replication handled that it does what it does lol

#

I just wanna give up with Unreal and go to Unity at this point honestly

#

I always have the weirdest issues

vernal nest
#

Well at first I was trying to avoid sending StaticMesh pointers over the network, I wanted to make my inventory as light as possible since it will be used a lot.

So I'm wandering, is it worth it at all? Is the engine sending pointers over the network so it doesn't matter what value the pointers store?

crisp shard
#

is async loading screen any good for start up loading screen into game from lobby/main menu?

gray sparrow
#

i need give variable team from lobby controller to game controller. but before event begin play

#

how can i do this?

eternal dune
#

LogTemp: Warning: DcsInventoryComponent: InvItem 0000043E98BE1280 was replicated on Client
LogTemp: Warning: AddToInventory: Inventory ending with 1 of the item
LogBlueprintUserMessages: [BP_Box_C_UAID_8C1D96959DA3BE0302_1463461103] Server: After add inventory 0000043E9B82F400 has 1 items
LogTemp: Warning: DcsInventoryInstance: ItemList 0000043E98BE1280 was replicated and now has 1 entries on Client
LogBlueprintUserMessages: [BP_DcsThirdPersonCharacter_C_0] Client 1: Inventory dump of 0000043E98BE1980 : 0 entries and contents reports 0 entries

First I see the inventory instance replicated to the client and assigned the address 0000043E98BE1280
Then the server adds an item to the inventory. and we see the same client inventory gets updated by replication. So far so good.
Then I go to print out the contents of the inventory and it reports zero items because it's using a different inventory at the address 0000043E98BE1980, apparently also on the client!

Why? There are apparently two copies of the inventory on the client.

For what it's worth, the Inventory object is a replicated UObject, attached to a very basic ActorComponent, attached to the PlayerState.

gray sparrow
#

anyone know the event : """ event on swap player controllers"""

#

this event doesn work for me

eternal dune
#

Ah! Never mind! Just figured it out. I was using a NewObject call in the component's BeginPlay to create my InventoryInstance object. On the client, the object was first getting created with the replicated object, and then BeginPlay got called, which modifed the local copy of the Instance. The solution was to wrap the creation of the object in a check to make sure the pointer to the object was not already set.

gray sparrow
#

this event doesn trigger for me

#

even when i seamless travel and switch game modes and controllers and launch in standalone

#

it didnt work -.-

#

i cant get this event run

crisp shard
gray sparrow
#

in game mode there is no event iek this

#

this event can maybe my solution

#

how does this event worsk?

#

oh it in character

#

its wrong event

crisp shard
# gray sparrow how does this event worsk?

im using this in my character to assign input, which i used to have on begin play but this is when the client basically gets his controller assigned if i understand this correctly

gray sparrow
#

i watn this event run

#

in game mode

#

you will no video on tienrt yutbe

#

nothing

#

you will find nothing to this event!

#

its crazy

#

how can i know how it work now?-.-

crisp shard
gray sparrow
#

nothing

#

you will fid nothing

#

lets see if someone in this forum can gfet this event run!

gray sparrow
#

no one know about this event? wtf?

#

cmon -.-

lament flax
#

in BP you wont get much info, you need to use c++ with MP anyways to get far and clean enough

thin stratus
#

As the comments suggest, the PlayerController Classes probably also have to differ, so it won't call if both are the same.

compact flame
#

I cant for the life of me replicate this ive searched up the replication videos and they are no help... I attached a actor to a spring arm and it does not move on other screen please someone tell me how to fix this

thin stratus
compact flame
#

One is so Ig yeah

thin stratus
#

Yeah that won't work

compact flame
#

Dang

#

Is there a way I can make it work?

#

It feels really good in game

#

and looks good

thin stratus
#

You can try setting those booleans to false and on Tick use "GetBaseAimRotation" to set the Rotation of the SprinArm

#

Can't promise that works though

compact flame
thin stratus
#

?

compact flame
#

Nvm💀 Dont need anything in target ill test now

compact flame
thin stratus
compact flame
#

Nothing cant look

thin stratus
#

You disabled the booleans?

compact flame
#

Yeah

thin stratus
#

Hm, setting the Rotation by Hand should work though. Can you show the code?

compact flame
#

Yeah give me a moment gamebar takes forever to load

#

I tested it again and looked at both screens this time and its happening on the other client? but not the one your playing as

#

Its a mess

thin stratus
#

You can try splitting the logic fwiw

#

But it needs a bit more code

#

In your Character, you can override a function called OnControllerChanged.
That gives you the new and old Controller that possesses the Pawn (Character) and calls on Server and Client.
You can then use "IsLocallyController" to set the booleans you set to false to true again for the local Client.
And in the tick function, youc an use the same IsLocallyControlled, but this time the with FALSE, to set the WorldRotation of the CameraBoom by hand on the other Clients to the BaseAimRotation.

compact flame
#

Alr ill try doing that

#

That works well now I have 1 more problem. The node "Get Base Aim Rotation" Seems to only work for up and down because other clients cant see it moveing side to side alrthough sometimes it does ill send a vid so you can see

thin stratus
#

Ah, right you are using Yaw of Control too

#

GetBaseAimRotation uses Yaw of the Character

#

Which is of course not moving

compact flame
#

Yeah

thin stratus
#

You might need to add an extra variable then, to replicate the Yaw Float

compact flame
#

Yeah

thin stratus
#

Switch has Authority -> GetControlRotation -> SetRepControlYaw

#

And then set the Condition of that variable to SimProxy only

#

Cause you don't need that to replicate to the AutoProxy/Owner

compact flame
#

Alrighty

thin stratus
#

Server should have access to the ControlRotation

#

So You can just do that on tick with SwitchhasAuth

#

And then you can use the Pitch of GetBaseAimRotation + your custom Yaw

#

No reason to replicate yet another pitch

compact flame
#

Alrighty

compact flame
thin stratus
#

I can't really read that properly. Please clean up your code

#

And it looks like you are adding more stuff than I said

compact flame
#

Lol yeah prob should

thin stratus
#

The CombineRotators is wrong

#

You can "Break" and "Make" Rotators

#

You are only supposed to replicate a Float for the Yaw

#

Break the ControlRotation for that and set the Yaw value to your Replicated Float

#

And then break the Replicated Float and the BaseAimRotation, as well as "Make" the Rotator for the SetWorldRotation

#

And set the values as previously explained

#

Also make sure you don't plug the SetWorldRotation behind the SwitchHasAuthority

#

Only the SetReplicatedYaw should be there

compact flame
# thin stratus Only the SetReplicatedYaw should be there

Thanks! it works I appreciate you going through the steps for me and not just saying look it up it means a lot Thank you very much ngl I never though of doing it this way and you opened up a world of replication tricks that I can do now:) again thank you very much ill be sure to wishlist Evershire for you 😉

thin stratus
slim jay
#

When I possess character to vehicle, the throttle input for the Chaos Vehicle doesn't work; only the steering input allowing the wheels to turn left and right, but the vehicle doesn't move forward or backward. However, when I switch to the vehicle's game mode, the vehicle spawns directly, everything works . What could be the issue?

dark edge
#

Wut

thin stratus
#

They probably mean switching from Char to Vehicle

dark edge
slim jay
#

possesing the vehicle

#

and this is char setup

neon summit
slim jay
neon summit
#

Where's the code for the steering?

slim jay
neon summit
#

I mean acceleration

slim jay
#

I'm using two different Input Mapping Contexts I remove one and add the other, but it's not working this way

neon summit
#

Where do you remove?

#

I only see add

#

Clear all mappings?

#

Might want to use get player controller instead of controller

slim jay
neon summit
slim jay
neon summit
#

I think the overlapping actor loop may be a problem

slim jay
#

i think not, i also try with overlap from carbp still same result, the car does not move

neon summit
#

Breakpoint and go through the code

#

Or personally I'd do a trace

slim jay
#

thanks anyway

boreal wadi
#

Anyone here using mover? Any idea when I spawn a client sided projectile that is being moved by mover it just spawns and doesn't move? Is this a bug or some kind of user error

twin juniper
#

Hey guys, what is Tranek document is talking about here? Is this just Mover of something else?

fossil spoke
#

NPP.

twin juniper
#

Yeah i thought they may rename it

fossil spoke
#

They never rename features

#

They make new features

#

That replace old features

twin juniper
#

Is this the GAS prediction thing?

#

Or its a seperate one?

fossil spoke
#

Its a completely separate Plugin.

#

Has nothing to do with GAS

twin juniper
#

It does said beta 0.1, do you use it Matt, what do you think about it

fossil spoke
#

No I dont use it.

#

Its experimental

#

Very WIP

#

Same with Mover

#

Mover 2.0 is very WIP and still experimental

twin juniper
storm grove
#

Ok let me start again,

Lets say client A has an actor (weapon) this actor has its owner as the character
is it possible, a late client B joins and has the weapon actor be replicated to him first BEFORE client B can see client A, leading to the weapon actors owner being null

#

Or are controllers/characters always within the first initial data sent to clients?

sinful tree
crisp shard
#

anyone in here recommend against EOS vs Steam? i like the EOS terms a bit better but maybe there's a third even better option when it comes to dedicated servers? would love any thoughts on this as im going back and forth deciding

sonic obsidian
crisp shard
crisp shard
#

i'd love to have an opinion from someone who has used both

crisp shard
crisp shard
#

i mean steam does too, but it's less unreal specific , for docs

#

i just want something i know i could trsut long term and i feel being that epic made unreal EOS just seems like the better option but i dont know how difficult integration between the two is / up keep et

sonic obsidian
#

U also having issues with steam ded servers?

crisp shard
#

especially after looking at the rev share distribution differnces

sonic obsidian
#

I've also been considering switching to EOS it also has crossplay support if you want to use EOS I would recommend taking a look at the EIK plugin it has host migration and other features exposed to bp

crisp shard
#

it seems super well documented

#

good community

#

these are things as an indie dev i need lol

sonic obsidian
flat night
#

hey guys, for setting up an Online Lobby system that uses Steam, do you use any plugins or do you just use the Online Subsystem in Unreal?
I am wondering what to use to create a system where you can join a lobby, play with people, lobby gets locked when the game start, etc
I saw there's some plugins on the Store that might save some time with this, but I wanted to hear what others are using

#

I was using the free plugin AdvancedSteamSessions but I have not really delved into it too much. I think I've seen that with these online systems you need to make Delegates to check things if you fail to join, manage to join, game doesn't start, etc.

crisp shard
flat night
#

why are you thinking of switching?

crisp shard
flat night
#

ah, so it's not that you are unsatisfied with, as much as that you are thinking of switching from Steam to Epic Games Shop?

crisp shard
#

i also just like that epic online services is made by epic which made unreal engine. just seems like a better play long term

dark edge
crisp shard
dark edge
crisp shard
#

but EOS is cross platform so i could still put the game on steam ?

dark edge
#

Ya

#

EOS is just the online backend.

#

Sessions, friends, achievements, all that

crisp shard
#

yea i mean im really just in it for the sessions and ease of integration

#

and authentication stuff but i know steam has the same

#

i think i just mentioned that epic's rev is more appealing, which it is, but yea less market share i guess but that's not really the whole picture, if you for example have in game transactions, this can be an issue w 30percent rev share

modest crater
#

epic games exclusivity with alan wake 2 was a massive hit in profit on pc, steam is simply charging that much because they can, people dont want to buy games in different places, thats where steam wins for now

half iris
#

Question for those that have ventured into the hell that is physics replication:

My current situation entails that I simulate the physics on the server, and pass the world transform of the authoritative object to the non-authoritative versions of itself through a replicated variable. Visually this creates a pretty decent result, however;

I now have a driveable physics based hover cart in the game and although it looks visually pretty smooth, the controls suck. When enabling the simulated network lag inside the engine, the hover cart responds pretty late already when using the average network lag simulation preset. With a bad preset it becomes a really bad experience.

So concretely my question; Is this the point where I consider simulating physics on each client, and sending that location data to all other clients except for the owning client? I believe this is what the "Replicate Physics to Autonomous Proxy" checkbox can be turned off for right?

#

The problem it would solve is having a much better control experience. I am just wondering what the drawbacks are, because there must be some

dark edge
half iris
warm sparrow
#

does the players array in gamestate always have the same order for every client and server?

tardy fossil
#

should try the physics prediction optin in project settings

#

but if your game is co op or cheating isnt overly a big concern, yea just make the physics client authoritative

half iris
storm grove
#

May sound dumb but if I run as a Listen Server do I still have 3 instances? like a server and 2 clients where one is both server and client? I Ask because I am having some issues with an HasAuthority check, if thats true then I need to re think this.

I thought It would just be a server and a client where the server is just not running in headless, thats what a listen server was but I guess its more like play in editor where the game acts as both? Idk any one please confirm

dark edge
#

It's been in the engine forever. As long as you don't need local prediction it works really well.

half iris
dark edge
#

There's tunable parameters for the physics replication. The default settings are way too strict.

#

But in general, if you apply similar forces on both sides, the physics replication will keep them in sync pretty smoothly.

half iris
dark edge
#

You don't need fixed tick rate.

#

Basically the whole thing that you did with replicating out the transforms, that already exists. The engine can already do that, with much better smoothing than whatever you cooked up. It doesn't solve the prediction problem, but it does solve the syncing problem.

half iris
dark edge
half iris
dark edge
#

It's basically simulating on both sides, with client being smoothed toward the server's results, hard snapping if it diverges too far.

half iris
storm grove
chrome bay
#

Listen Server is running server and client under same process

#

There's no "background" server or different game instance or anything

little pumice
lost inlet
#

the listen server host isn't a "client"

#

they have ROLE_Authority over the world

unkempt lodge
#

Hey i was wondering, is it possible to transfer ownership of an actor from a character to another and is it usefull ?

thin stratus
unkempt lodge
#

I have a character than can put a ladder on the world, but once it is on the world i would like the owner to change so it is the world

thin stratus
#

Should be as simple as setting the Owner to null

#

Server must do that though

unkempt lodge
#

So if the owner is null, it is like if i placed the actor in the world from the editor directly ?

thin stratus
#

Yop

unkempt lodge
#

Ok nicee, thanks !!

steep wolf
#

if i want a easily scriptable and replicated random value, how should i go about approaching it?

#

ideally i want just a node i can put it, that automatically replicates a random number. on server, node blocks execution of script until it receives a number from client / time expires, and it automatically generates one

#

the usecase for this is ability/general gameplay scripting

zinc lodge
#

Hi, I have managed to get all of my movement replicated correctly, but after a few hours of trial and error I still haven't been able to make animations replicated.

I have an animation blueprint that transforms my vehicles bones (wheels) to either spin or turn when steering based on steering value and velocity. Even though I replicated the variables as I did for my movement, calling their update with a event run on the server, the animation only works on the server side.

ember vine
#

autonomous proxy client correction looks like it can correct a rotation, in what circumstances might that happen ? thought player rot is client auth, or is that just if its controller driven

quaint tendon
#

Pretty happy with this. Replicated 240 npc characters on remote dedicated server. Just need to optimize a little to keep it above 50fps. It's for a giant soccer game

gritty warren
#

If a person becomes net relevant, do 'On_Rep' functions get called at that moment for data with the 'ReplicatedUsing' specifier?

I'm using On_Rep to set stateful data in an ABP, and perhaps I should just be accessing that data and setting it every frame instead

lament flax
#

it should

solar stirrup
#

Assuming you didn't change the notification condition

primal trellis
#

How do I make a player watch another player's camera view? For example, a character dies and his view then switches to that of another player who is still alive (of course, the player who owns the camera still has 100% control and the player who is watching will simply follow the orientation of the view of the player being watched). I wouldn't want him to be just a "free camera" in the environment

I saw that there is the Set View Target With Blend. If it is the solution for this case, what is the correct way to use it to achieve this result? I also accept other methods

nova wasp
#

as the server needs to know who you are viewing to set replicated properties like target view rotation in the default setup

zealous knoll
# dark edge It's basically simulating on both sides, with client being smoothed toward the s...

so, if I "Add impulse" to the capsule of a Player when he makes an input.. and I want it replicated exactly, as it will hit some Box, that can hit another Player capsule...
I would just in PlayerA: Input x&y & "PlayerState:PawnPrivate" reference -> Event Run On Server -> Event Multicast -> x&y with some forwarfVector etc to make the necessary vector for the "Add Impulse" and the "PlayerState:PawnPrivate".
Unreal will manage anything else?
and... is this the right way to set up the replication?

vivid seal
#

Anyone know if there's a way to get previous value as an argument to PostReplicatedAdd or PostReplicatedChange in a fastarray? like you can with normal OnReps?

meager spade
#

there wont be a previous with v

#

PostReplicatedAdd

vivid seal
#

yeah sorry lol

#

postreplicatedchange though

meager spade
#

nope

#

why do you want the previous

vivid seal
#

so i can run some "unequip" logic on the previous thing before my "equip" logic on the new one

meager spade
#

wait your using fast array for that logic?

#

i would rethink your design

vivid seal
#

just the callback to run clientside on change events

meager spade
#

we have a fast array for equipment

#

but it doesnt handle the equipping, etc

nova wasp
#

store what the current value is outside of the fast array or on a non-replicated property you set

vivid seal
#

yeah, i can always do that, just didnt know if there was a nice builtin way to do it like regular OnReps have

meager spade
#

your fast array should only deal with the items being changed

#

you should have an external manager handling the stuff

#

we only replicate the items, items add them selfs to the WeaponManager, weapon manager is in charge of what is equipped, etc

#
private:
    UPROPERTY(Transient, ReplicatedUsing=OnRep_CurrentWeapon)
    AShooterWeapon* CurrentWeapon;

    UFUNCTION()
    void OnRep_CurrentWeapon(AShooterWeapon* PrevWeapon);

    UPROPERTY(Transient)
    AShooterWeapon* PreviousWeapon;

    UPROPERTY(Transient)
    TArray<AShooterWeapon*> CurrentWeapons;``` we hold these in our weapon manager
storm grove
#

privateeeeeeeeee? 🧐

meager spade
#

yes

storm grove
#

also should previous be a weak pointer just in case?

vivid seal
#

we were using it for multiple weapon slots, so an array of 4 equipped weapons or whatever, and then the slots just have the weapon pointers (if you unequip the weapon its destroyed anyway)

meager spade
#

its a UPROP..

#

it will be nulled when GC runs

storm grove
#

right but correctness sake an all that, plus the new GC kinda requires it done properly now

meager spade
#

eh

#

its an Actor..

storm grove
#

otherwise you'd need manually null the pointer

meager spade
#

no i dont 😛

nova wasp
#

assuming thats what they are doing

meager spade
#

TWeak only makes sense when holding objects when a full chain of reflection can't be guarenteed

storm grove
#

right but it wont be GC'd if its ref'd with new GC even if Destroy() is called because it wont null your stuff for you

Atleast thats how I understood it

nova wasp
#

I do that so much I'm surprsied fast array serializers don't have some way to get the owning uobject casted templated

meager spade
#

thats not true

#

Actors will always be destroyed

#

World marks them as garbage

#

GC will run and null the pointers

#

if they are UPROP

#

unless i have something turned off

nova wasp
#

gc.PendingKillEnabled changed to gc.GarbageEliminationEnabled

#

as of recently

#

which is honestly easier to understand as a name imo

meager spade
#

mine is false

#

oh nvm

#

its true

storm grove
nova wasp
#

yeah that is the default, this is the new setup where you have to manually null your crap and it will yell at you

meager spade
#

what is the benefit of that

nova wasp
#

epic seems to thing the old way was unintuitive somehow vs regular conventional smart pointers (beats me)

#

according to that twitter thread from years ago

storm grove
# meager spade what is the benefit of that

we were using shared pointers like weakpointers with explicit delete stuff like Destroy or Mark as gabage, this way is more correct. A strong ref should stop GC, thats why weak exists in the first place

nova wasp
#

my personal excuse is that it makes GC need to do a bit less work

storm grove
#

well with new reachability TObjectPtr stuff it shouldnt matter (in theory)

meager spade
#

but that can also lead to subtle bugs

#

a lot of game code would need to be changed

#

i assume blueprints dont keep them alive

#

cause that would be a fucking disaster

nova wasp
#

yeah I agree it's very crazy to switch to it on any sizeable project

storm grove
#

lol does bp even have weak pointers?

nova wasp
#

it will yell at you if you maintain any stale actor references (or uobjects) from the old world

#

I had to fix a couple mass bugs with it

storm grove
#

It should have been opt in but maybe because you upgraded engine version

nova wasp
#

not really, soft object etc I guess is close but that's more about asset loading
apparently soft pointers ARE weak?

storm grove
#

yeah exactly dif thing entirely

nova wasp
#

if it has any I would be surprised

meager spade
#

the whole purpose is to reduce GC work?

storm grove
#

I could probably be really annoying and @hollow eagle and see if he can shed some insight

hollow eagle
#

The new GC mode? There's little to no benefit on perf

#

It's just to bring the unreal GC in line with every other GC'd language

nova wasp
#

yeah I was thinking "surely it's less work" but their comments seem mostly about consistency

#

with how someone from C# would expect it to work

#

etc

hollow eagle
#

I can't think of another GC that lets you manually mark stuff as garbage and then have objects get nulled while still strongly referenced.

nova wasp
#

I'm so Unreal-brained I have no idea lol

hollow eagle
#

It's only a problem for gameplay code because now people aren't used to dealing with it.

#

It wouldn't have been an issue whatsoever if it started this way

nova wasp
#

yeah because we would have been using weaks more etc

#

I suppose

#

If true, objects marked as Garbage will be automatically nulled and destroyed by Garbage Collector

#

I still feel like I'm missing something obvious here: when they say "nulled"

storm grove
nova wasp
#

they mean every raw UProperty pointing to this gets reached out to and bonked to be nullptr (?)

hollow eagle
#

How often do you really run into that though

molten vine
#

Hey Vori! I'm trying to implement your killcam system. But I'm having a lot of trouble with the scripts that you included. It seems to be full of errors, and after doing my best to resolve them all, it doesn't work correctly. The article doesn't mention that the example scripts have all these issues. And was wondering if I could get a hand figuring out the Demonetdriver and the dynamiclevel duplication. I see that other people have gotten it working and am wondering if I'm using the wrong engine/Lyra version. (I'm on 5.2)

hollow eagle
#

Soft pointers are weak anyway

nova wasp
#

so what maintains them after being loaded?

hollow eagle
#

Tiny bit of extra memory use but otherwise work fine for bp

#

Maintains what

nova wasp
#

the reference to the uh, soft asst ptr etc

hollow eagle
#

Not sure what you mean

nova wasp
#

I assume. whatever else you generally use that asset for

#

I might be mixing up soft pointers and soft asset pointers?

hollow eagle
#

There's no such thing as a soft asset pointer

#

It's just soft pointers

#

And soft pointers are weak. With some extra data to store a path in the case of an object that isn't loaded.
They can be used exactly as weak pointers if needed.

nova wasp
floral sail
#

So I have this StartAttack function. It is called from AIController (so from the Server, since only Server has this controller). I wonder what is the better approach - have the logic run on the Server version of the Character (like it is now) and then Replicate data down to clients, or simply convert the function to Multicast? Both work as intended, but I have a feeling that having it on the server is a better solution, tho not fully understand why (better anti-cheating and better sync?).

nova wasp
#

those are very different problems

dark parcel
#

What would be one way I can play random sections in montage but sync accross all machines

#

was thingking of just having a random seed but I will have to figure out how to sync at the start

#

bcause late joiners won't even be in the same section at the start

dark parcel
#

why would any of the client tell server to tell the AI to attack?

#

and if that'st he case, which player?

#

Just make the function get executed by the server

floral sail
#

ye so basically what I did now

dark parcel
#

if that's in AI controller then that's not what you are doing

floral sail
#

except that probably should remove RPC to Server

dark parcel
#

Server RPC is a mean for client to tell server to do something

#

if you want to execute something in the server by the server, you should not use Server RPC

floral sail
#

actually I might still need an RPC

dark parcel
#

you just do switch on authority to filter the codes so the code only run on Server / client

floral sail
#

Well this function is kinda universal

dark parcel
#

but AI controller only exist in server anyway afaik

#

so RPC doesn't do anything here

floral sail
#

the BasicAttack function is on Character_Unit, which can be both AI or Player controlled

#

here I call it from AIController (or BTTask to be percise), so its naturally called only on the Server. But when I want to call it from Player Controller, then I would need a Server RPC no?

nova wasp
#

the act of showing the attack visually, and the logic behind what it actually does are different things and if this is doing both it's probably time to separate those somehow imo

floral sail
#

thats what I had to do

nova wasp
#

to keep things fair you probably want the server to be the single place that actually does the "true" damage etc

floral sail
nova wasp
#

better done as an onrep

#

imo

#

GAS montage replication is basically just a replicated montage + some timing information and a slot

#

it's a a bit complicated how it encodes the slot index but the ultimate result is just a replicated struct that says "play a montage here, at this speed"

floral sail
#

I'm using AnimBP atm for Attack animation but will switch to AnimMontage soon, since I figured AnimBP is not very good for single animations

#

Well here's the whole function

#

What do you think can be done better in regards of networking?

#

I think that only server should be in controll of StartCombat, StartAttack and obviously DealDamage, no?

#

and then just replicate variables and multicast animations to the clients

nova wasp
floral sail
#

how?

#

The code atm is run only on the server which is intended

#

I will rewrite the attack animation soon to Anim Montages, but again, I would still need multicast won't I?

#

lets say in this case

#

that will be played only on the server version of the Unit?

nova wasp
#

replicated variables are changed on all clients who the object is relevant for

#

of course the anim montage must be played manually on each client from something replicated, rpc or replicated property or whatever

floral sail
#

oh, the character (Unit) is replicated, right

#

so Anim Montage that is played on Server Unit will be played on Client Unit too

#

makes sense

floral sail
#

in my original solution I needed multicast because I needed a reference to the client specific AnimBP

nova wasp
#

just because you turned on replication doesn't mean the every subobject and every property is replicated, which is a good thing

#

and yes the client will have to figure out which anim bp it is from their pawn, component, whatever

opal pulsar
dark parcel
#

Actually when I think about it, player can just get extra info like current montage time from the server when getting the seed number

nova wasp
#

that's more or less what GAS montage replication does, but I think something more project-specific can be much better

#

the goal is to get the same state, but you don't need to send over the entire "play this montage"

#

doing things atomically in one dumb struct and not relying on multiple properties replicating in concert generally works better in my experience

wispy heron
#

hey all 🙂 plz point me in the right direction if this is the wrong place

i've just build a dedicated server using the 3rd person template project. when i connect my clients to my server, all local, i get really bad latency. is this normal for out of the box? do i need to adjust some settings, or should two characters run around fairly seamlessly in this setup?

opal pulsar
#

any chance I can have a ReplicatedUsing on a struct or no

opal pulsar
wispy heron
#

apparently a bunch of my ram is being used. gonna reboot the system

nova wasp
wispy heron
#

ah, i've sorta figured it out a bit. when one of my client windows is in focus, the other is not updating properly. if i de-focus the client, the other is also smooth as butter.

opal pulsar
nova wasp
opal pulsar
#

ReplicatedUsing="OnRep_XP" only works if thats a ufunction an structs cant have them

#

oh no on the struct

nova wasp
#

you make the ufunction in your class itself

#

oh you mean INSIDE of the struct, oof

#

yeah that's kind of not how replication works

#

it would be interesting to make callbacks per member I guess, but at that point you are getting into just wanting custom serlialization?

opal pulsar
#

yeah I just figured since you can mark them explicitly Replicated or not with replicated being default

I figured that was the case thanks anyway

nova wasp
#

the simple thing imo would be to just write an onrep function inside of the owning uobject that passes it and the previous value to the struct function

#

and the struct just only compares that field

#

that's what epic does for the most part with the larger "wait there's actually different codepaths" struct onreps

nova wasp
#

it's of course custom serialized but the idea is that the received struct indicates what's actually on it as bitflags

#

which could be simple comparisons to the last value

#

not a great example I guess as it's not just a simple onrep of a default struct serializer type

#

note that FRepMovement implements its own equality == operator

#

this is to help figure out if it should be sent (on the server side)

jagged kernel
#

How do I change the level for all players in the lobby and also change the game mode? I used advanced sessions plugin and it worked for changing map but there was no "options" output like in the "OpenLevel" node in the "ServerTravel" node. So I couldn't change the game mode with it. I also tried seamless travel but I didn't get how do i do it. How can I get it to work guys?

opal pulsar
#

wait if I have an array of stucts do I only get OnRep_MyArray when the array itself updates and not members on the structs in the array that are also replicated?

rustic sable
#

I have a log actor spawned on the server and set to replicate physics on begin play. Not sure how the proper way to handle this is as currently getting a lot of stuck errors and jitter on the clients.

#

I figured begin play runs on all instances so these changes so the collision setup should be reflected everywhere.

storm bough
#

Question about network authority. How I can "get" authority?
My situation: I work on player respawn. If player is killed, cooldown beings and when it ends player can press key and he will respawn (calling Respawn() on player character). Problem is it works only on server player, not client. On client engine complaints in logs:

LogController: Warning: Trying to possess BP_ThirdPersonCharacter_C_3 without network authority! Request will be ignored.```
I tried to run code on server: player presses respawn button -> `Respawn()` -> `SV_Respawn_Implementation()`
Where `Respawn()` is obviously on local client without authority and `SV_Respawn_Implementation()` has this signature:
```UFUNCTION(Server, Reliable, BlueprintCallable, Category = "Respawn")
void SV_Respawn();
void SV_Respawn_Implementation();```
But that does not help, `HasAuthority()` called in `SV_Respawn_Implementation()` is still false. I watched some youtube tutorials about respawn but they weren't much help. So, how I can do something on client that server will accept as authorative?
lost inlet
#

you'd call SV_Respawn();

storm bough
#

ouch, will rectify that

storm bough
rigid steeple
#

Hi, is it necessary to replicate the Weapon Actor? For example, is it better to call the weapon firing function via RPC in the character or weapon script?

#

I can call server RPC functions only from the character script, but from other scripts I get an error of either no owner or no role if the actor has replication enabled

lost inlet
#

I don't know why that would be "better", also don't paraphrase errors

#

The weapon actor would need to be owned by the character or its player controller for server RPCs to work correctly

rose pollen
#

is it possible to change the NetServerMaxTickRate either when the server is launched or via an executed console command or something? I want to have a different value for different maps without having to package the server build multiple times

obtuse field
#

How should I make for TCP server socket to negotiate for port with the client? Is there a ready implementation, or should I create another TCP connection just for that

vivid seal
#

its a little tricky to setup the first time but its super useful

nova wasp
#

It's my uh, idea that unreal kind of just does that for you

#

for the one ip net driver

nova wasp
#

Based Movement is already automatic

#

I don't know about mover 2.0

nova wasp
#

Make sure the ticking dependency for based movement ticking after the platform is working I guess

#

The CMC needs to know which way it moved so it has to tick after the platform moves

#

From what I understand

zealous knoll
#

Why I can replicate the activation of physics on the capsule but not to turn it off correctly? once I click "F" by second time I cant move the character

opaque forge
#

If you have a variable with a ReplicatedUsing, but it has already been updated to the new value with client prediction, will the notify still be called?

nova wasp
#

the cmc should handle this itself in UCharacterMovementComponent::MaybeUpdateBasedMovement

#

FCharacterMovementComponentPostPhysicsTickFunction is what executes after the movement base moves

obtuse field
rustic sable
#

I notice if I have a static mesh actor with replicates movement and replicates static mesh movement everything looks ok when pushing the mesh around. However when the mesh say rolls into the player jitter can still occur, any fix for this?

graceful steeple
#

Hi all,
I am making a closed-environment game where players have the ability to run superpowers (like adding delay to their outgoing packets, or so) by pressing a key in their game
What i want to do, is after pressing a key, the game should communicate with some other EXTERNAL program/software which contains the script to do as needed
First, I want to ask is this possible?
Second, can someone guide me into what direction to look at for this?

Thanks in advance,

tardy fossil
#

Does a single replicated chaos vehicle really use 25kb/s of bandwidth when there’s only a single person in the server? That seems way too high to me

short arrow
#

I have 1000 actors to "replicate" their locations and I have 2 possible options. Which option is likely more efficient?
Some context: I need the absolute most efficient method possible of replicating these actors. The actors themselves aren't replicated at all, clients spawn and move them on their own through prediction and a custom movement method I created.
Finally, there is an actor manager which is replicated that is in charge of feeding the clients their most recent whereabouts.


Option 2: Use  Fast TArray Replication to store the locations of the actors.```
-# I could try both methods and figure out which is more performant myself but I'm really sleepy and it would take atleast an entire day to fully test both methods... I'm hoping someone might have some insight.
#

It's probably option 2 cryingcoolguyemoji I really don't want to set that up though

tardy fossil
#

the most optimal way would probably be using a custom UChannel class and streaming the actors locations through that, only when they change

proven pagoda
#

I'm dying here. I am simply calling destroy on this weapon to get rid of the mesh and you can see my attacks change when I swap from equipped to unequipped however I can't get locally controlled clients to have the mesh destroyed. It destroys on server and replicated down but the only place I can't destroy this actor mesh is on clients like this. Anyone know how to destroy an actor that even me making a net multicast to destroy doesn't destroy it on locally controlled clients?

short arrow
# tardy fossil the most optimal way would probably be using a custom UChannel class and streami...

I'm building a swarm type game so they are almost always on the move, thats why I built a prediction system. The servers location only needs to be sent to clients every second to account for small correctional checks. That might be helpful information. I feel like making a new UChannel compared to a single actor that holds an array of locations would only give me the tiniest amount of difference? Do you disagree?

proven pagoda
#

nvm I got mine

lament flax
#

im trying to bind the OnComponentBeginOverlap event the following way :

  • if listen server enters, call only OnComponentBeginOverlap on LS
  • if a client enters it, call OnComponentBeginOverlap on LS and Client (whatever order)

i tried on begin play the following, but OnComponentBeginOverlap gets called on Client 1 when the LS enters the box

    if (HasAuthority())
{
        BoxComponent->OnComponentBeginOverlap.AddUniqueDynamic(this, &AJobLocationVolume::OnBoxComponentBeginOverlap);

}
else
{
        BoxComponent->OnComponentBeginOverlap.AddUniqueDynamic(this, &AJobLocationVolume::OnBoxComponentBeginOverlap);
}
kindred oyster
#

What are the simplest way to Test mp with builded Project? Are there some Tutorial for Host creating/ Client joining Game

thin stratus
#

If you can open ports on the host, you can use direct IP connection

#

Otherwise you'll need to either stick to LAN, or use something like Steam.

kindred oyster
#

yeah I can open ports

#

this are only rough tests I want to do

#

under a more realistic scenario

scenic cradle
#
in .h
    UFUNCTION(Client, Reliable)
    void ClientAnimation();

in .cpp
void AFirstPersonCharacter::ClientAnimation_Implementation()
{
    static const FString ContextString(TEXT("Player Recoil Montage Context"));
    FPlayerShootMontage* ShootMontage = PlayerShootMontageDataTable->FindRow<FPlayerShootMontage>(EquippedWeapon->GetName(), ContextString, true);

    if (ShootMontage)
    {
        UAnimInstance* AnimInstance = FirstPersonMesh->GetAnimInstance();
        AnimInstance->OnMontageBlendingOut.AddUniqueDynamic(this, &AFirstPersonCharacter::OnMontageBlendingOut);
        AnimInstance->Montage_Play(ShootMontage->FP_Montage);

        EnableSpray = true;
        ServerAnimation();    
    }
}

How to convert this function into a template? Because in case of multiplayer, function name in header and in cpp are different and template functions are define in header so?

meager spade
#

you cant make that a template

#

also very strange your doing animation with a clientrpc

scenic cradle
scenic cradle
crisp shard
#

uhhhhhhh how big is the souce build of UE?? cause i continue to run out of storage while trying to build all of it

lost inlet
#

well you don't need to build all of it

#

if you use a native build

obtuse field
#

So, I'm sending RPC from client to server. I set Owner on the client, set SetIsReplicatedByDefault, but my RPC is not executed server side. Did I forgot about something? Actor's bReplicates is set to true. Did I forget about something?

lost inlet
#

yeah because you set the owner on the server, not the client

obtuse field
#

W8, so owner of the actor must be set to particular controller on the server, in order for Client RPC to run on it?

crisp shard
lost inlet
#

which instructions? you can either do an installed build, or a standalone (foreign) build

#

but native builds is what the big boy studios do

#

so if your project is under the engine root, UE5.sln has the game project inside it

#

and you just build that instead

#

then UBT can just figure out what you actually need, saving hours of compile time

#

but unrelated, I would have >=1TB SSD just dedicated to UE projects

crisp shard
crisp shard
lost inlet
#

oh that tells you to use the dog water github desktop client and everything

#

but that's the foreign build setup

lament flax
#

is there any way to make a repnotify variable call OnRep if the value is the same on server and client

crisp shard
lament flax
crisp shard
sinful tree
#

This should trigger the OnRep on the client even if it's the same value.

twin juniper
#

Hi guys, is it valid to change the client's walking speed in this way?

lament flax
kindred widget
# lament flax Doesnt work because on server its the same value

The server will evaluate the value to see if it needs to replicate it to clients. If it doesn't change on the server, it will never replicate to clients.

If the server does replicate the value, the normal behavior is to run the OnRep on the client if the value is different to what the client has when the new value came in. You can chance this by registering it with the always condition to always OnRep when the value reaches clients.

If the value doesn't change on the server, it will never be sent to the client, so the override won't matter.

lament flax
kindred widget
#

Why would you want to?

lament flax
#

Changing the values 2 times to make it trigger the onrep sounde weird

kindred widget
#

If it didn't change on the server, why would it broadcast that it did?

lament flax
#

Hud stuff

kindred widget
#

Then run it on the client on Beginplay or the OnRep. One will be correct.

lament flax
#

It isnt beginplay since its while playing

modest crater
lament flax
#

Its already on the onrep, but i just told i got the issue

#

I guess the only solution is to edit the var 2 times

kindred widget
#

If you need an event to make something happen. Use an RPC. You don't use an OnRep to trigger an event if the value doesn't change.

lament flax
#

Okay

#

I guess its what ill do

ancient glen
storm grove
#

not a valid way though

#

You want to movement flags that are replicated correctly

#

See FSavedMove_Character

lament flax
#

Im the older fishy here xD

ancient glen
lament flax
storm grove
#

if a property has changed?

#

If so kind of, use a struct with TStructOpsTypeTraits with WithNetSerializer = true;, now its up to you to pack the data into the archive and determine what gets sent when.

It wont replicate however unless it can see a value has changed (this means atleast one value must be reflected so it will call NetSerialize), you could have a single int act as a key and whenever you want it replicated just MyKey++ and now it will send any data in your NetSerialize function

lament flax
lament flax
lament flax
#

^^'

storm grove
#
USTRUCT()
struct FMyStruct
{
  GENERATED_BODY()
  public:
  UPROPERTY()
  int MyKey = 0;
  
  // This is explicitly marked NotReplicated, this is because in our UObject we are replicating the whole struct so all members besides explicitly
  // marked NotReplicated properties will not replicate, so if you need it to be reflected for BP access but not to track for networking do this
  UPROPERTY(NotReplicated, BlueprintReadOnly)
  int a;
  float b; 

  bool NetSerialize(FArchive& Ar, UPackageMap* PackageMap, bool& bOutSuccess)
}

template <>
struct TStructOpsTypeTraits<FMyStruct> : public TStructOpsTypeTraitsBase2<FMyStruct>
{
    enum
    {
        WithNetSerializer = true
    };
};

inline bool FMyStruct::NetSerialize(FArchive& Ar, UPackageMap* PackageMap, bool& bOutSuccess)
{
  // Note how we replicate these ourselves even though they arent being tracked by unreals shadow state
  Ar << a;
  Ar << b; 

  // Just make sure we send the key with the new data
  Ar << MyKey;

  bOutSuccess = true;
  return true;
}


// On your UObject/AActor its just
UPROPERTY(ReplicatedUsing=OnRep_MyStruct)
FMyStruct MyStruct;


// now the only time MyStruct is considered *changed* in unreals eyes is when I do this on the server
MyStruct.MyKey++;

If you wanted slightly better perf you can make it do a Push based replicated and have a IncrementKey function that increments and marks the struct dirty on the uobject

#

Note this was all typed here so I have no IDE syntax

#

could be a typo or two

lament flax
#

thanks a lot

#

so here, a and b wont replicate ?

#

i quite didnt understood the "NotReplicated" part

#

okay, a and b are replicated "by us" so we need to flag it as not replicating

twin juniper
# haughty ingot It is a way

The problem is that people who enter my session when it runs are flagged, as if the speed of the client did not match that of the server.

haughty ingot
#

That's why I said it is a way, but there are better ways. But it really depends on your knowledge level, if you can get into C++ you can customize the compressed flags in the UCharacterMovementComponent, if not this is fine too

#
    // Bit masks used by GetCompressedFlags() to encode movement information.
    enum CompressedFlags
    {
        FLAG_JumpPressed    = 0x01,    // Jump pressed
        FLAG_WantsToCrouch    = 0x02,    // Wants to crouch
        FLAG_Reserved_1        = 0x04,    // Reserved for future use
        FLAG_Reserved_2        = 0x08,    // Reserved for future use
        // Remaining bit masks are available for custom flags.
        FLAG_Custom_0        = 0x10,
        FLAG_Custom_1        = 0x20,
        FLAG_Custom_2        = 0x40,
        FLAG_Custom_3        = 0x80,
    };```
#

That's your golden ticket

#

Or try Mover 2.0

storm grove
# lament flax okay, a and b are replicated "by us" so we need to flag it as not replicating

Yes its replicated by us, no we only need to flag a value if you want it to be a UPROPERTY like if you wanted a pointer to not get GC'd or if you wanted a variable to be exposed to bp then we need a uprop specifier but we trick unreal and say "dont worry about replicating this value"

and then we tell unreal with the type traits template struct that when it comes time to serialize our struct dont do it your way by checking reflected properties, just let us have the buffer (the FArchive which we write to) and then we populate it with the data we want and send that over the net in the form of just a "blob" of bytes that represent our struct,

then when the client receives the update, it sees we use our own NetSerialize and calls that again with the FArchive passing us back the blob of bytes, which we then write into the variables on the struct

opal pulsar
#

If i wanted to have servers of my game hosted through a linux docker container, does that mean I need to compile the server build in a linux environment or can I get away with it some other way like using clang on windows?

plucky prawn
#

Your container has to run Linux so you would need to build for Linux

grizzled garnet
#

how do I check if a connection string is valid, ie check that it's a valid listening server? when using ClientTravel

twin cedar
#

Hi everyone! I know this might be a common question, but I could really use your help. There are so many tutorials on multiplayer development out there on YouTube and Udemy. Can anyone recommend a good tutorial to start with? Thanks in advance!

nova wasp
#

read the pins I guess

honest bloom
#

People don't notice this place, maybe should be pinned as well

#

(talking about that page specifically)

thin stratus
#

I can point to that page specifically in the pin for the doc fwiw. But I wouldn't create another pin for it.

twin cedar
peak lintel
#

I have a multiplayer game and I'm spawning some NPCs. Each time an NPC is spawned (from the game mode) the AI Controller begin play is triggered, which it shouldn't. Why is that? I'm doing here something wrong?

chrome bay
#

Because you're calling SpawnAIFromClass which will create a new pawn with a new AI controller

#

Begin Play is being called on a differnent/new controller

peak lintel
#

Thank you! Indeed, now it's calling if I use the Spawn Actor from class. I know the next question is related to #gameplay-ai but I'm going to ask here since it's also with multiplayer. So, the AI is spawned now, but the BT is not finding any other actors (after the first round was killed and now respawned).
The first pic is how I respawn and the 2nd is from the AI Controller. Should I run again the BT? Or not? The perception event is not triggered again.

Edit: I forgot to posses the Ai to it's controller.

odd iron
#

Hey friends I'm using party system and party owner hosting the party members in his own session.
When i try to join the dedicated server using servertravel url:port the error im getting is

ERROR: The map '8a386d6bb0.net:32152' is either short package name or does not exist.

recognized: servertravel 8a386d6bb0.net:32152

Also I've tried to run command on server from controller same result
How can i transfer the whole players then ?
Thanks in advance

unkempt lodge
#

Hey, i have a voice chat in my game but the gain is either too low or saturating, do you know how I can get a good result with the voice chat for all users ?

sinful tree
twin juniper
zenith cypress
#

Hi everyone,

I’m encountering an issue in my small local multiplayer project. When launching the game, the first player (usually the host) is never controllable, even though their 3D model spawns correctly (launching in Standalone Game as Listen Server with 2 players).

I’m using a custom Game Mode Blueprint and have set the default pawn to None, as I handle possession myself within the Blueprint. It seems like the problem might be related to the default pawn setting, but I’m not entirely sure.

Has anyone experienced a similar issue or can point me to relevant online resources? I’ve seen similar problems discussed on Unreal forums, but they were never resolved. I included my GM blueprint in case something was obviously wrong to some experienced people.

Thanks in advance for any help!

odd iron
sinful tree
odd iron
#

@sinful tree Ok thanks I am trying to move the whole party to the dedicated server .
Is it possible to using multicast event fires on every client to use open command ?

#

or which way is better ?

sinful tree
# odd iron <@218956378654507008> Ok thanks I am trying to move the whole party to the dedi...

This probably won't work well as you'd be telling the host to move too without guaranteeing the clients have received the message to move and then they could end up disconnecting from the host since it's effectively ending its session before they receive the message, thereby they don't get it and do nothing other than disconnect from the host.

Having the client not connect to the host at all and using a party online subsystem to communicate what is needed to have clients connect to the dedicated server when needed would be best.

#

Essentially, players stay as standalone games until they are ready to connect to your dedicated server.

odd iron
stark nova
#

Hey does anyone have advice on how to debug connecting to a dedicated server?

I have my server executable running on my dedicated server with an IP address that I know is accessible.

I then run from blueprint "Execute console command : https:IPADDRESS:7777"

This works for debugging locally but not remotely. Any ideas of how I could start debugging the connection?

thin stratus
lament flax
#

since my pawns will never get destroyed, should i move some playerstate logic to my pawn since all playerstates are always relevant ?

#

i dont know how impactful are many playerstates holding data

#

because there is some data that the PS holds that other players shouldnt care about

stark nova
pseudo merlin
#

hi, is it possible to make a replicated property for an actor class NOT replicated for a child? I'm specifically looking to make AActor::bHidden not replicate

fossil spoke
#

DOREPLIFETIME_ACTIVE_OVERRIDE takes a bool, true to replicate, false to not.

pseudo merlin
#

thank you!

nova wasp
pseudo merlin
#

ooh ill look into that too, thanks

nova wasp
#

and one that helps it apply to private parent class properties

charred island
#

is there some way to get a client-side event after a player has fully spawned in? I am trying to update some gui code after the player has fully loaded in

#

I tried putting some code at the end of the actor's beginplay event, but it isn't seeing all the pawns

modest crater
#

You could bind to a pawns possessed event, it really depends on what you define as "fully spawned in"

charred island
#

I needed all the pawns completely loaded (they all need to exist so that each of them can build a list of the other available pawns)

#

I figured out a hacky way of doing it, which is fine for now

thin stratus
#

That's also the cleanest way

#

There is no "everyone spawned their pawn" event

charred island
#

just hacked it for now to have every pawn inform every other pawn on spawn, lol

#

works, just stupid and inefficient

thin stratus
#

What you can do is:

  • Create a ManagerComponent (ActorComponent), or, if C++, a WorldSubsystem
  • Add a Register and Unregister Pawn function, an Array of pawns and two Delegates/EventDispatchers, for each event one
  • Register would add to the array if not already in and call the first delegate (e.g OnPawnRegistered), Unregister does the opposite then
  • In your pawns BeginPlay, get the Comp/Subsystem and Register the pawn
  • In your pawns EndPlay, get the Comp/Subsystem and Unregister the pawn
  • Afterwards you can get the Array as an initial list and use the two Delegates you can bind to to react to the list changing
#

That's one of the simplest setups and you have a nice central place for future systems that might also need to know about the pawns being valid

#

@charred island

charred island
#

thanks!

thin stratus
#

Ah the component could/would sit on the GameState

#

Forgot that

charred island
#

my current problem is my pawns not spawning on the spawn point, instead on the origin

#

but only in the packaged game

#

ugh... I swear I've had this problem before

obtuse field
#

Player controller id is always the same on both client and server, right?

lament flax
lament flax
#

what job they have, the state and location of it
the current routine and personal state
if they are sleeping

#

each player doesnt care about this info of another player, its only for the server

modest crater
lament flax
obtuse field
#

The thing is, having data in the player state have several advantages, like e.g. you can move it between servers

lament flax
obtuse field
#

And having it in pawn makes you closed to some changes, e.g. you can't switch pawns or destroy it, if something in your vision of the game changes

lament flax
lament flax
#

i just dont know if having 20 PS with replicate data ALWAYS relevannt will affect perf

modest crater
gilded vapor
lament flax
#

so for now its not much ig

pseudo merlin
#

hi all, if I spawn a replicated actor on server, then set a replicated property on same frame, will client fire the onrep function when they spawn the replicated actor?

#

in C++ if it matters

solar stirrup
twin juniper
#

In a large scaled MP game where all weapons are projectiles with various speeds, how would you guys go for an optimized projectile system, would you just do your own from scratch or optimize the PMC ? I remember having a conversation with Jambax about the projectile system from HLL but it was maybe 2y ago.

chrome bay
#

IMO, do your own

dusk fable
#

server travel issue :
when testing in standalone , server travel works just fine , but in packaged build , it doesnt work at all , any fix for it ?

twin juniper
# chrome bay IMO, do your own

Do you remember how it was done in HLL ? (I know you said it maybe 100 times but I can’t find our conversation 😄)

chrome bay
#

ticking world subsystem updating all projectiles, no actors

#

projectiles are just line traces, nothing more

charred crane
#

Hello, I’m connecting to a dedicated server using the open port command but it’s sending my clients to the game default map instead of the server default map. Does anyone know how to solve this?

lost inlet
lost inlet
#

not sure why the LoadSelectedLevel RPC doesn't just pass the level name though

#

but I don't have the context on how your level select works

twin juniper
dusk fable
lost inlet
#

do other players see the selection or something?

#

but the likely issue is not cooking the map

dusk fable
#

each player calls his own widget , but the selected map variable is passed in one var for the server to travel to

dusk fable
lost inlet
#

what?

#

cooking the map is a PACKAGING thing

dusk fable
#

the load map function in made through interacting with an actor and pressing E

dusk fable
lost inlet
#

also what BP am I looking at?

#

widgets don't replicate for one

dusk fable
#

game mode

lost inlet
#

uh yeah, the game mode doesn't replicate either

dusk fable
#

even in standalone

#

no the map widget shows for the owning client

lost inlet
#

yeah, trying in singleplayer mode or something?

#

not sure why you're debating

#

game modes don't replicate

#

widgets do not and cannot replicate

dusk fable
#

no not debating just saying the implementation i have works in everything but packaged build

lost inlet
#

a server RPC needs to be called through something replicated that the player owns

#

like their player controller

#

or pawn

dusk fable
#

yes , the widget is called through player controller

lost inlet
dusk fable
#

the game mode bp

lost inlet
#

and what calls LoadSelectedLevel?

dusk fable
#

an actor

lost inlet
#

also "execute on server" won't do anything since GMs aren't replicated

dusk fable
#

1 sec

lost inlet
#

what actor

vast moth
#

Can a separate player controller interact with a UI on the viewport?

#

Or better question, do new or added player controllers see the same viewport

dusk fable
eternal dune
lost inlet
# dusk fable

that kinda makes sense, except making the GM event an RPC

#

so does your print message actually show up for the server player in a packaged build?

#

did you verify the map actually ended up in the build?

dusk fable
#

not really , i will check if its included

#

no messages show in the packaged build

lost inlet
#

well specifically for the host player?

#

it's a server RPC afterall

#

only the host player will see it

lime echo
#

Whatddup, anyone knows why APlayerState::ExactPing isn't zero in PIE with PktLag = 0?

dusk fable
lost inlet
#

well that's expected

#

I'm more talking about a packaged development build

#

if only this was code so you could actually use breakpoints in packaged

dusk fable
#

indeed

#

but at this point , when testing with host alone , on a packaged game , it should work

#

i will try , thank you for you time ❤️

chrome bay
lime echo
charred island
#

kind of a longshot, but does anyone know if there's a way to force predictive interpolation from the client to the server?

obtuse field
#

What is the best way to negotiate port for TCP connection?

eternal dune
#

"Negotiate"? What do you mean. Most network connections are sent to a fixed port on the remote and use a random port chosen by the operating system on the local

obtuse field
eternal dune
#

Talking to each other?

obtuse field
#

Nope. I have a server, that is talking to the clients

eternal dune
#

Then yeah, pick a port for the server to listen on and don't try to specify the port used by the clients.

#

Single listen port on a server can handle connections from multiple clients at the same time

obtuse field
eternal dune
#

Yeah. The ports used by the clients are randomly chosen

#

The networking libraries handle that for you. It's not something you do by hand

#

Only the the port the server listens on is chosen by you

ruby lodge
#

when would you use "skip owner" on a replicated variable? I just saw someone handling lethal usage that way that a bool variable "usinglethal" is set to skip owner and he sets it locally and on server seperately right after another. I don't see the sense in this, as it would be much more simple with setting it on the server and then that one sets the repnotify like usual

#

I would only use "skip owner", if it's an info I don't want the player himself to know but setting it on the server and the client both?? Maybe someone can bring light into this xD

#

ChatGPT says this and it makes sense now, if anyone can confirm that this is indeed the best way to handle this, I would be glad!

solar stirrup
#

please don't use gpt vaultsweat

lost inlet
#

"skip owner" is only is relevant server->client, of course the client can set the variable

#

the owning client just won't receive any updates for that variable

rigid steeple
#

How to make the firing player's shot effect be created immediately, i.e. without using the server RPC, while other players get the effect through the server RPC?

#

To make a call to create an actor locally at the same time, and via RPC, it will not work, since the actor will simply be created 2 times

ruby lodge
ruby lodge
rigid steeple
#

How is that?)

ruby lodge
#

maybe a multicast that checks that it's not the owning client at the start of it

rigid steeple
#

I have literally done the same thing now, but it doesn't work

#

I also tried to pass ACharacter, which started the script execution, but it doesn't work either

ruby lodge
#

what part doesn't work

latent heart
#

What's the best way to determine a listen server's own player state?

lost inlet
lost inlet
rigid steeple
# ruby lodge what part doesn't work

If I write !IsLocallyControlled is performed by everyone, and if I write IsLocallyControlled, it is performed only by the client who launched the RPC

latent heart
#

Nevermind.

ruby lodge
rigid steeple
#

Yes it is. I'm doing a check in Multicast. In this case, the code is executed for all clients

#

And on the server

#

If the check on the server RPC is the same

forest rapids
#

Hi, I'm trying to switch from a floating pawn movement component to the new Mover Character component introduced in 5.4 but I have a BIG issue.

Many of my movement calculation is based on the fact that my base sphere rotates on itself (using a set world rotation atm).

And I can't find a way to Queue a Layered Move that makes my character rotate in place.

Does anyone have an idea ? (or at least some documentation) Thanks a lots ✨

(I may mention that I'm using BP atm 😬 )

floral lagoon
#

Hi!! Is there a way to synchronize multiple VR headsets using a single PC? I need a multi-user experience where people watch the same 360 ​ video..thx for your time

vast kiln
latent heart
#

I found a good resource recently...

#

Not all that much has changed since ue4, I expect.

toxic meteor
#

So I'm trying to save & load character data from an SQL database and can save and load the player location without issue, however for the player rotation, it doesn't seem to want to set the player's rotation.

In the gamemode class I'm doing:

if (Controller->GetPawn()->HasAuthority()) // Ensure it's running on the server { Controller->GetPawn()->SetActorLocation(NewLocation); Controller->GetPawn()->SetActorRotation(NewRotation);
However, it is only setting the location and nothing happens for the SetActorRotation.

So my question is, how do you set the player character's rotation (not the camera since this is 3rd person) in a replicated environment?

#

For reference here is the entire function responsible for loading the location:
`void AMainGameMode::LoadPlayerData(const FString& JsonResponse, APlayerController* PlayerController)
{
if (AMainPlayerController* Controller = Cast<AMainPlayerController>(PlayerController))
{
if (FJsonObjectConverter::JsonObjectStringToUStruct(JsonResponse, &Controller->PlayerData))
{
FVector NewLocation(Controller->PlayerData.xloc, Controller->PlayerData.yloc, Controller->PlayerData.zloc);
FRotator NewRotation(Controller->PlayerData.pitch, Controller->PlayerData.yaw, Controller->PlayerData.roll);
// Log the values being set
UE_LOG(LogTemp, Warning, TEXT("Setting Player Location to X: %f, Y: %f, Z: %f"), NewLocation.X, NewLocation.Y, NewLocation.Z);
UE_LOG(LogTemp, Warning, TEXT("Setting Player Rotation to Pitch: %f, Yaw: %f, Roll: %f"), NewRotation.Pitch, NewRotation.Yaw, NewRotation.Roll);

        // Set the actor's location and rotation on the server
        if (Controller->GetPawn()->HasAuthority()) // Ensure it's running on the server
        {
            Controller->GetPawn()->SetActorLocation(NewLocation);
            Controller->GetPawn()->SetActorRotation(NewRotation);

            // Log the final values
            UE_LOG(LogTemp, Warning, TEXT("Final Player Location: %s"), *Controller->GetPawn()->GetActorLocation().ToString());
            UE_LOG(LogTemp, Warning, TEXT("Final Player Rotation: %s"), *Controller->GetPawn()->GetActorRotation().ToString());
        }
        else
        {
            UE_LOG(LogTemp, Warning, TEXT("Pawn does not have authority to set location and rotation."));
        }
    }
    else
    {
        UE_LOG(LogTemp, Warning, TEXT("Unable to convert JSON to UStruct for PlayerData"));
    }
}

}`

past flicker
#

Is listen server worth doing? What's the downside to emulating "listen server" by firing up a local dedicated server? Having a player that is server is complicating some code.

lost inlet
#

how is that "easier" than having a listen server?

#

complicated what code?

lament flax
#

i want to run some logic in HUD when the Pawn exists, and some other logic in HUD when the gamestate exist

to be sure to have the Pawn existing for the HUD, i made the Pawn get the HUD on Posses/when the controller is replicated to client

but for clients i get a race condition where the gamestate doesnt exist (which is weird ?), how would i know when the gamestate exist ?

fossil spoke
lament flax
#

i guess thats my ticket

#

didnt thought about that 🥲 , thanks

dark parcel
#

If I need to have a unique id for a projectile or damage to be send over the network. Is Guid the right choice?

fossil spoke
dark parcel
#

Guess I can just associate projectile with the caster so the client can just generate its own int and increment it self

lament flax
#

now for some reason in my controller, on beginplay, the Enhanced Input Local Player Subsystem is null

glad robin
#

Real dumb question, but I can't think of a scenario right now. Can anyone give me a specific scenario with a ReplicatedUsing/OnRep function where they take in the old value (parameter) and use it. I know it can be done, but I haven't used it and cannot think of when I would want/need to haha (I don't need code or anything, I'm just going crazy overthinking it trying to think when I would want it).

cobalt notch
past flicker
cobalt notch
past flicker
#

Exactly

#

Whether the server is localhost or not, I can reuse the same code. My intent is to have dedicated servers anyway.

cobalt notch
#

If you need to do smaller serverless games then do listen server (extra coding complexity), otherwise just do dedicated server (extra setup / costs). I'm not sure how well listen server works but maybe okay for co-op situations or RTS but they have to be short matchups because if the listen server disconnets it's game over for everybody.

modest crater
#

Thats just one example

#

There is a reason its optional to take the old param, sometimes you need it, sometimes you dont

glad robin
opaque forge
#

What's the best way to get a repnotify when a replicated array is updated? (cpp)

#

I've heard conflicting things.

modest crater
#

Best way is to use FastArray because you get events for elements being added and removed

#

Otherwise you just get OnRep my array has updated, not telling you what in particular

opaque forge
#

That's all I need

#

It's 4 elements

modest crater
#

Then use a regular array?

#

If its only 4 elements what was the question about?

opaque forge
#

Does RepNotify work when arrays are updated?

modest crater
#

Yes.

opaque forge
#

oh

#

lol

#

I thought it was more complicated for some reason

modest crater
#

You might have network timing dependency issues depending on what the array elements are, like an array of Actor* might not all be resolved when your arrays OnRep is called, I only mention this because the more elements of that type in an array that need to be network addressable, the more dependencies you create, it can be a pain and something to be aware of, its really on race condition stuff when a late client joins or whatever and we're in the middle of everything being setup and mapped locally (the NetGUIDs, and local spawning of the replicated actors etc)

gray sparrow
#

i bought a map/level

#

but when i move a single mesh the whole foliage scale up and get destroyed.

#

what can i do?

harsh lake
#

I'm trying to enable and disable iris at runtime.

following the documentation here.
https://dev.epicgames.com/documentation/en-us/unreal-engine/introduction-to-iris-in-unreal-engine
said i can toggle it with the command line.

but do i need to call it for both dedicated server and client. or calling it on a server would suffice
is there any additional setup that need to be done before switching ?

Epic Games Developer

Iris is an opt-in replication system for Unreal Engine. Iris supports robust multiplayer experiences with large interactive worlds and high player counts.

warm sparrow
silent valley
warm sparrow
silent valley
warm sparrow
#

given that the dedicated server part of the game wont be too complicated, it should be doable right? I have a cs degree as well but not much experience in web services tho

polar iris
#

Simple question about initializing a reference to my PlayerController in my BP_Player class. On begin play I call an event that casts to my PC class and stores it as a reference. This seems to work for the Server and Client player, however when I print the reference on tick just to verify the values I see it alternating between the correct references and null values... Why might this be happening?

silent valley
# warm sparrow so basically my game is a 2 player russian roulette type game similar to bucksho...

The dedicated server part sounds simple, but there's a whole load of work you need to do to just make a dedicated server, including downloading and building the engine from source. See this link for example: https://aws.amazon.com/blogs/gametech/unreal-engine-5-dedicated-server-development-with-amazon-gamelift-anywhere/

But given your current design doesn't require lots of state that needs saving/syncing when host migrates (this is the difficult bit of host migration), maybe you could use the Host Migration plugin. At the very least it should be fairly automatic in keeping players together when a host disconnects.

silent valley
polar iris
#

I'm testing on a listen server. The purpose is to store a reference to the pawn's PC so that I can update widget values for each player.

#

It appears to be working when I test it and update widget values for both the server and client, but I also get "Accessed None" errors to the PC as well.

silent valley
polar iris
#

Okay, so this would be normal to see? The way I understand it is that Client should always show a non-null reference to the PC when printing it out, however the server should show it's reference when printing from the server and null when printing from the client. Thanks for bearing with me, new to multiplayer concepts so just trying to clear them up.

dark parcel
glass crescent
#

Hi guys,
I need a help for multiplayer.
On Joining the session , it loas the level which is open in host,
What is happening, i am just changing the UI on creating the session .So on joining the session , it reloads that map again on success

#

so is there a way to stop that auto reloading and will it impact the replication of the variables

quiet fjord
#

LogWindows: FPlatformMisc::RequestExit(1, WindowsPlatformCrashContext.EngineUnhandledExceptionFilter) Does anyone know why I get this error on my dedicated server and it kicks out my players?

timid galleon
#

Hi guys, now I will describe the logic of what I would like to implement on Blueprints, the images will be attached below, but when you click on a given button in my case h, the sequence starts playing from the beginning on the client despite the specified start time relative to the server

The logic of what I want to do:

I need to organize the possibility for me to start a sequence on the server (in my game), for example, 5 minutes pass, and a player connects, he presses a button on the keyboard, after that a request should go to the server (to my game) to get the active time of the sequence (in our case, as mentioned earlier, it is 5 minutes), the sequence starts on the client

p.s sorry for my English😸

lost inlet
quiet fjord
#

I'm checking it in my logs and due to lack of memory it is not

#

I'm using gamelift

lost inlet
#

well you'll most likely get a crash dump

#

and a log file with a stacktrace if the server had debug symbols

quiet fjord
#

yes I am reading it directly from the server log that I have access to

#

[2024.07.31-10.37.41:090][ 8]LogWindows: Could not start crash report client using ../../../Engine/Binaries/Win64/CrashReportClient-Wi
[2024.07.31-10.37.41:090][ 8]LogMemory: Platform Memory Stats for WindowsServer
[2024.07.31-10.37.41:090][ 8]LogMemory: Process Physical Memory: 232.42 MB used, 248.76 MB peak
[2024.07.31-10.37.41:090][ 8]LogMemory: Process Virtual Memory: 162.27 MB used, 184.95 MB peak
[2024.07.31-10.37.41:090][ 8]LogMemory: Physical Memory: 2318.04 MB used, 1521.57 MB free, 3839.61 MB total
[2024.07.31-10.37.41:090][ 8]LogMemory: Virtual Memory: 2675.11 MB used, 2572.50 MB free, 5247.61 MB total
[2024.07.31-10.37.41:090][ 8]LogWindows: FPlatformMisc::RequestExit(1, WindowsPlatformCrashContext.EngineUnhandledExceptionFilter)
[2024.07.31-10.37.41:090][ 8]LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3, WindowsPlatformCrashContext.EngineUnhandledExcepti
[2024.07.31-10.37.41:090][ 8]LogCore: Engine exit requested (reason: Win RequestExit)

lost inlet
#

well that still doesn't say anything

#

but yeah, it's a crash

stark nova
#

hey everyone. I have a VR session and I want to have the user's movements replicate to the server. Since VR updates the position of the player every tick does that mean I also need to send player transform updates to the server every tick as well?

latent heart
#

Use an unreliable rpc. And sure?

stark nova
#

Thanks friend. Just didnt feel like the right solution but I guess its fine

lost inlet
#

it is, but you might want to rate limit it unless absolutely necessary

latent heart
#

Sending it every other tick or every few hundred ms maybe? Just smooth it on thr server.

stark nova
#

Yeah my concern was about sending too many packets

latent heart
#

Unless it's some kind of mobile game, you're probably fine.

#

What you should do, though, is profile it and find out.

crisp shard
#

when it comes to hosting dedicated servers using EOS does anyone have any recommendations on online hosting services so i can have a server running bascialy 24/7

willow gale
#

Does anyone have a clue why I can't connect to a server in PIE (after 5.4) upgrade. Working fine in builds but tring to connect in PIE, I get this error and the client disconnects:
[2024.07.31-18.43.10:537][409]LogNetTraffic: VeryVerbose: SetChannelActor: ChIndex: 5, Actor: BP_Locke_C /Game/Wildcard/Maps/Arenas/FrostBurn/UEDPIE_1_FrostBurn.FrostBurn:PersistentLevel.BP_Locke_C_0, NetGUID: 22
[2024.07.31-18.43.10:537][409]LogNetTraffic: CreateReplicator - creating new replicator for (0x00000481B6BED800) BP_Locke_C_0 - Replicator (0x00000481BA55FDC0)
[2024.07.31-18.43.10:537][409]LogOutputDevice: Warning:

Script Stack (0 frames) :

[2024.07.31-18.43.10:538][409]LogOutputDevice: Error: Ensure condition failed: false [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Serialization\BitReader.cpp] [Line: 276]
FBitReader::SetOverflowed() called! (ReadLen: 100, Remaining: 43, Max: 264)

[2024.07.31-18.43.10:538][409]LogStats: FDebug::EnsureFailed - 0.000 s
[2024.07.31-18.43.28:905][409]LogNet: Error: ReadFieldHeaderAndPayload: Error reading payload. Object: BP_Locke_C /Game/Wildcard/Maps/Arenas/FrostBurn/UEDPIE_1_FrostBurn.FrostBurn:PersistentLevel.BP_Locke_C_0, OutField: bReplicateMovement
[2024.07.31-18.43.28:905][409]LogNetTraffic: CreateReplicator - creating new replicator for (0x00000481B3A52800) CharMoveComp - Replicator (0x00000481BA55FCE0)
[2024.07.31-18.43.28:906][409]LogNetTraffic: CreateReplicator - creating new replicator for (0x00000481B3A51400) CharacterMesh0 - Replicator (0x00000481BA55AC60)
[2024.07.31-18.43.28:906][409]LogNetTraffic: CreateReplicator - creating new replicator for (0x00000481BCD81880) MyForceFeedback - Replicator (0x00000481BA55B6E0)
[2024.07.31-18.43.28:906][409]LogNetTraffic: CreateReplicator - creating new replicator for (0x00000481BCBC9300) MeleeBox - Replicator (0x00000481BA55B980)

frosty cradle
#

Hi guys!
I have a question, what is the best way to handle when a user is disconnected due to a client error or internet failure...
How can I test this? I did a test by calling the Disconnect command but this does not throw any EventNetworkError. When this happens, is the user removed from the Session or Lobby?

limber gyro
#

he should be removed when he times out i think

frosty cradle
#

I also tried closing the application but it still does not generate any error, although it does disconnect the user from the session. Shouldn't that event be called there?

limber gyro
#

it might be detecting ur closing

frosty cradle
steep wolf
#

has anyone added subobjects to multiple components? i want to basically have a "public" list of some subobjects that is replicated to all players

#

not sure if the idea is sound or if there is some gotcha

limber gyro
#

is login called before or after InitNewPlayer?

twin juniper
#

How can i make a template for a predicted variable?
Like the end goal is:

UPROPERTY(Replicated)
int A;
void SetA(int InA);

where SetA will set A predictively in client, then send a server RPC to set A on server as well

#

Maybe i need to do macro lambda stuff? Auto generate server RPC definition?

#

This is either a normal idea with common solution or a really bad one

#

Oh, i see how GAS did it, they just use the same function

#

No wonder we can't input complex data into abilities

fossil spoke
#

Prediction is simply the Client applying the same operation as the Server, with the expectation that the Server will accept the outcome of that operation.

#

If the Server rejects it, then the Client miss predicted and should be corrected.

twin juniper
#

yeah i im just trying not to have a bunch of same function declared

UFUNCTION(Server, Reliable)
void SetA(int InA);
UFUNCTION(Server, Reliable)
void SetB(int InB);
UFUNCTION(Server, Reliable)
void SetC(int InC);
#

like somehow make a template for all of them

fossil spoke
#

Why do you need so many individual RPCs up to the Server for different integers?

#

You cant wrap UMacros inside of Macros.

#

UHT cant see them

twin juniper
#

Yeah i wont do macro, ill probably make one function that is able to send each of my enum

fossil spoke
#

What are the enums for that the Client needs to pass them to the Server?

twin juniper
#

my state enums, for blocking, attacking and animation display stuff

#

i just need a way to differentiate my enum, like put them in an array or map

#
UFUNCTION(Server, Reliable)
void SetEnum(int EnumIndex, int Value);
fossil spoke
#

Seems like a very strange approach. If you are using GAS, those things would typically be Gameplay Abilities bound to Inputs, of which the Server will be notified of their Activation and thus run them as well, allowing the Server to understand what State changes need to happen indirectly.

twin juniper
#

I use both GAS, GameplayTag and those Enum. Any ideas how should i deal with enum index data?

fossil spoke
#

No...

lament flax
#

Begin play should be called on Client right ?

#

on my second PC (the client 1 one), i only have a call on LS

fossil spoke
lament flax
#

well i dont get any breakpoint hit on my client

twin juniper
lament flax
#

im not using OSS

fossil spoke
#

What Actor is that?

twin juniper
#

well is it engine code anyway?

lament flax
#

a beginplay call is somewhat missing

fossil spoke
#

So that BeginPlay node in Blueprint is from a PlayerController?

lament flax
fossil spoke
#

Did you forget a call to Super::BeginPlay?

lament flax
#

BeginPlay isnt implemented in my child classes

#

and if i did forgot the Super call, woulnt that make 0 calls to BeginPlay ?

fossil spoke
#

Typically missing calls into Blueprint like this are due to forgetting a Super

#

Start with the most common cases.

#

Thats all.

lament flax
#

i am not implementing Beginplay in my BP subclass

fossil spoke
#

What do you mean? You clearly have a node BeginPlay

lament flax
#

i got :

  • APlayerController
    • ACorePC <- beginplay implemented here
      • AGamePC
        • BP subclass
lament flax
fossil spoke
#

🤦

lament flax
#

should of told it more clear sorry

fossil spoke
#

What is the current code you are having issues with

lament flax
#

no calls on client side of my PC_1
resutling in no LocalSS found

#

this is my curent code

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


    AddStartupMappingContexts();
}


#pragma endregion


#pragma region Core

void APGCorePlayerController::AddStartupMappingContexts()
{
    if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer()))
    {
        for (auto& IMC : StartupInputMappingContexts)
        {
            Subsystem->AddMappingContext(IMC, 0);
        }
    }
}
fossil spoke
#

So breakpointing AddStartupMappingContexts(); in BeginPlay does not get hit?

#

Is that what you are saying?

lament flax
#

yes

#

i even added a breakpoint in BeginPlay in APlayerController and have the same results

#

it this could help, the BP code was working fine until i moved my GM stuff into cpp
in this stuff, i changed the ChoosePlayerStart method behavior as well as the choosing of the defaultpawn

fossil spoke
#

Did you override any functions in the GM?

#

That you forgot to call Super in?

lament flax
#

InitGameState, PostLogin, ChoosePlayerStart_Implementation, GetDefaultPawnClassForController_Implementation

#

the first two calls super

fossil spoke
#

Verify you called Super for all those functions

lament flax
#

i dont want to act like i know better (because i am not), i just want to understand :

whats the point of calling the super of ChoosePlayerStart_Implementation and GetDefaultPawnClassForController_Implementation since i am myself chosing the playerstart and pawn class ?

fossil spoke
#

There isnt much, just want to make sure you are verifying calls to Super lol

#

InitGameState and PostLogin are important

#

Why are you overriding those?

#

Can you post the code

#

For them

lament flax
#
void APGCoreGameMode::InitGameState()
{
    Super::InitGameState();

    CoreGameInstance = Cast<UPGCoreGameInstance>(UGameplayStatics::GetGameInstance(GetWorld()));
}

void APGCoreGameMode::PostLogin(APlayerController* NewPlayer)
{
    Super::PostLogin(NewPlayer);

    if (CanStartGame())
    {
        StartGame();
    }
}
fossil spoke
#

Have you tried closing/recompiling the Editor?

lament flax
#

mutliple times

#

got this since yesterday night

fossil spoke
#

Missing calls to BeginPlay mean you have done something wrong

#

Its just a matter of finding it

lament flax
#

yeah ik im the one with an issue

#

not causing the engine

#

i checked for all actors on Client 1 and i didnt saw PC_1

fossil spoke
#

You do realize that there should only be 1 PC on the Client?

lament flax
#

🥲

#

so PC_0 and PC_1 are only on LS

fossil spoke
#

Yes

lament flax
#

and "PC_1" would "be" PC_0 on the client

fossil spoke
#

Yes

lament flax
#

i need to got to sleep

#

for forgetting such basic MP design

fossil spoke
#

PlayerControllers only exist on the Server and the Local Owning Client

lament flax
#

but i still have a null SS :/

fossil spoke
#

🤷

lament flax
#

another issue i guess

#

local player is weirdly named when LS tried to get it on PC_1

fossil spoke
#

Its a pointer, pointers point to a memory address, so IpConnection must be in the memory address that the Player pointer is pointing to.

lament flax
#

okay, im asking because it wasnt named like that for PC_0

pine cedar
#

Can anyone help me with delay? When I attack while simulating netlag theres a huge delay(noticable at 50 ping) . Is it possilbe to locally predict damage on client?

vagrant grail
#

How hard is it to make a game like Chained Together ?

ivory halo
#

Hi, Im facing an issue here :
I'm trying to "send a session to another one".
Let me explain : take Dead By Daylight as an example, you can have a friend lobby, private, and when everyone is ready, they are both sent to the true "public" session/server.
So all good, i just need to search for a public session with the server on the friend lobby, repicate it to the clients, and make everyone destroy session and join the new one.
But nope, I tried everything, every way possible, from the gamemode, to the gamestate, it is impossible to replicate the session search ID to the clients, it always returns to null for them.
So is there a way to make that "session switching" possible ?

#

(BP btw)

willow adder
vagrant grail
upper lodge
#

Hey, I have this issue where my InteractableActor works on server, but won't ever trigger on Client, and I have no idea what am I doing wrong

I have InteractableActor, and it is called through my InteractionComponent. Everything is replicated, however it seems like whenever the Client gets to the part of the code that is supposed to call ServerInteract, it stops. To provide some context, Player (which is replicated), using InteractionComponent(which is replicated) gets the CurrentInteractableObject, which then I use to trigger the Interact() function. When I trigger this Interact function, it calls ServerInteract after checking if something HasAuthority or not. From what I understand, the HasAuthority() ifcheck automatically should somehow tell the code that if someone doesn't have authority, he should just tell the server to call this function, and if it is the server, this just calls the function. I cant fully understand this concepts.

#

here, for some context:

willow adder
vagrant grail
fossil spoke
cobalt notch
fossil spoke
#

It wouldnt be driving the limitations.

cobalt notch
fossil spoke
#

Id argue there would be an underlying system done with something like traces that manages that.

#

It would be to expensive to replicate the chains themselves

cobalt notch
#
The chain is not just a visual element. It is governed by a physics simulation that allows it to wrap around platforms.```
fossil spoke
#

🤷

cobalt notch
#

Maybe the chain is not replicated but it's averaging client movements and simulating the chain on clients or something like this would be more logical.

willow adder
#

@cobalt notch something like this

cobalt notch
#

Yeah but how to replicate all those characters and chain smoothly is what we're wondering. Must be some trick to this.

willow adder
#

I hope we go not out of Topic

cobalt notch
#

It's one of those things you can just build out the chain and characters and then optimise later if it's too heavy, this game doesn't look too smooth so maybe he's just winging it.

vagrant grail
cobalt notch
fossil spoke
#

Depends if they are also applying server authority to their positions

cobalt notch
#

Yeah like the characters will autocorrect anyways and fix the chain

fossil spoke
#

Could be allowing Clients authority over the simulation.

cobalt notch
#

and you do not need to know if its tight either, two people moving in opposite directions in a tight chain, just allow both, they'll push and pull each other and be back to square 1

fossil spoke
#

Those types of games dont typically care much for cheating

#

Its not like its a competitive shooter

willow adder
cobalt notch
#

Okay maybe this is not gonna work, just replicate the chain on all the clients 'cos this game doesn't really have much else. Otherwise partly client driven to make this faster because cheating is not an issue.

#

The server does all the movement and handles the chain and the clients just see the replicated results of this.

willow adder
#

Interesting we learning here very good stuff @cobalt notch

cobalt notch
#

The endpoints of the chain are the characters themselves so I mean this replication can be avoided but one would have to plan this sort of thing properly. Whereever character is the chain endpoint is the there, the rest of hte chain doesn't really matter, and physics should be handled automatically whether the chain is replicated or not it's still tied to them.

vagrant grail
#

Look at this mechanic

cobalt notch
willow adder
#

Just my Question, I have a Level when i want spawn my Character Class my Gamemod have this Class , it just working correct when this class is already in the Level , then it spawns 1 on the Server and 1 on the Client side Automatically. Then i destroy the one in the level via Level BP. Do you think it is Correct (Listener Server) @cobalt notch

cobalt notch
willow adder
#

But i use just 1 Class does it matter

cobalt notch
willow adder
#

Ok thanks , Men really the problem is everytime MP Games will not so complicated if you can have 2 Classes one is the Server one is the CLient , what you think about , sorry is a silly Question

cobalt notch
willow adder
#

This brings me more light inside MP Games , thanks

silk abyss
#

I hope I am not asking something stupid, so how do most people handle things like continuous inputs( ie. like looking around, car throttle) when axis value that just keep updating every frame.

fossil spoke
#

Can you elaborate or restate your question in a different way?

silk abyss
#

so currently, I do this. InputAxis-> RPC run on server -> RPC update the server pawn.

#

but I kinda feel this is sort of not the right way to do it. shouldn't there be a more straight forward way like
Input Axis-> update some variable that only I should be changing-> server somehow get my updated variable, run the logic then replicate the to the rest of clients.

fossil spoke
#

There isnt anything inherently wrong with sending an RPC every frame

#

Especially if its input axis related

silk abyss
#

as replication only go from server to client, what's the basics for sending updates to server, without stacking so many rpc calls. (as we can have so many buttons and controls, on/off or axis doesn't matter. )