#multiplayer

1 messages ยท Page 157 of 1

hot estuary
#

good job on it too

quasi tide
#

Vori is in that 0.1% that I left out for safety ๐Ÿ˜…

pallid mesa
#

:v

tiny pier
#

fixed, changed the bIsAwaitingSlideJump in a function that wasnt replicated

glad robin
#

So I have APawn golfball with a projectile movement component on it. After the ball is hit the player possesses the ball as it flies through the air. This works perfectly on the server, but on the clients the ball will freeze in the air once possession changes, but only on the clients side, Server continues to see ball moving. Once the ball comes to a stop then the player is moved to the ball for the next swing. Anyone know what exactly is happening here

summer tide
#

WHich config do I use if I want the client to have more time to join the host? Is it InitialConnectTimeout?

thin stratus
glad robin
thin stratus
#

And those are tied to you possessing the Pawn, or is the Camera the only thing you gain from this?

#

Cause for the Camera, all you need to do is set the ViewTarget to the Ball

glad robin
#

Possessing the pawn

thin stratus
#

I'm unsure if you can do it like that. If the Clients remain stuck, then it's probably the ProjectileMovementComponent that is not liking the idea of being used on a possessed pawn

glad robin
#

Yea I could see that being an issue. I was gonna think about it more but not work on it I gave up for the night haha

thin stratus
#

I would consider just not having the ball be a possessable pawn.

#

I would probably have a setup where:

  • Ball is an Actor, owned by the Client (so Character/Controller set as Owner on the Ball when spawning)
  • When the Ball is shot, either set the ViewTarget on it, or you can use the PlayerCameraManager to set and control the Camera the way you want when the ball is flying
  • If the Ball has any sort of Abilities that it can execute, I would just route those from Character to Ball, while the ball is moving
karmic trellis
#

hello, when I try to possess on host&play the client can play with pawn but server cant trigger this IA_move what should I do for this? -all another things working on pawn for server and clients-

mystic zodiac
#

I have. a question, i use th GoodSky Plugin for my multiplayer mod and on Editor it have a day night cycle whitch switch skycolloer from black to red to blue to red to black. Like day nighte and sunset. but ingame (on client) it is not shown. the plugin uses a dynmic material instance to do that stuff and i had in passt trubble with replicating/multicast that material instances. I have two kinds of npc both has a dynamic material instance to change collor red if they where hit by player one is shown on client one dont and its exactly the same code inside the npc so i think its a problem with the actor settings

tulip oyster
#

LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_Character_Player_Sword_C_1. Function OnTakeDamage_Server will not be processed.

get this warning only dedicated server after open 127.0.0.1
if listen server not have a problem.
It's like the network is unstable.

#

I tried to use hasauthority() but it's not always true when connecting on Dedicated.

thin stratus
thin stratus
#

I also don't see why the code you posted would even have a ServerRPC

#

As Damage should only be handled on the server to begin with

karmic trellis
#

didnt changed

thin stratus
#

And in what function

karmic trellis
#

sorry I didnt get it but looks like this

thin stratus
#

You can't do that in BeginPlay

#

BeginPlay doesn't make sure that the Character is Possessed

#

Thus not ensuring that you have a controller

karmic trellis
#

oh u asking possess?

thin stratus
#

Also it calls on Everyone

#

No

#

I mean the IMC stuff

#

That can't be in BeginPlay

#

Override the "OnControllerChangedEvent"

#

Limit it to "IsLocallyControlled" with a branch

#

And then do the IMC stuff there

tulip oyster
#

i try change to HitTarget->TakeDamage and call to server RPC

#

but HasAuthority Not always true causes the function to not work.

#

It is alternately true and false, uncertain.

thin stratus
#

@tulip oyster There is no need to call a ServerRPC when HasAuthority returns true

karmic trellis
#

@thin stratus ๐Ÿคฏ thank you its working now

tulip oyster
thin stratus
#

If it's false, then that's not cause it's "uncertain"

#

You are simply doing something wrong

tulip oyster
#

Yes, but it happens when connect open 127.0.0.1

#

You'll notice that it has a range that doesn't enter HasAuthority.

#

on listen server is alway true

#

It's a problem I'm very curious about. What causes it?

slim jay
#

Can i implement network roleback for UE 5 without c++

tulip oyster
#

maybe Players haven't finished spawn it yet, but the UI is already starting to build.

tulip oyster
#

this not have a problem . i get problem after join open 127.0.0.1 On dedicated server

nocturne fiber
#

Guys I have a big problem with my game template : it's a 2 player game and have a server side and a client side, the problem is that the generation of card in play is different from player views, i want the same generation of card material for both player and cannot understand where to touch.
someone can suggest a tutorial or an approach?

chilly haven
#

Is it possible to swap out an APlayerController for an AAIController for a connected client?
This is for the purposes of having a client exe driven by AI, for testing/automation purposes.
Right now I am retaining the APlayerController and adding an AAIController but if I can replace it that would be better.

#

I presume not possible?
/** The class of PlayerController to spawn for players logging in. */
UPROPERTY(EditAnywhere, NoClear, BlueprintReadOnly, Category=Classes)
TSubclassOf<APlayerController> PlayerControllerClass;

chilly haven
#

Ok thanks for confirming @thin stratus

warm shoal
#

Hey everyone, I'm new to multiplayer games, but I have a question. If my game has a similar number of users to 'Escape the Backrooms,' which server services should I consider using?

meager spade
#

anyone ever seen this?

fringe escarp
#

Hi everyone! I'm building a multiplayer game where players are located in a spaceship. Spaceship traverses the world and can be controlled by players. Ship can hit various obstacles, like asteroids, which would damage it. Apart from that, the rest of the world is mostly just a background, so neither players nor ship don't interact with it. So I have a dilemma, that I feel will influence the whole project architecture: should I move the ship around the world and setup proper network replication for it (based on my knowledge just using existing Movement Component replication wouldn't be enough for that) OR should I actually just keep ship static but rather move the whole world around it (which feels like it will heavily simplify replication for the ship itself, since it essentially will be static, but I have no idea how to move the whole world + clients still may have some troubles avoid asteroids hits if world movement will be laggy). I've been trying movement replication for something simple like moving platform, and it was quite laggy... Could you suggest which approach would be the best? Also if someone can point me to some materials to learn about it, it will be greatly appreciated. Thanks in advance ๐Ÿ™

magic vessel
#

I'm trying to plan out a level editor in my game. I'm not sure how to make it so that these levels can be played in a multiplayer manner

warped oxide
magic vessel
#

I mean the players being able to create their own levels and be able to play their own sessions using their own custom levels

quasi tide
warped oxide
#

Does anyone know what this error means? I have an actor that's like a vehicle that I possess. On the client, after going ~30k units away from player start it deletes the vehicle but not the player riding it. This doesn't happen to the server though, they can go farther just fine

meager spade
#

This is relevancy

small pasture
#

Hi everyone, I have been trying to use zerotier so me and my friends can actually play test multiplayer but it for some reason detects the session from clients but then it fails to load the map. I have also tried the lyra project and the same thing happens on it. Does anyone has any idea why that happens or has successfully managed to use zerotier for multiplayer playtesting? I'd appreciate any help, thanks in advance ๐Ÿ™‚

warped oxide
# meager spade This is relevancy

So even when I set the relevancy to "Always relevant" on client and server the actor still gets destroyed after that same distance

warped oxide
#

I figured it out! I was doing this is a World Partitioned level, and the loading range was set to 30k units, so after 30k units it culls tiles. I also had "Is spatially loaded" checked on the vehicle, so when I went out of that 30k range it unloaded the tile and the vehicle even though visually on the client I was in the vehicle.

cedar finch
#

When I servertravel from my game level back to my lobby level, clients in my game crash. My lobby has a different gamemode and player controller than my game levels do. So I have a lobbyGM, lobbyPC, and a GameplayGM and GameplayPC. My project is blueprint only if that makes any difference. Anyone have any solutions?

cedar finch
#

When it crashes its just a tiny white box that says "Fatal Error" nothing else

thin stratus
#

I doubt anyone can help you otherwise

cedar finch
#

You want all of it or just the last part with the fatal error?

thin stratus
#

Usually it's an error at the bottom with a call stack

cedar finch
#

So
EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000240

is the culprit

#

I was digging through forums and saw that you had a similar issue years ago. I just didn't know how to fix it.

cedar finch
#

I know nobody is going to have a magic fix for me, but I was hoping that they could point me in the right direction on what it could be and what that error means. I try reading about it but it says it could be a null pointer or an out of bounds array. So I read up on that too ๐Ÿคฃ and kinda got an idea of what it meant but am still not 100% what I should be looking for

toxic lion
#

All your error is letting you know, is that it's not telling you what's wrong

#

next time your game crashes, you'll get a meaningful error log

cedar finch
#

Will that work even if my project is just blueprint only?

toxic lion
#

yes

cedar finch
#

It'll give me a more human error code instead of gibberish ๐Ÿคฃ

#

I'll give it a shot

toxic lion
#

correct ๐Ÿ™‚

meager spade
#

why iris, why

#
LogIris: Verbose: FReplicationReader::UpdateObjectReferenceTracking Removing unresolved reference NetRefHandle (Id=24):(RepSystemId=?) for NetRefHandle (Id=12):(RepSystemId=1)
LogIris: Error: FReplicationReader::ReadObject Failed to read replicated object with NetRefHandle (Id=12):(RepSystemId=?). Error 'BitStream Overflow'.```
thin stratus
meager spade
#

me with my effect context

#

only assigned 19bytes

#

19bits*

#

when it should be 22bits

#

haha

#

so it overflowed

supple junco
#

Does anybody know for games on the scale of Fortnite, would Epic Games maintain two separate Unreal projects for the server vs client version of Fortnite? Or do they still use just one project and have server RPC calls as necessary (just like all the unreal multiplayer tutorials out there)

meager spade
#

no

#

why would you have 2 seperate projects?

#

thats double the work and a maintainability issue

#

plus it wouldn't play nice

chrome bay
#

Plus the engine/editor provides all the tools you need to strip content from certain types of builds

supple junco
#

Was just curious since in the past when I worked on multiplayer games the server component would always be separate (e.g. in Java). These are much older games and weren't in Unreal or even Unity. So I was just curious if larger games did things differently in Unreal. Good to know!

thin stratus
meager spade
#

yeah

#

iris needs some work

#

this is ridiculous

thin stratus
#

That does look like a lot of unneeded work

#

Is that only cause you aren't replicating all properties? I mean in the normal NetSerialize it wasn't too much different if you wanted to only serialize some properties

#

Still very manual I gotta say

#

-.- and I have to use Iris and Mover soon

chrome bay
#

ye serializers are much more involved now

forest bolt
#

Hey! I'm reviving a quite old thread, but I really need some guidance over this matter. After reading engine code and determining that existing code wouldn't fit my use cases, specially given that USocialManager::CreateParty makes use of an interface that doesn't have implementations (OnlinePartyInterface), which I figured out only Epic has probably on fortnite, I implemented my own party system using beacons.

I've been working on it for quite some time and it's basically feature complete with leader delegation and proper handling after travelling from menu to a game session (because beacons are destroyed, so I recreate them and I keep the party alive in between travels).

However, I've come to a point where I need to implement VOIP. I'm currently using EOS and voice works perfectly in my dedicated servers and in NAT P2P lobbies. From my understanding of EOS Voice, clients are not able to create voice rooms (due to policies), BUT they are able to create lobbies which have voice rooms attached to them. So I've come up with a few points:

  • A initial thought is simply creating a session in the main menu without travelling just to use the created voice room, but this doesn't sound quite right.
  • Another idea would be to tie (somehow) EOS lobbies with beacons, but I have no idea how to do that (maybe using the C++ SDK directly?).
  • A third idea is to leverage my backend to create the rooms there with EOS Web API and distribute the voice tokens to the party clients. This sounds clean, but imply few extra backend costs to manage the parties.

What do you think of these? Any other suggestions are welcome!

thin stratus
#

I will have to read that later. Working atm.

#

--

Having an annoying bug. Is it expected that the MoviePlayer-based LoadingScreen is preventing Session Callbacks (such as UpdateSession) from coming back when using Steam?

forest bolt
thin stratus
#

I know that there is a bAllowEngineTick param, which seems to work fine for the GameThread, but I assume that UpdateSession ultimately runs on Steam's Thread and that is not ticking while the LoadingScreen is active.

#

Basically my Client is trying to hide the strange "nothing is happening" while updating the Session, before traveling, with the proper MoviePlayer LoadingScreen, yet the UpdateSession call never comes back.

#

Which makes me believe the Thread is sleeping

#

How do I stop the LoadingScreen from blocking the Steam Thread

#

I already see myself coding a Blocking vs non-Blocking LoadingScreen

#

sigh

thin stratus
#

I guess since the GameThread is stuck in that While loop of the MoviePlayer, it never gets to the point where it allows other threads some processing time

#

I will have to create two loading screen systems ffs

cedar finch
#

Well I waited a few hours for my project to open and then package after enabling "Editor symbols for debugging" but after the crash it still has the same thing in the log. Nothing different. So I guess I'll just have to dissect the Lobby tomorrow to try and figure out what "EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000240 "
means

magic vessel
#

Try playing it in the editor, in standalone mode

cedar finch
#

Will server travel work when doing that?

#

I'll give it a try

#

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000320

UE4Editor_AdvancedSessions!UAdvancedSessionsLibrary::GetNumberOfNetworkPlayers() [d:\documents\unreal projects\vrexppluginexp\compplugin\pluginstaging_all\ue4_427_as\hostproject\plugins\advancedsessions\source\advancedsessions\private\advancedsessionslibrary.cpp:529]
UE4Editor_AdvancedSessions!UAdvancedSessionsLibrary::execGetNumberOfNetworkPlayers() [d:\documents\unreal projects\vrexppluginexp\compplugin\pluginstaging_all\ue4_427_as\hostproject\plugins\advancedsessions\intermediate\build\win64\ue4editor\inc\advancedsessions\advancedsessionslibrary.gen.cpp:57]
UE4Editor_CoreUObject!UObject::execCallMathFunction() [D:\Build++UE4\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:956]

#

I wonder if it's because I'm using the "Get Num Network Players" since it says that about advanced sessions right after the crash

#

I'll take it out. I used it in the lobby so you could see how many players were in ex: "Player 2 of 4" in the top right of the lobby.

thin stratus
thin stratus
cedar finch
#

Sweet! That was it! I removed that from my lobby widget and now it works without crashing. That was just a node from the "Advanced Sessions" plugin. I lazily put it on a binded function for the text in my lobby widget just to show the number of players in the lobby. So I guess it didn't like that ticking. I'll switch to my own logic probably with a dispatcher or something when a player connects/disconnects.

I really appreciate the help. @magic vessel Thanks for the tip about the editor symbols. That 100% pointed me to the exact problem. ๐Ÿฅณ

#

I only use the Advanced sessions plugin because the default sessions node doesn't seem to work on UE 4.27

magic vessel
thin stratus
#
void UAdvancedSessionsLibrary::GetNumberOfNetworkPlayers(UObject* WorldContextObject, int32 &NumNetPlayers)
{
    //Get World
    UWorld* TheWorld = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);

    if (!TheWorld)
    {
        UE_LOG(AdvancedSessionsLog, Warning, TEXT("GetNumberOfNetworkPlayers Failed to get World()!"));
        return;
    }

    NumNetPlayers = TheWorld->GetGameState()->PlayerArray.Num();
}
#

What an ugly function it is

#

All this does is return the PlayerArray Length

#

And on top of that, it also doesn't properly check nullptrs

#

sigh

#

@cedar finch

cedar finch
#

Lol that's why I hate using other people's code, but I didn't know how to fix the default sessions node in blueprint. Then I just stumbled across that NumNetworkPlayers node and thought it would be useful lol. I was wrong

visual shell
#

Hello all!
Which function can I subscribe to ensure that the PlayerState and its Pawn are initialized?
I've attempted to use the Controller and PlayerState's BeginPlay functions, but GetPawn returns null.

last storm
#

Hey ! I have trouble with seamless travel.
After travel my character isn't moving, like if my character isn't bound to playercontroller, any idea ?
I tried to add this to the "PostSeamlessTravel" but nothing changed:

SetInputMode(FInputModeGameOnly());
EnableInput(this);

(PlayerController->GetPawn() is the right Pawn BUT functions bound to input aren't called)

sinful tree
# visual shell Hello all! Which function can I subscribe to ensure that the PlayerState and its...

Pawns have OnRep_PlayerState() that is called when the playerstate of a pawn is received on clients and you also have OnPlayerStateChanged dispatcher that is called on both server and clients when the PlayerState is changed.

So on Begin Play of the pawn, you can check if the PlayerState is valid.

If so, then you have a working playerstate to work with.
If not, then you can use the above mentioned means to wait until a valid playerstate is received on the pawn.

#

On PlayerState, it has OnPawnSet dispatcher that is called when the Pawn change.
So on Begin Play of the PlayerState, you can check if the Pawn is valid.

If so, then you have a working Pawn to work with.
If not, then you can use the above mentioned means to wait until a valid pawn is received on the playerstate.

visual shell
queen escarp
#

dose this have to be run on server/Rpcรฉd ?

thin stratus
# queen escarp

It has to be OnRep'd actually, cause this doesn't seem like an Actor attachent

#

Yes

silver pendant
#

hey, I have a problem making spawned components exist for new coming clients, like if a client saw it spawned then leave session and join it again, it won't be exist to that client?

thin stratus
#

The better thing to do here is to tell us what you are trying to do.

thin stratus
#

You might need to ensure it's created on both sides.

#

And ensure they are stably named and thus valid for replication.

thin stratus
#

That includes for reconnecting players

silver pendant
#

well the spawn function is replicated so all other clients can see the component spawned successfully

but if one client leave then joined again, the component won't be exist on his side.

solar stirrup
#

Should just use an array of actor components you spawn on the server at runtime

#

And handle registering them on clients in the rep notify

solar stirrup
#

You should use a replicated array

thin stratus
#

How would you register them

#

Cause the spawned Components aren't gonna map to anything locally

silver pendant
#

then I will do spawn each component again when a new client comes in for all, I think

thin stratus
#

The Onrep is gonna give you a nullptr or not

solar stirrup
#

Would need to add to the replicated subobject array

#

Hopefully that's available to blueprints

silver pendant
#

and the components does have a realtime data inside it

thin stratus
#

I don't think it is

#

Available to Bps

solar stirrup
#

Classic Epic

#

If it isn't you're gonna need C++ or to rework how you replicate your runtime components

#

Otherwise could also use actors and attach them on the server

silver pendant
#

I think as a solution is to make it actors

solar stirrup
#

It'd work

silver pendant
#

unreal dosen't replicate components as it does for actors

solar stirrup
#

Personally I don't replicate weapon attachments when I make them actors, my weapon contains data about attachments and clients recreate them locally

solar stirrup
#

I wonder if Epic would accept a PR to expose adding/removing replicated subobjects to Blueprints

silver pendant
solar stirrup
#

Yeah my system is a lot different so it wouldnt work in your case

#

You can just attach the actor, just make sure you cant pick up an attached actor heh

stuck glen
#

I have 2 variables that trigger a function based on the mouse direction, for the player connecting as the Host the "Axis Up" & "Axis Turn" variables work perfectly and trigger the function, but for the player connecting to the session, their "Axis Up" & "Axis Turn" don't update with the mouse direction can anyone help?

woven bramble
#

Guys, what's the difference between 'NetServerMaxTickRate' and 'MaxNetTickRate'? In multiplayer, they are getting a steady 60 FPS, and both values are set to 60. Which one is associated with FPS?

hollow eagle
#

neither

#

the former is the tickrate when running as a dedicated server.
the latter is unrelated to FPS and is how often the replication system itself ticks.

woven bramble
#

Are you sure? They got a steady 30 FPS in multiplayer according to the following values.
[/Script/OnlineSubsystemSteam.SteamNetDriver] NetConnectionClassName=OnlineSubsystemSteam.SteamNetConnection ConnectionTimeout=80.0 bNeverApplyNetworkEmulationSettings=true InitialConnectTimeout=120.0 NetServerMaxTickRate=30 bClampListenServerTickRate=true MaxNetTickRate=30 KeepAliveTime=0.2 MaxClientRate=120000 MaxInternetClientRate=120000 RelevantTimeout=5.0 SpawnPrioritySeconds=2.0 ServerTravelPause=4.0

#

When I did this, the FPS values became 60:
NetServerMaxTickRate=60
MaxNetTickRate=60

peak lintel
#

If anyone is familiar with elldev dynamodb plugin and help me understand why it's not querying 50 rows (from 300) and only 15 rows.
I have GSI called SortPartition-index with PartitionKey SortPartition (= 0. I set it to 0, so it gets all the rows) and SortKey is EndDate. I normally would like to sort after EndDate but my first problem is why I get only some random rows (in this case 15. In case I set the limit to 10, I'll only get 4 rows)

warped oxide
#

So if I'm making a save system, would it be best to first integrate Steam functionality first and then make the system or the other way around

dark edge
#

Doesn't matter unless you specifically need some overlap between steam and your save functionality

thin stratus
#

And also only if that overlap can't be covered by the Subsystem Interface

warped oxide
#

Gotcha, thank you for the help!

thin stratus
modest lark
thin stratus
#

--

Has anyone looked a bit into Mover 2.0 yet?

#

I'm trying to understand some parts, but don't quite get what I'm looking at

#

Specifically the Insights part atm

#

If I click on Frame X (e.g. 80) in the Debugger, I have an Input Cmd of Frame 79, as well as an In Sync from 79 and an Out Sync from 80, with optional Recv Sync from 79.

#

So I'm getting told that in Frame 79, I pressed jump and had velocity and location xyz.
After Frame 80 (Out Sync) the Jump Layered Move is applied, and my Vel and Loc changed.

#

What I don't quite get is how that part reflects in code

#

I would have expected that if I press Jump, that it would show Sim: 80 with the Jump key pressed.

#

Actually, the Engine number matches the one from Sim 80. Maybe this is just misleading

#
const int32 InputFrame = SimTick.OutputFrame - 1;

const FSimulationData::FUserState* InputCmd = InContent.SimView->UserData.Get(ENP_UserState::Input, InputFrame, InContent.SimTick->EngineFrame, (uint8)ENP_UserStateSource::NetRecv);
        
const FSimulationData::FUserState* InSyncState = InContent.SimView->UserData.Get(ENP_UserState::Sync, InputFrame, InContent.SimTick->EngineFrame, (uint8)ENP_UserStateSource::NetRecv);
const FSimulationData::FUserState* InAuxState = InContent.SimView->UserData.Get(ENP_UserState::Aux, InputFrame, InContent.SimTick->EngineFrame, (uint8)ENP_UserStateSource::NetRecv);
#

Not sure that makes sense. Wouldn't the Input be generated in the same frame that the data is changed?

dark edge
#

What's the basic structure of Mover 2.0?

#

a more generalized sequence of moves and corrections?

thin stratus
#

Uff, I can't answer that yet

#

The structure is more modular, fwiw

#

But it's not so easy to look at and learn, when NPP is also somewhat new

#

CMC was simpler to look at

solar stirrup
#

It almost looks like the GMC's setup

#

Code wise

dark edge
#

I wonder why nobody has made a very generic prediction system, for generic properties. There's a lot of similarities between movement and ability and physics etc prediction

thin stratus
#

NPP is that

dark edge
#

it's all variables, boundary conditions, update functions, and dependencies

solar stirrup
#

Isn't that what the network prediction plugin is/wants/wanted to be

thin stratus
#

Yeah

#

There is sadly nothing simple about such a system

#

Especially if you want it to be performant and extendable

#

Mover 2.0 is not using its own code to do prediction etc.

#

In case that helps clarify things

#

Mover 2.0 uses the NPP

#

Unlike CMC and GAS, that build their own stuff

dark edge
#

It seems like there should be a simple solution as a foundation, where things like ability and character movement are extensions or implementations of stuff like "Undo" and "GetDependencies" etc

thin stratus
#

Thing is

#

That is what the Network Prediction Plugin tries to be

#

But there is, again, nothing really simple about something like this

#

It's simple in its theory

solar stirrup
#

No real solution that fits everything

thin stratus
#

But not in its implementation

solar stirrup
#

I should take a look at the NPP but I doubt i'd ever actually use it

thin stratus
#

You can certainly drive GAS through NPP

#

But no one wants to tackle that

thin stratus
#

You gotta at least understand the bigger picture

dark edge
#

That's what turns me off from a lot of this stuff. Say you wanted a project with GAS, Character, and physics. You'd have 3+ prediction frameworks to juggle

#

absolute nightmare

solar stirrup
#

Maybe if I ever get to touch Mover sure

thin stratus
solar stirrup
#

I do wanna take a look at it in the future but atm I'm mostly satisfied with the GMC

thin stratus
#

At least movement

dark edge
thin stratus
#

There are some examples too

#

haven't looked at it yet

#

Still trying to grasp how the normal one works

dark edge
thin stratus
#

Mover plugin folder

#

ue-main fwiw

#

UE 5.5 >.>

#

I mean

#

Mover is part of 5.4

#

But I'm on ue-main atm

#

Casually skipping engine versions

dark edge
#

it seems like it's still super character oriented

thin stratus
#

I thought so too, but they have that same component with the follow spline mode on a simple platform in the scene

dark edge
#

I'm just trying to suss out if anything like this is even a starter for moving huge contraptions made up of individual mechanical pieces around.

#

I don't really think so

#

Mover 2.0 Kerbal Space Program, don't think it's quite feasible yet

cursive steeple
#

Random question, but is this expected to be any lighter on performance (mover 2.0)? CMC kinda dies as soon as you try to scale things up, so is mover a solution for larger scale projects, or do you still have to run your own component/solution?

thin stratus
dark edge
thin stratus
#

Think not even Fortnite uses it yet?

#

I will have to use it soon

#

So I will find out I guess

dark edge
#

I wonder if unpredictable prediction is even an avenue worth trying to go down. The sims are already unpredictable on a single machine as there's so many moving parts

thin stratus
#

I mean, in theory if you ensure it ticks the same amount of times, it should work fine?

#

aka fixed tickrate

dark edge
#

I think that'd work. I wonder how things would work at collisions

#

My physics monster runs into your physics monster. We're both predicting ping ms into the future. What happens, is it possible to do this without rubberbanding all over the place?

thin stratus
#

Isn't this ultimately what games like Trackmania do to ensure that replays etc. are always the same?

#

Ah

#

Yeah that is always a shitshow

#

Like, interaction between 2 predicted sides is never fun

dark edge
#

I think we've got so much code covering it up for characters, and capsule vs capsule is much easier to predict than machine shop vs machine shop

thin stratus
#

In theory NPP should at least ensure that AIs are a bit more approachable

#

I can tell you that Characters with CMC are not fun to collide

solar stirrup
#

GMC solves that by having the default simulation mode be an adaptive delay, you see other players a little in the past

dark edge
#

Doesn't that make it even worse?

solar stirrup
#

ensures the server can mostly always roll them back to what you saw

thin stratus
#

But you see them in the past already

solar stirrup
#

When executing your moves

thin stratus
#

The problem is that you locally predict against something older

dark edge
#

I think the best example of the problem is 2 cars in Rocket League both going for a kickoff

#

each one sees themselves there first

#

so who was first

solar stirrup
#

Nah the server knows where the pawns where when you executed your moves thanks to the adaptive delay

#

So when playing your move it rolls back pawns around you to where they were for you at the timestamp

thin stratus
solar stirrup
#

it does for the GMC

dark edge
#

I think it's solvable to where everyone sees what the server sees, eventually

#

the problem is how to go from winning the kickoff to losing it without seeing the ball slide through space

thin stratus
#

If you have 2 players say something happened that can't have happened on both ends, then the one with the lower ping will win I guess

dark edge
#

yeah i think I'mma stick with no prediction

solar stirrup
#

can't make everyone happy i guess heh

dark edge
#

ping lag bad
everyone seeing the same thing good

thin stratus
#

Prediction is fine, but one shouldn't overdo it

#

You can't predict everything, especially not if there two sides that predict

#

Prediction is nice for stuff that is only about one player

#

E.g. a player reloading their weapon

#

Or moving stuff in their inventory

#

Predicting shots or something like a ball kick will always be the same

#

Client A sees something that is not true for Client B.
Server can now decide if they allow Client As shitty prediction and hit Client B.
Or if it checks where Client B really was and deny the hit.

#

You can see that on for example Dead by Daylight. If you hit a Survivor just while they jump through a window, you might see blood splatter, but no damage. The local predicted was a hit, but the Server gives the benefit of the doubt to the survivor and denies the hit

dark edge
#

yeah shooting is actaully relatively graceful because you can just favor the shooter and it'll usually be pretty nice

#

since it's way worse to mispredict a hit then to mispredict not getting hit, you don't even notice the bullets that don't hit you

thin stratus
#

Yeah if you favor the shooter you favor the peeker iirc

#

It's a fun discussion to be had, but ultimately it's not something people will solve. Not even CS2's "sub ticks".

#

What I would much rather have fixed is that different systems performing prediction working together

#

Especially GAS Attributes that change Movement Speed

#

Bruh, I was wondering why I can't find where bJumpedPressed was set to true

#

Had WriteAccess disabled in the search

#

๐Ÿ™ƒ

#
// -----------------------------------------------------------------------------------------------------------------------------------
//    ProduceInput
//
//    Called on locally controlled simulations prior to ticking a new frame. This is to allow input to be as fresh as possible.
//  submitting input from an Actor tick would be too late in the frame. NOTE: currently input is sampled/broadcast in PC tick and 
//    this is still causing a frame of latency in the samples. This will be fixed in the future.
// -----------------------------------------------------------------------------------------------------------------------------------

#

Ah, there is my missing frame that I was wondering about

#

So the input is in fact from last frame?

#

Half the PlayerController.h is littered with Deprecation for 5.4 already

#

fun times

thin stratus
#

Here, I started documenting this stuff a bit. For whoever cares:

#

But that's it for today. Need some non UE time >.>

dark edge
#

Object oriented programming was a mistake

summer rover
#

What would be a way to let the client join a server with some data (like a gameplay tag) attached to him? Think of like a character selection screen in the main menu (pre-joining a server). The client would join with 'Character.Manny' as his selection.

Is there already a more clever way of handling this?

woven bramble
#

What could be the reason why I get a normal (unlimited) fps in Singleplayer but a fixed 60 FPS in Multiplayer?

#

These are in my config settings:
NetServerMaxTickRate=60
MaxNetTickRate=60

thin stratus
#

@summer rover C++?

summer rover
thin stratus
#

Basically a String you can grab in AGameMode::PreLogin as well as ::Login.

#

Writing AGameMode, cause usually one doesn't use AGameModeBase for multiplayer

#

uh, I just noticed that they added PreLoginAsync

#

Not sure if that's a 5.5 thing

#

But good to know

#

Either way, you have

ENGINE_API virtual APlayerController* Login(UPlayer* NewPlayer, ENetRole InRemoteRole, const FString& Portal, const FString& Options, const FUniqueNetIdRepl& UniqueId, FString& ErrorMessage);

summer rover
#

Ok so that FString& Options is it there i assume

#

was googling for PlayerOptions and couldn't find anything

thin stratus
#

Yeah, I'm looking quickly where you can fill it

#

iirc it's

#

ULocalPlayer::GetGameLoginOptions

#
/** 
* Retrieves any game-specific login options for this player
* if this function returns a non-empty string, the returned option or options be added
* passed in to the level loading and connection code.  Options are in URL format,
* key=value, with multiple options concatenated together with an & between each key/value pair
* 
* @return URL Option or options for this game, Empty string otherwise
 */
virtual FString GetGameLoginOptions() const { return TEXT(""); }
#

That's used in ULocalPlayer::SendSplitJoin in case you wonder

#

That's also where the Name= gets set that you might have seen in connection URLs before

summer rover
#

Cool, I actually figured it was going to be some kind of URL based thing you pass in on connection, but had no idea where these things were done

#

Thanks, I'll explore this

thin stratus
#

Yeah no worries. I had to figure that out some years ago

#

You can turn the Tag into String

#

And back into a Tag in Login

#

I would suggest using Login, cause that gives you the PlayerController to then save it back on

summer rover
#

Yeah, that sounds pretty perfect

thin stratus
#
void AGameModeBase::PreLoginAsync(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, const FOnPreLoginCompleteDelegate& OnComplete)
{
    FString ErrorMessage;
    PreLogin(Options, Address, UniqueId, ErrorMessage);
    OnComplete.ExecuteIfBound(ErrorMessage);
}
#

That is pretty interesting though

#

I could swear that hasn't been there for long

#

I was always wondering how one is supposed to actually perform some sort of Login there

#

E.g. if you want to compare some password or so with your database

#

Nice, it's already there in 5.3 already.

#

Maybe I just missed it all those months cause I didn't expect that to exist

dark edge
woven bramble
#

Sorry.

#

I've tested it again. Only Server's getting a constant 60.

#

so not clients.

woven bramble
#

Solved!
"NetServerMaxTickRate=120
MaxNetTickRate=30"

mental linden
#

I am experimenting with NPP. Going through the examples in the engine plugins. I believe I understood the plugin to some extend.
But I am not sure how should I approach application of NPP to generic ability system.

I have an ability system very similar to GAS except the prediction part. Attributes, effects are replicated via FFastArraySerializers and ability logic is contained inside seperate UObjects. Attributes are also UObjects which are only modified by effects.

IN NPP everything runs inside the NPP simulation. For something like basic movement, using a component derived from UNetworkPredictionComponent and updating maybe handful of properties related to movement inside the simulation is manageble.
However, I have around 20 attributes and around 50 abilities with different effects atm.
Using a single component and single simulation that contains all the ability logic seems impossible to maintain and definitely not the correct way.

Anyone have an experience how should I approach integrating NPP into my ability system? Or how should I implement an ability system that can utilize the NPP?

Or maybe NPP not intended for this kind of use? Coming from years of OOP habit, this kind of approach to programming quite new to me. Any help would really be awesome.

dark edge
#

I know nothing about the NPP but I'd maybe consider making things more data driven

#

What's a fairly complex ability for your system?

dark edge
mental linden
#

I have very different type of abilities since its an RPG game. Some of them are very basic like sprinting whereas some of them modify multiple attributes for different actors and the result of ability depends on multiple attributes. It is very similar to GAS and data driven to some point.

In NPP, simulation tick is very self contained. You should not modify any attribute outside the simulation of NPP. (at least what I understand)
If I try to implement everything inside the simulation for all attributes and all abilities. It will become a mess in a very short amount of time.
What I have in mind is to keep the abilities and attributes in my ability system and based on activated ability I run the ability logic inside the ability itself, which is called from the simulation itself. Then pass the calculated results to simulation.

#

But I am not sure this is the correct way for this kind of system.

#

Also unlike a movement, any attribute can be modified by multiple actors. Multiple actors (having their own simulation) can modify the same attribute.

dark edge
#

I mean what's the holdup to moving this to NPP? The fact that everything is an object instead of just POD structs?

#

It's just your typical RPG stuff right?

mental linden
#

Yes

#

The objects are not data only. They have all the logic for the ability. Moving all this logic to simulation seems wrong to me.

dark edge
#

It's doable

#

it's done every day

#

think close along the spectrum towards ECS

#

I guarantee you the spells in WoW are not objects of any sort. Just raw data shuffling around.

mental linden
#

Yea I was thinking I should think les OOP and more towards ECS style implementation which I have no experience unfortunately ๐Ÿ™‚

dark edge
#

It's pretty great once you get rolling with it I think

mental linden
mental linden
polar garden
#

Do you guys know how to invite a player to a session? Tried using IOnlineSession::SendSessionInviteToFriend but I can't figure out what the values for FUniqueNetId should be and I'd appreciate some help. Thanks!

mental linden
polar garden
mental linden
#

Not sure about that, in the SocialParty.cpp, it passes the id of SocialUser object but how it can be accessed for specific player, I have no idea ๐Ÿ™‚

eternal canyon
dark edge
#

Yeah I think really the only room for improvement at the core of the problem is how to handle conflicts, and maybe speculatively handling them

#

I'm running towards the door, you're running towards the door, we both know each other are running towards the door, it shouldn't be THAT suprising that only one of us will get to go through the door first.

#

The naive approach doesn't detect the conflict until we both said we were first

ruby lodge
#

Bruh, I just looked into AWS dedicated servers and that stuff is expensive ๐Ÿ’€

dark edge
#

yeah don't fuck up and generate a million dollar bill your first month

ruby lodge
#

even if you just take the lowest capacity but want to cover one for each continent you have to pay hundreds of dollars per month AT LEAST

dark edge
#

hundreds of dollar is nothing for an actual real game

#

less than nothing

ruby lodge
#

Yea I thought there would be actual low prices for small games

dark edge
#

If you're bootstrapping then I'd never even ever consider anything beyond community servers

ruby lodge
#

you can scale if teh game gets popular but if you are broke beforehand that wouldn't work xD

dark edge
#

I mean TF2 didn't have matchmaking for years and it did fine

quasi tide
#

TF2 also had a huge advantage to FutureCake. It released a long time ago

dark edge
#

Nobody is making Counter Strike 3 from their bedroom solo with a sub $1m budget

#

OK Valheim then

#

community servers

ruby lodge
#

Yea I assume it would work without as well because right now I wouldn't do too big matches anyways and would tend to reward players for kills or such and not for finished games

#

because the host might leave mid game if loosing lol

#

and obviously try to punish him for doing so then

dark edge
#

Yeah I sure as hell wouldn't want to try make a competitive game without a huge budget.

#

Player hosted is just so much easier

ruby lodge
dark edge
#

idk

#

why do players need rewards

ruby lodge
#

I mean if it becomes popular or I get investors then I would have the money for dedicated servers

dark edge
#

sure, but solve that problem if it happens

ruby lodge
dark edge
#

Have you built a game shop?

ruby lodge
#

not yet

dark edge
#

Do you know how much work it takes to make an ingame currency system that's not trivially defeatable?

ruby lodge
#

I don't care if it's defeatable. Buying things inside the shop isn't the main reason to play my game

#

also saying like 1 coin per kill and a rare new skin costs 1000 coins would be kinda fine I think

#

of course people could try to play with friends and get the coins easily but if there are any people to do that then it means people are actually interested in getting the things inside the shop

#

and thus playing the game

dark edge
#

Where does the database storing how many coins you have and your unlock status live?

ruby lodge
#

I was thinking about utilizing the steam inventory feature for that

dark edge
#

I hadn't looked into that much

#

you hear about the game that uses steam achievements as its save system?

ruby lodge
#

nah didn't hear that

#

but that's an interesting approach

#

Yea I was also thinking about using playtime

#

as a currency

#

Of course people could just open the game and go eat or so

#

but it's easy to test every now and then if the player is moving

dark edge
#

That's why I love community servers.

#

Someone's cheating? banned

#

Your inventory? Serverside

#

Don't like it? Start your own server

ruby lodge
#

Community servers would be unnecessary for small games

dark edge
#

Depends on how small

#

most of my designs revolve around a persistent small server like GarrysMod or Valheim

ruby lodge
#

well 1000 to 10000 people if it goes really really good

#

probably more like 100 people

dark edge
#

yeah I mean a community server is just a dedicated server someone out there is hosting

#

you can certainly host your own

#

but I'd make it an option so you have a solution to the tons of players + no money problem

#

Space Engineers does that.

ruby lodge
#

If i host my own it would still lead to huge lags if someone is from a different continent

dark edge
#

There's like 100 official servers and a million personal

ruby lodge
#

is it like a community server where people could do mods?

#

In games where mods are available

dark edge
#

It's where you can just download the server like TF2 or Counter Strike used to be or Minecraft or Valheim

ruby lodge
#

can everyone join matches on that server?

dark edge
#

whatever you want to do

#

I can go host a battlefield 4 server on my raspberry pi if I wanted to

#

and it'd show up in the in-game browser

ruby lodge
#

hmm

#

Yea that wouldn't be much different to a listen server would it?

dark edge
#

it's still dedicated

#

just publicly available

ruby lodge
#

but people would connect to something at your location

dark edge
#

or wherever

ruby lodge
#

My concern are lags

#

Inventory would be handled on steam so can't be faked really

#

everything else isn't important

dark edge
#

friend groups would host their own just like they do with minecraft or valheim

#

lag isn't the issue

#

This won't work for a matchmaking-centric game

#

it's more for a game where you stay on one server a long time like Battlefield or Team Fortress 2 or GarrysMod

#

It's just like any other online game except ANYONE can download the server application and host their own

ruby lodge
#

I mean a matchmaking centric game. It would be listen server but I add the continent abbreviation next to the lobby people could join matches by their continent and then play

dark edge
#

sure it'd be trivial to make a game with listen + dedicated

#

You have 3 types

#

Listen
Dedicated / publicly available
Dedicated / Ran By The Game Developer

#

Minecraft has all 3

#

GMod has top 2

ruby lodge
#

Just generally speaking. The concept I mentioned would work but it wouldn't be a very comfortable solution for the players because the host could leave anytime, right?

dark edge
#

that's Listen

ruby lodge
#

Yea I know

dark edge
#

so yeah if the host leaves that's it

#

plus most peoples internet isn't great for a demanding network load for certain games

ruby lodge
#

But that wouldn't even be a big problem if I punish people who leave mid game + if I reward based on kills and not on finished games. So everything you did in that cancelled match was still counted

ruby lodge
#

how fast it is

#

For a kinda competitive game that's the only work-around I can think of though. The community driven dedicated servers would not fit a competitive game and paid ones are too expensive for me

glad robin
#

OK maybe someone here can help me understand what is happening in my golf game. I want the player to possess the ball after it has been hit. ABall is a pawn with a Static Mesh, Projectile Movement Comp, Swing Arm, and a Camera. AGolfer creates a ball after choosing tee location and golf process starts.

  • First, AGolfer hits the ABall and ABall->ServerLaunchBall() is run.
  • PlayerController transfers possession into said ABall.
    Now at this point once possession is transferred to the ABall and it stops in place but ONLY ON the controlling client. They can move the camera around and interact but they see no movement in their ball. On the other client and the server they continue to see the ball moving. When the ball's projectile movement component comes to a stop (on the other machines) it broadcasts OnStop delegate and player controller is returned to the AGolfer. This process runs fine on Server every time but whatever client runs through the swing process has the above issue.

The one sort of fix I have found on this is to go into ABall and override PossessedBy() and comment out the Super(More specifically the call of SetAutonomousProxy(true); in but I just do super). Now the swing runs through and everything works great. Until the golfer goes for their next swing. Now ABall->ServerLaunchBall() will not run at all. I call it and it just doesn't go for some reason I do not understand. If I make a function TestCallLaunch() which just calls ServerLaunchBall() it will run TestCallLaunch but not ServerLaunchBall(). I've been on this for two days and am so close to losing my mind

warped oxide
#

Does anyone know of any good resources that go over the Advanced Identity system? Preferably something with pictures so my brain doesn't wrinkle too much please

opal pulsar
#

Marking gameplay tags in the editor to be Fast Replication = true means only the index is replicated as a uint32 with 7 bit packing and the 8th being an identifier for more bits in the next chunk or not, I got that from reading the source, what I dont understand is what would cause the tags to NOT be identical on server and client?

fossil spoke
opal pulsar
#

Maybe I was thinking too generally and not container specific

#

I thought it would be some global tag cached struct that held the index for each tag and thats the replicated index but are you saying its container specific

mild lynx
#

Is there a way to not Replicate something back to itself from the Server to Multicast? Basically, due to Network Delay and Lag, I want to the Client to see their Visual Update Instantly for a Particle Effect Going off, but when replicating that to other clients, the Owning Client gets to see it again at the wrong time.

#

This would be Blueprint as well

fossil spoke
#

If they were the one that triggered the effect predictively.

fossil spoke
opal pulsar
#

Well another look does suggest its the global cached tags index not container specific so now I just need to find situations where they would not be similar

crisp shard
quasi tide
#

A hyper-competitive FPS has expectations from the playerbase, most notably, dedicated servers. That costs money.

crisp shard
quasi tide
crisp shard
quasi tide
#

Well, if you only have 4 people playing, no point in renting 5 high-powered servers

#

So yes

crisp shard
#

yea makes sense

#

assumign that is the only limitation, i don't know how much i'd agree with the statement "nobody is mkaing CS3 from their bedroom solo w a sub 1mil budget"

quasi tide
#

Because you're not considering the cost of all of the art, sounds, programming, marketing, etc...

crisp shard
#

but those things in theory could be accomplished with time or compromise. and with tools / resources getting more accessible i also would argue most of those things are only getting easier to achieve

quasi tide
#

Even time has a pricetag on it

crisp shard
#

scaling a game is costly, we agree there. you can't have millions of players without the marketing/player acquisition/server stuff etc

quasi tide
#

Just because you don't exchange money with a market or someone else, doesn't mean it was free

crisp shard
#

but things are getting easier

#

thus they take less time

upbeat basin
#

If I set an actor relevant for a client on a listen server setup, is the player acting as the listen server keep seeing that actor?

upbeat basin
#

Yep it does

#

So if I want to have a replicated actor but be visible to only a single player, that is let's say not server, I would need to hide it's visibility on the server in order to achieve this?

thin stratus
#

In theory yes. But you would still have the issue of collision in case said actor has that

dark edge
dark edge
#

or a listen / community hosted game

#

There are programmers making like 150k a year that do nothing but the matchmaking and devops for big titles

upbeat basin
grand kestrel
#

I'm trying to sync the start of the match between two players a bit, but it doesn't really matter much.
I just send the latency with the RPC notifying the server that they're ready, server replies saying they're ready too and both of them start a timer, the server adds the latency it received, so both should be reasonably close.
However, is there anything with the APlayerState::GetPingInMilliseconds that might cause issues, such as their ping spiking when they passed it? Is there any averaging or normalizing over time, either from the ping it sends or another function?
I can average the ping over a whole bunch of frames if I really need to but shrug Just want to be aware of any edge cases I might run into, perhaps I will clamp the ping too

woven bramble
#

My game has no lag, everything is flawless. However, there is an issue. When the processing load increases (simply put, when the number of RunOnServer calls increases), the client gets kicked. This is actually something inherent in the nature of the system. However, in many games, when this happens, lag occurs, and the user waits in the game but NEVER gets kicked.

I think it's related to configuration settings.** Which setting could it be related to?** For example:
ConnectionTimeout=80.0

cerulean swift
#

What you see in the first picture is all in a UI widget and it's called W_MainWidget for me and it's in my multiplayer mode and I don't know how I can get it into my singleplayer mode, which is what you see in the second picture can see that it is displayed to me

manic badger
#

Hello everyone.
Has anyone come across an mb "article" on how to replicate components without creating separate copies (one version for the server, the other for the client)?

solar stirrup
#

Would help us determine your problem

manic badger
solar stirrup
#

The "best" solution would need C++

#

I'm assuming you're trying to spawn components at runtime and replicate them to clients right?

solar stirrup
#

You'd want to replicate an array of your runtime components to clients

#

The server would need to add the components it spawns at runtime to the replicated subobject array (AddReplicatedSubobject()) as well. Don't forget to remove when you destroy the components.

#

On the client, you'd register the components when they replicate (in the array's rep notify, but be wary the values in there might be null if the new components haven't been received yet, so you'll need to do some tinkering)

manic badger
solar stirrup
#

o7

jade ibex
#

Soo, ReplicatedUsing does not arrive in call order

#

is there a way I can make it so?

#

Actually, I might be changing it back and forth too quickly, so it registers as no change

solar stirrup
#

Yep, clients arent guaranteed to receive every value

#

Especially if you change them pretty fast on the server

jade ibex
#

i need to do reliable then...

#

call through a function <- this worked btw, now i am concerned for the rest of my code... been using replicatedusing very liberally... refactor required ๐Ÿ’€

stoic lake
#

SE_UpdateWidget is called on the beginplay of the character

jade ibex
#

you can get player name from playerstate iirc

#

so you dont need to pass around

stoic lake
#

Really? What would that look like?

jade ibex
#

GameState->PlayerArray->PlayerState->GetPlayerName

#

something like that

stoic lake
#

aah ofcourse

#

Let me give that a try real quick

#

Still getting the same result

#

these should automatically change to the correct names and picture

#

it does look like both the server and the client are now receiving the names though

jade ibex
#
    PlayerCharacter->SetPlayerName(GetPlayerState<APlayerState>()->GetPlayerName());

Is all i have in code

#

so Im confident that is all you need to do

stoic lake
stoic lake
#

It now only works for the server

#

client is not getting the data it seems

jade ibex
#

what i did was set it up on a string that is replicated

#

and then every other client/server can just get the player pawn and check for the playername associated with the character

#

locally, the controller will set the player name to the controlled pawn

stoic lake
#

i dont think i fully understand how an actorcomponent works with replication

#

does each client have an instance of a characters actor component?

jade ibex
#

every client will have a copy of a player's character

stoic lake
#

right

jade ibex
#

you should read up on how server client relationship works

#

it will really help you start running

#

otherwise you will only be crawling

#

the crawling will be painful

stoic lake
#

i know how it works basically in every part of unreal, but actor components have always seemed to work slightly different as opposed to actors

#

cant wrap my head around it fully

jade ibex
#

i suppose so, I had issues with replicating the springarm, it would not replicate at all to clients, but was the only way for the server to find the location of the camera attached to it on the server, otherwise the clients needed the camera position attached to the springarm instead

#

personally, I created a child character blueprint

#

to house the playername string

stoic lake
#

i mean this type of actor component, the logic is all in here

#

Im trying not to touch the character itself for the sake of modularity

jade ibex
#

well

#

depends

#

how is it made?

#

spawned? or already pre placed in BP?

stoic lake
#

pre placed

jade ibex
#

okay should be fine

stoic lake
#

Okay I think I got it then, thanks!

mild lynx
#

How would I keep "Is Local Player Controller" from returning an Error with multiple clients?

#

My only thought would be to pass the Controller over Server to Multicast and check if it's the same, but it feels like I shouldn't have to do that

jade ibex
#

Im not sure about the technicals but only the server has access to all controllers, clients will not see any controllers other than their own

#

even when passed

#

so you will need to design around it

mild lynx
#

Okay, that makes sense

#

I wish I knew of a more modular way of reusing Server Event, to Multicast, instead of having to make a crap ton of custom Events to do it for each thing you want.

jade ibex
#

not really much leeway in a server authoritative architecture

sinful tree
mild lynx
#

I'm trying not to have the same code twice if I can

#

I'd like for the client to get instant updates on visuals why still doing it on server then sent to clients

sinful tree
#

Oh wait, I see, you want it to execute on everyone but the owning client. Check if Get Controller is valid, if not, then it's not the owning client. You'd still need the local player controller if you care about the server executing the code or not.

mild lynx
#

Yeah, that's what I'm going for

jade ibex
#

you could pass the player pawn

#

and check against player 0 pawn

sinful tree
#

Not necessary.

jade ibex
#

yeah wait just saw that part

sinful tree
mild lynx
#

Oh sweet, I was just about to ask that

#

Let me try this out

#

Also I wish I had the Circuit board Node plugin you're using lol

mild lynx
#

So this is what I came up with, but it seems if the Client uses this Input Action Twice, they get a delayed second change from the server? I'm testing at 300ms to exaggerate any issue.

ancient moth
#

Hey ! I'm metting a problem using the push model. I would like to use it on a replicated UObject (new system) with OnRep.

The actor handling the replication have bReplicateUsingRegisteredSubObjectList and bReplicates on true.
In the actor GetLifetimeReplicatedProps, I call the super function and use DOREPLIFETIME_WITH_PARAMS_FAST with bIsPushBased on true and RepNotifyCondition on REPNOTIFY_Always.
The actor create the uobject and use AddReplicatedSubObject() on it.

The uobject have IsSupportedForNetworking() overrided to return true.
The uobject have GetLifetimeReplicatedProps() overrided and its variable replicated used with DOREPLIFETIME().

The option Net.IsPushModelEnabled=True is set in the DefaultEngine.ini.

The result is that I have 2 OnRep call at the creation of the uobject (one when I set the replicated pointer variable, one when I use AddReplicatedSubObject() ). But nothing happen when I use MARK_PROPERTY_DIRTY_FROM_NAME() to replicate the uobject. I tried to change a int value in it before mark it, tried without AddReplicatedSubObject()... Nothing seems to work. Is it just impossible to use push model on replicated uobject ?

solar stirrup
golden condor
#

Hi how can i create widget on my player controller if he's a dedicated server ?

solar stirrup
#

You should avoid putting any gameplay logic in widgets

golden condor
#

Yes but i want to create it in my client player controller

solar stirrup
#

Create it on the client's side then

golden condor
#

I got the same result even when i create it in "owning client"

mild lynx
solar stirrup
#

if i remember correctly

solar stirrup
mild lynx
golden condor
#

Using the get player controller if it's running with Owning client is fine ?

solar stirrup
#

Should be since they only have their own player controller

#

However you should just create the UI in BeginPlay() instead of using an RPC

golden condor
#

i didn't had this bug before but unreal crashed and now i cannot create Widget in the PC

solar stirrup
#

that's also called on the client

golden condor
#

Doing this, i got the issue, accessed none trying to read property "add to viewport"

ancient moth
#

Don't be stupid, don't click.

solar stirrup
#

BeginPlay() also runs on the server, and this would fail for a dedicated server

#

Best solution would be: BeginPlay -> Is Local Controller -> Branch -> If True: create your widgets etc

golden condor
solar stirrup
#

If your game only has dedicated servers, this would work too yes

golden condor
#

i don't have the error but nothing is adding to the viewport

solar stirrup
#

Use the blueprint debugger

golden condor
#

First time i use this xD

mild lynx
#

Okay, this seems to be working on Clients and Listen Servers now.

My only question that remains would be if this is possible to simplify for modual use. Basically, can I compress this down into one node to be reused with Different code for the event "Do Event"?

#

(I just think this is super unorganized and could be much better)

golden condor
#

Here it's just printing the Is DedicatedServer node, so it's never firing the Client Part

golden condor
#

yes

#

i'm running as a client

ancient moth
#

Test with is server instead of is dedicated server

golden condor
#

i have the same result

ancient moth
#

Your PC have a C++ parent class ?

golden condor
#

No

#

It's a basic player controller

#

i didn't had this bug before the crash but i don't know why this is happening, normally the player controller is firing in client also

ancient moth
#

Let's hope it's not a BP corruption ๐Ÿ˜„

#

If you can, test a previous version.

#

When it was working

golden condor
#

I tried with an a version from 2 weeks ago and it was working ๐Ÿ’€

ancient moth
golden condor
#

Maybe if i create a new player controller it may work

ancient moth
ancient moth
golden condor
strong fable
#

hi, if I'm using playfab and steam, how should my DefaultEngine.ini look like?

DefaultPlatformService=PlayFab
NativePlatformService=Steam``` or
```[OnlineSubsystem]
DefaultPlatformService=Steam
NativePlatformService=PlayFab```
shrewd ginkgo
#

I want to make replicated door whats wrong about it

pearl inlet
#

Is there something I am missing with the MatchState? It is handled by the GameMode, which only exists on the server, so by the time the clients know about it, some time has passed, depending on latency? The MatchState is locked down in AGameState so only the server can modify it, which means the client only learns of it's new value when the OnRep is called. By this time, this is too late for my use-case as I have client side prediction which attempts to match the server as closely as possible. Would I need to create my own state machine for Client MatchState? Or is there a way I can do some prediction on the client and set that MatchState value, and only use the server to validate the client's prediction? If anybody has any resources that might help, I am happy to do the research, but my attempts to find anything useful on MatchState have failed so far.

formal solar
#

Hiya, I'm having a hard time figuring out 'replicated to server' events, I use them a lot but I ran into an issue specifically in an anim BP of a player character. I have an anim notify that triggers when an animation finishes, then I have some logic that i run in a 'replicated to server' event. I see the '(if owning client)' thing and assume that means that the player controlling the character will fire off an event to the server where the logic runs once, however it seems what is happening is the logic executes twice - I'm assuming the server itself (I am using listen server setup) also fires the 'replicated to server' event - so are there two 'owning clients', both the player and the server? I had to add in an 'isserver' check to stop the logic firing on the server and duplicating

dark edge
#

racing game?

pearl inlet
dark edge
#

I mean you can totally just ditch the built-in state stuff and roll your own with GameModeBase and GameStateBase

#

that sounds like a PITA though, what is the problem with finding out the state changed 30ms after it did?

pearl inlet
#

I have a rollback-rewind system which is accurate to the exact frame number, so it just helps to integrate into that whole system if I can set the match state manually. I always have that as a fallback, I am just trying to use built-in component as much as possible, but am struggling to understand the benefits of handling MatchState that way

dark edge
pearl inlet
pearl inlet
#

oh sorry yeah I did know what that was - yeah I did look into that but I am using a third party physics engine so I built my own (for learning purposes mainly, but it works well enough)

dark edge
#

Would you even bother trying to predict stuff like that or just go with replication of the end result (the things you can actually see)?

#

In-game there'll be in the thousands of connections, the 3d physics analog would be thousands of objects, each with at least 1 constraint, usually more.

pearl inlet
#

That sounds well outside of the realm of my knowledge. My thoughts on replication (and one reason I am looking at predicting even MatchState) is that if the end result can be calculated before the end result is replicated, then we can use client prediction to ensure we get that same result ahead of time. The physics engine I am using is (nearly) deterministic, so the corrections are very infrequent if the prediction is accurate.

dark edge
#

What is this match state, a win/loss?

pearl inlet
#

The server would still always have authority, and that's where the server reconciliation would come in to play. If, when the replication occurs, the server sends a different value to the one calculated on the client then the client can perform a rollback to the last 'confirmed' state and fast forward through to it's current point in time (the snapshot would be server time + latency). So with that in mind, the clients only compare themselves to the server, not the other clients - match state in my instance is the phase of the game - PreRound, RoundActive, PostRound etc. which I know sounds easy enough to handle 30ms (or 100ms) delay, but if the client's first action is a fast maneuver, their state could disagree with the server and cause a correction

#

btw, back through this, I am stating this as very factual but in reality I am learning all of this as I go so I could be wrong in parts. This is how my custom system is working currently, and I seem to get good results when testing with other users - I am just hoping to leverage UE stuff where possible to keep the 'custom' things to a minimum from this point

quiet flame
#

anyone knows why my gravity replication doesnt work with clients? this is a vehicle a boat to be precise. this gravity makes the boat float in my custom water whenever they overlap each other, the server rides the boat perfectly fine and working 100% , but for the client the boat just sinks.

opal pulsar
#

How am I suppose to query the connected clients to a game?

I found this function in the uworld FConstPlayerControllerIterator UWorld::GetPlayerControllerIterator() const

fossil spoke
#

Thats generally a better mechanism

#

As its available in all network contexts

opal pulsar
#

Perfect, ty

visual shell
#

How am I expected to change an action binding with the new "Enhanced Input" system?
For instance, I would like the "Attack" key to trigger either the function "RifleFire()" or "KnifeStab()" depending on the chosen weapon.

opal pulsar
#

Is this just saying send initially and then after only when I explicitly mark as dirty?

SharedParams.Condition = COND_InitialOnly;
DOREPLIFETIME_WITH_PARAMS_FAST(APlayerState, PlayerId, SharedParams);
visual shell
safe marsh
#

Hi, I have a question about routing events for multiplayer. I am making a system where a player needs to click a card, server validates it and then returns if it has been activated and updates the UI. What I currently have is:
CardWidget(OnClick)->PlayerController(server_RequestActivation)->CardManager(validateActivation)->PlayerController(client_markCard)->CardWidget(markcard)

#

this is in BP, and there are quite a few calls to different events, is there a clearner way to do it? CardManager isnt replicated and only exists on server, so I need to go through the controller right?

dark edge
#

Why the networking

finite spindle
#

Hi how can i show my player score on a widget ? it's in the playerstate actually, should i use a gamestate ?

dark edge
#

I'd put it in player state

#

The simplest way is just to have a widget with a value binding to the local players score. Eventually, you will maybe want to bind it to a dispatcher on PlayerState that fires whenever the score changes, but value binding is fine for now.

finite spindle
#

Okay cool thanks ! And if i want to make a small party inside of a level but just for some player overlapping a triggerbox, can i use the CreateSession node or is it just for self hosting games, (im using a dedicated server)

visual shell
#

SetActorLocation() produce a BeginPlay on the Client. Is it something expected?

hoary spear
#

The mentioned agnostic "Attack()"

#

Where the input doesnt cate *which weapon" is currently selected

#

It simply invokes "Attack" on it

#

Then its up to the weapon to define what that means

visual shell
# hoary spear The mentioned agnostic "Attack()"

While it's indeed a solution, I also need to play an animation. Fully relying on this method requires having the following in the Weapon class:

Cast<AMyCharacter>(GetOwner())->PlayAnimMontage(/*AMyWeapon::*/AttackAnimation)
#

Humm... or maybe just:

Cast<AMyCharacter>(GetOwner())->PlayFireAnimation()

And let the pawn decide of the animation

visual shell
# hoary spear No

Actually, it seems more complicated than that. It involves a concatenation of SetActorLocation, EnableInput, and SetActorHiddenInGame. If I comment out some functions, BeginPlay is not called.

hoary spear
#

We're using an animBP for each type of weapon with its own 'fire'state iirc

#

Its set when the weapon is equipped

visual shell
#

Ah good point!
I should rely on AnimBP

#

Thanks for your answer ๐Ÿ™‚

distant tundra
#

Hey, I made an actor component but im having issues with the replication from client to server. I've read about replication/ownership/RCPs and still cant figure out whats wrong with my actor component. It's pretty small sized so if anyone would be kind enough to hop in a voice chat and watch the blueprint and explain to me where I failed, that would mean a lot to me! I don't want someone to fix it for me, just explain to me where the issue is so i can learn from my own mistakes, thanks!

nocturne iron
#

How do I send an RPC to only one client?

#

To notify from server about corrections.

hoary spear
#

Owning Client?

nocturne iron
#

Nope

#

All owned by server

hoary spear
#

Then how would you know which client to send to

nocturne iron
#

I found another solution.

#

Would just pass as parameter

modest crater
#

From the server

olive crow
#

can I skip checking if the owner has authority inside a method marked as execute on server?

fossil spoke
#

Server always has authority

nova wasp
#

does it still prevent or error out the ufunction being called by raw C++ code?

quiet flame
solar stirrup
#

At that point you're being pretty silly though

nova wasp
#

definitely, I suppose it's user error at that point lol

storm grove
#

Is the TStructOpsTypeTraits enum WithNetSerializer = true enough for the replication system to use that for replication or do I also need to implement the other related ones like WithNetDeltaSerializer and WithSerializer

violet sentinel
#

delta serialize is mostly for containers afaik

regal solar
#

Hey folks!
Could accessing a playerState's replicated variable every second potentially result in network overhead issues, even though the variable itself isn't being updated during these accesses?

storm grove
#

But what If I have a container of the struct

storm grove
#

setting a replicated value on a client does nothing but change it locally

regal solar
#

thnks

woeful ferry
#

its not like you get the value from the server each time you get a variable

#

its all locally

regal solar
#

I've declared character modular parts references on ***PlayerState ***. When a player changes their avatar through the avatar editor, such as altering their hair color, other players should receive that updated hair color within at least 1 second. Is this approach considered a good solution? What are the best practices for achieving this functionality?

#

I've created a CosmeticActor that contains character modular parts and attached it to the Pawn. However, since it doesn't replicate like the pawn, I've decided to periodically access the PlayerState every 1sec to check for changes and update the parts if the value has changed. Is this approach suitable, or are there better alternatives for achieving this synchronization?

brittle fulcrum
#

Hi. I know it's been a while but How have you solved the no input on pawn repossess issue? Any more details in addition to this:
#multiplayer message

modest crater
# regal solar I've created a ***CosmeticActor*** that contains character modular parts and att...

You can have these changes locally until the user confirms and then just push the changed value manually with a pushmodel workflow (See the APlayerState stuff for examples and read pushmodel.h)

You really only have gameplay tags or flags if you want performance.

Personally I use gameplay tags for my attachment system and when I need to replicate a users weapon loadout I pack them into a single enum rather than an array of gameplay tags.

Gameplay tags can be fast though, esspecially if you enable replicate by index or whatever the flag is called in the editor.

brittle fulcrum
#

Any luck with this? ๐Ÿ™‚ EDIT: Solved by modifying LyraCharacter to expose a function that reinitializes input through the Hero Component. Not sure if this will work in Multiplayer though.

violet citrus
#

Can anyone please help me in fixing this ```
In file included from /home/vishal/Documents/Unreal Projects/Caution/Plugins/MultiplayerSessionsEOS-master/MultiplayerSessionsEOS-master/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/MultiplayerSessions/Module.MultiplayerSessions.cpp:4:
/home/vishal/Documents/Unreal Projects/Caution/Plugins/MultiplayerSessionsEOS-master/MultiplayerSessionsEOS-master/Source/MultiplayerSessions/Private/MultiplayerSessionsSubsystem.cpp:7:9: fatal error: 'Interfaces/OnlineidentityInterface.h' file not found
#include"Interfaces/OnlineidentityInterface.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Actually the same worked well on windows but now Im building it on linux and i'm getting this header file not found issue ๐Ÿ˜ฆ
#

I'm using unreal 4.27 source build

upbeat basin
#

If I want a specific client to do something from a replicated actor/component on the server, is the best way creating a client RPC on player controller/state and calling that?

#

I have a component which looks for an aimed player and when triggered I want to play effects on the aimed player's client

#

I don't want to create a dependency to other actors and encapsulate that logic to that specific component only

#

Only way to do that is I guess calling a multicast RPC with target character and checking if the character is locally controlled on the RPC. But it also feels unnecessary to call a multicast RPC for that

#

Am I missing something that could achieve this or do I have to sacrifice either encapsulation or network optimisation?

lost inlet
#

because the I in Identity should be a capital letter, not lowercase

#

and VSC? you can get Rider on Linux

violet citrus
lost inlet
violet citrus
lost inlet
#

???

#

also if you're making a native linux client, that's something you'll probably make $0 from

violet citrus
#

I love linux so when I will need to package project for windows I will switch to windows machine

violet citrus
nocturne iron
#

Is it correctly understood that I can use COND_InitialOnly to initialize a variable that was set before client joining, and then keep it up to date with RPCs afterwards?

tardy fossil
#

yes anything marked as initialonly will only be sent when the replicated thing spawns on a client

nocturne iron
#

Nice! Thanks you :)

tardy fossil
#

np

visual shell
finite spindle
#

Hey, how can i have my level streaming always visible on server, but only when client fire event it appear for the player ?

rose pollen
#

has anyone played with mover2 enough to compare it to GMC?

chrome bay
#

Well, unless you don't care about possible relevancy/dormancy

muted tartan
#

Good morning everyone,
Beginner game dev student here. I'm currently working on an RPG game and I'm about 10 percent in my game. I've done enemy AI, I can attack and dodge as well as health and stamina system. I was wondering would I start from scratch again if I wanted it to be an online multiplayer? Nothing crazy just 4 players. I couldnt find tutorials about how to make simple online RPG. Please help. Thank you!

solar stirrup
#

That's why you generally consider if your game requires multiplayer or not before you even get started on it

honest bloom
#

I got a problem in my multiplayer game where removing an actionmapping from a weapon that's gonna be thrown away and adding the mapping context for the new spawned weapon right after doesn't work correctly ..
Especially on the server, even if the RemoveActionMapping happens for the old weapon happens, for some reason the character shoots with both the thrown and the newly spawned weapon he got ..

#

I don't get why that happens ..

#

I made sure on logs that everything happens in the right order

muted tartan
#

*reply

solar stirrup
#

I don't know about any tutorials

#

And it depends on your project, you can just see what code can work in multiplayer and rewrite the rest

muted tartan
#

Sounds good. Thank you!

blazing spruce
#

Hi, I'm making a sewer system where the player interacts with it, it displays a map and the player clicks on the sewer they want to go too

When the player first interacts with the sewer it'll play a timeline that opens it, then when they click on their desired sewer from the widget it'll open that one, delay for a couple seconds and then teleport the player over to their desired sewer, it then closes both the current and desired sewers

Almost everything is working fine however the closing sound effect isn't heard for the client player who is travelling, when the last CloseSewer is called on the Desired Sewer, they don't hear the closing sound played but the server player does, any ideas why and how to fix it? adding another delay will make it play the sound for the client but I know that's not the correct fix ofc

finite spindle
#

Hey, how can i have my level streaming always visible on server, but only when client fire event it appear for the client ?

mild lynx
#

What am I doing wrong here when trying to respawn a Player? This works perfect for the Host, but when the Client hits the Respawn Button, it doesn't destroy, or create a new actor on the Server at all.

mystic estuary
mild lynx
#

Ah okay, I did not realize that

mild lynx
mystic estuary
#

With the setup you sent it shouldn't destroy the host, as you're passing the pawn that is related to the widget

#

Also, instead of using global functions to get the PC, use GetOwningPlayer

#

Obviously when speaking of widgets

mild lynx
#

Okay, I think I got it. The last notable issue is when testing at 180 ping, I get a bit of rubber banding for about 2 seconds on respawn when its dropping me on the ground. Is there a good way to fix that?

mystic estuary
#

wdym? Can you show it?

mild lynx
#

This is the code now. Left is Widget, Right is Player Controller

mystic estuary
#

btw you can use GameMode's RestartPlayer function

#

It'll substitute everything you have after DestroyActor

mild lynx
#

Like this?

#

Actually that doesn't work in New Player

mystic estuary
#

Yeah, you have to feed Self

#

You're already inside a controller, you don't have to get it in any way

mild lynx
#

Ah, Okay, I thought Self took care of it but the top needed Get Game Mode

mystic estuary
#

Yeah, exactly

mild lynx
#

Hm, now it's just destroying the character without respawning me?

mystic estuary
#

Check the log

mild lynx
#

Checking now

mystic estuary
#

oh, you don't need to destroy actually though, I forgot that ๐Ÿ˜›

#

It'll destroy inside the method

#

You didn't feed self in NewPlayer

mild lynx
#

Hm, now it's not doing anything? The Event being called is set to Server, does that matter still?

mystic estuary
#

Yes, GM exists server-side only

#

Hence you cannot call the RestartPlayer client-side

#

Can you show what you did?

mild lynx
mystic estuary
#

You didn't feed Self into NewPlayer

mild lynx
#

Okay, so now it seems like it's working, but isn't setting the player back to Player Start?

#

I tried changing the node to do so

indigo brook
#

Hey guys, kinda brain farting on something that should be easy here
Goal is to have one 3D widget in a world, players can push a button and the number will change and be the same. So if server pressed it 3 times, it shows 3. If the client then pressed one time, it would show 4 on all clients/server. Seems simple but I can either get the client or server pressing, but not showing the same

mystic estuary
#

You don't have to feed the PlayerStart manually. The default RestartPlayer finds one itself. You should use RestartPlayertAtPlayerStart when it matters what is the player start. In your case you're getting a random one

mystic estuary
mild lynx
indigo brook
#

Aye, @mystic estuary Thanks for answering. I've created the widget inside the PC but alas, perhaps I should do all the changing there?

mild lynx
#

Exactly where I was

#

I can tell it worked because my camera rotation is reset

mystic estuary
#

What does the log tell you?

mystic estuary
indigo brook
#

@mystic estuary Alrighty, just to get this straight

Create the widget anywhere

However, if I'm to change a value, I need to set the RPC to do so in a replicated actor such as Player Controller. I must have been super close, just calling this in the wrong spot

mild lynx
#

This is all I get from the exe Console, nothing really shows up in the log

#

Ah, I think I know what's going on

#

That component is a Movement Component Plugin, so I need to ask them.

mystic estuary
mystic estuary
mild lynx
indigo brook
#

This is the setup I have, first image is the widget, press the button, tell player controller RPC to multicast to all widgets to update group equiptment. Yet the number is not adding

#

@mystic estuary Again thanks for answer btw

mystic estuary
#

tell player controller RPC to multicast to all widgets to update group equiptment
Again, widget cannot have any RPC. Calling one will not do anything on remote machines

mild lynx
#

Nope ๐Ÿ˜„ I'm not great with C++, but I'll hear back shortly.

#

Thanks for the help so far though

mystic estuary
#

You're welcome

indigo brook
#

The widget doesn't have a RPC, unless what you mean is the RPC call to the Player Controller? Is that what you mean?

mystic estuary
#

oh, sorry, my bad, I thought that you still have the RPC in the widget. You cannot call a multicast from a client, it'll not do anything on remote machines. Do a server RPC that will call the multicast instead

#

Clients can only call server RPCs, while server can call anything

indigo brook
#

Like so?

mystic estuary
mystic estuary
indigo brook
#

Yeah I just tested haha only server could change the number

mystic estuary
#

You have to do a multicast instead, which in turn will affect the local widget

indigo brook
#

I'm getting Server 1, Client 1, but the number isn't changing haha

mystic estuary
#

But again

However, I see that you have some RPCs there. Note that clients only have their PC, hence no multicast will get to anything but server and owning client

mystic estuary
indigo brook
#

OKay man, my head is spinnign at this pont

mild lynx
indigo brook
#

point*

indigo brook
mystic estuary
#

Getting PS at index 0 will always return the listen server's PS

mild lynx
#

Ah

#

Okay

mystic estuary
mild lynx
#

This code does seem to work

indigo brook
#

I appreciate you helping man. I feel like I'm close but something's off.

My player controller creates the widget

In widget, there's a number that's attached to the game state replicated number

Player 2 pushes button on widget, it says 1, adds just 1. If player presses again, it does not add another 1 to 2, 3, 4...just 1 for some reason

Player 1 pushes button on widget, it says 1, adds just 1, same thing

I need player 1 to push the button, it says 1, if client pushes button on their widget, it says 2, server and client can both see 2.

mystic estuary
indigo brook
#

I call the RPCs from the player controller from multicast yet it's not multicasting or pulling/updating the number in the widget from the game state

#

Print string shows just 1, if I spam it, by the badge to the right is just 1, it should be like 10

mystic estuary
#

Can you show your modified code?

indigo brook
#

It's the same as I last showed you haha

#

This is the widget

#

This is the player controller

mystic estuary
#

Is OnPressed (B_Play) called when you press the button?

indigo brook
#

Yes

#

Just double tested with a print string, it works

mystic estuary
#

Firstly, it won't do anything if you press it client-side. Note the little (only if server). Secondly, when you hit it server-side, it will do something server-side only because server controller exists server-side only, which means that the UpdateGroupEquipmentWidget will never be called client-side from what I've seen

indigo brook
#

How would you do this if you were me?

Step by step?

mystic estuary
#

I would have a stateful information of the widget somewhere, it might be GameState, I don't know the whole purpose of the widget, so I'm just throwing a actor that suits it. Currently you don't have anything that would keep track of the widget number other than widget, which means that if a client joins later, they will never know what is the number on that widget.

So, in the GameState I would create a integer that is RepNotify, and OnRep would essentially call that UpdateGroupEquipmentWidg (idk how you would get the reference to the widget though, again, I don't know the whole thing).

When you press the button, I would do a server RPC that would modify the aforementioned integer, which in turn would call the OnRep that would do what I just said

indigo brook
#

Thank you, I'll study what you said and retry. I appreciate you taking the time to answer my questions!

mystic estuary
#

You're welcome ๐Ÿ˜„ Gl with the implementation

indigo brook
#

If successfull, I'll let you know how it goes haha

dark edge
indigo brook
#

Aye, I figured the game state struct would house that info

#

Basically I'm trying to recreate the phasmaphobia 3D menu widget for a game jam project

#

I figured I could store that number inside the game state variable, then on the widgets, it would pull that number and update

#

So all could see

mystic estuary
#

I haven't played phasmaphobia, but it feels like you're trying to implement some level settings ๐Ÿค”

#

or something related to the level players are about to play

indigo brook
#

In the group gear section, I'm trying to buy an item, then the player has their own stuff they can add to the group

#

So the + and - keys are if you have like 3 stun guns, you can add 1 to the group gear, so when the game starts, it spawns the same number that's in the group gear in the world

#

I only need the group gear to be replicated

dark edge
#

how many groups are around?

#

just the 1?

indigo brook
#

What do you mean?

dark edge
#

are there more than 1 group doing this independently?

#

Is there another group with their own group gear or is it just 1 group for the whole game

indigo brook
#

Ohhh, one team, co-op experience. Up to 5 players including host. All 5 will have their own player inventior they can add tot he group gear if they choose to

dark edge
#

ok so put that on GameState

#

GameState holds group stuff

#

PlayerState holds player stuff

indigo brook
#

Yeah! That's what I have been doing brothaaaa but for some reason I can't get that number to show on the widget to all haha

dark edge
#

just use widget binding

indigo brook
#

Say whaaa?

#

Like a text that has a binding to the game state?

indigo brook
#

I know how to bind haha

#

Just was clearifying

#

I could try

dark edge
#

yup

#

assuming you're setting AsBPGSGamePlay correctly

indigo brook
#

I set the game state on construct

dark edge
#

so does it work?

indigo brook
#

Here's the set up, from Player Controller, I create widget, then in the widget, I press button, send message back to player controller for RPC multicast, that then is supposed to add 1 to the game state variable and then now show the text in the binding.

All it does is just show 1

dark edge
indigo brook
#

Roger, so just a basic no RPC?

dark edge
#

update group widget should not be a thing

#

you're using binding now, remember?

indigo brook
#

Yes

dark edge
indigo brook
dark edge
#

make sure you're not doing that

indigo brook
#

Ohhhh

#

If I can't set it, then how can I increment it?

#

I would break the binding

#

@dark edge We're close, the binding helped.
The server does raise both at the same time. However, when I add with the client on the left, it does increment, but not for the server. I need to tell the server that the client is incrementing too. That's where I'm trapped ahha. It has been a long day

indigo brook
dark edge
indigo brook
#

LOL

dark edge
#

the button just needs to call a run on server event in PlayerController or PlayerState

#

Button -> tell the server you want to do the thing

indigo brook
#

Dude, I'm so confused, I swore you or someone else told me to get rid of the RPCs and stuff haha

dark edge
#

get rid of multicasts

#

the ONLY way to send data to the server is with a run on server event

#

you need to use those to send stuff to the server, stuff like "I want to increment flashlights"

#

How many types of items are you going to have? You probably want to parametrize the item type while you're at it

#

instead of making events like AddFlashlight and RemoveHammer

#

just make AddItem and RemoveItem

#

with something representing the item type as a parameter, it can be an enum or a tag or a name or whatever

#

This is a lot of work for a game jam, the jam'll be over and you'll still be working on UI lol

indigo brook
#

It's a casual jam haha. I'm also using this as a learning experience a bit more for online games

I think the problem is that I'm a visual learner using visual scripting. I'm trying to understand what's being written in suggestions from multiple people and I'm getting confused

#

I've been at my pc for 12hrs at this point so I think it's wise I take a break and come at it with fresh eyes tomorrow.

#

Suprisingly, there's a lack of Youtube tutorials for multiplayer widget interaction, or at least I haven't been using the proper keywords

#

I appreciate you guys helping and lending an eye

sinful tree
# indigo brook Suprisingly, there's a lack of Youtube tutorials for multiplayer widget interact...

That's because widgets typically aren't something that have anything to do with multiplayer. They only ever exist on the one instance of the game, so they can only be used to display data to the client that is seeing the widget. The data then is what is being replicated through replicated actors and sending appropriate RPCs or using OnReps to drive how the widget operates. Reading the data of the game is no different between multiplayer and single player in terms of having your widget display information or react when events happen.

#

So in that sense, widgets are limited - you can't RPCs in them, you can't replicate in them. They can only display data the client already knows about.

#

So if you want a button in your widget to notify the server of something, you'd need to have that button click send an RPC through the PlayerController or Component or some other replicated actor owned by that client and do the RPC on that actor or component.
Want the widget to react to something changing? Use an event dispatcher on the replicated actor and signal when a variable changes (ie. when an OnRep fires) and when that widget is constructed bind to that dispatcher, hopefully the widget can easily get a reference to the actor it needs to care about. You can still use an RPC for receiving updates, but it should only be done if it makes sense to, like if it's not something that would relate to a state.

dark edge
torpid lantern
#

How does unreal hold up as a chat server? I'm looking at SDKs, but I was thinking it might be fun to try and build something using replication.

Is this a silly idea, should I be worried about scale?

Ideal state: 30 connected clients & single server-wide channel

If that's too heavy I could pair down to a local proximity.

hoary spear
#

One of the users way of interfacing with the code

ashen plume
#

is networked movement with the default cmc impossible? a default character with any network emulated latency is completely unplayable

quasi tide
#

No

#

You just have to do it correctly

ashen plume
#

define "correct", as the out-of-the-box character is inately awful

quasi tide
#

Exactly - you're using the out-of-the-box solution

#

You have to go into C++ to do this

ashen plume
#

what is the point of cmc if youre going to have to write custom c++

quasi tide
#

To not write the other 10,000 lines of code???

ashen plume
#

when it defines itself as coming with network prediction, you just end up writing 10,000 lines for any meaning prediction then

quasi tide
#

...

ashen plume
#

again you act like its already functional when it isnt