#multiplayer
1 messages ยท Page 157 of 1
Vori is in that 0.1% that I left out for safety ๐
:v
fixed, changed the bIsAwaitingSlideJump in a function that wasnt replicated
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
WHich config do I use if I want the client to have more time to join the host? Is it InitialConnectTimeout?
Why do you need to possess that ball?
Player moves camera around and does various ball actions to move it
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
Possessing the pawn
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
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
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
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-
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
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.
Where are you applying the Context?
Your BP_Character_Player_Sword can't execute Server/ClientRPCs if it's not owned by a Client
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
in the BP_thirdperson_character the default pawn
didnt changed
And in what function
sorry I didnt get it but looks like this
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
oh u asking possess?
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
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.
@tulip oyster There is no need to call a ServerRPC when HasAuthority returns true
@thin stratus ๐คฏ thank you its working now
is not alway true on dedicated server , is listen server is alway true
We had that topic already. I explained you how HasAuthority works
If it's false, then that's not cause it's "uncertain"
You are simply doing something wrong
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?
Can i implement network roleback for UE 5 without c++
maybe Players haven't finished spawn it yet, but the UI is already starting to build.
@thin stratus can you help me ๐ฅฒ
this not have a problem . i get problem after join open 127.0.0.1 On dedicated server
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?
Already fix
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;
No, not really possible
Ok thanks for confirming @thin stratus
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?
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 ๐
escape the backrooms is peer to peer I believe, so you would probably want to use Steam's p2p multiplayer feature. https://partner.steamgames.com/doc/features/multiplayer#:~:text=Matchmaking %26 Lobbies documentation.-,Steam Peer-to-peer Networking,-This provides peer
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
If you mean just to test in multiplayer, next to the green arrow at the top of the editor click the three dots and increase the number of players
I mean the players being able to create their own levels and be able to play their own sessions using their own custom levels
Oh, a new FAQ for Iris I believe https://dev.epicgames.com/community/learning/tutorials/z08b/unreal-engine-iris-faq
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
This is relevancy
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 ๐
So even when I set the relevancy to "Always relevant" on client and server the actor still gets destroyed after that same distance
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.
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?
When it crashes its just a tiny white box that says "Fatal Error" nothing else
You'll need to share logs of the clients and ultimately need to hook up your ide to one of them to actually breakpoint the crash.
I doubt anyone can help you otherwise
You want all of it or just the last part with the fatal error?
Usually it's an error at the bottom with a call stack
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.
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
you need to download and install editor symbols
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
Will that work even if my project is just blueprint only?
yes
correct ๐
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'.```
Looks fun, what's that about?
me with my effect context
only assigned 19bytes
19bits*
when it should be 22bits
haha
so it overflowed
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)
no
why would you have 2 seperate projects?
thats double the work and a maintainability issue
plus it wouldn't play nice
Plus the engine/editor provides all the tools you need to strip content from certain types of builds
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!
I assume the "fix" is as simple as assigning it 22bit
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
ye serializers are much more involved now
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!
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?
no worries :)
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
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
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
Try playing it in the editor, in standalone mode
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.
Standalone supports that, yes.
It certainly seems so. You should open the function in your ide and check the line to see what actually causes the crash
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
No worries, glad it helped ๐
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
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
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.
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)
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.
Ah, thanks! This sounds interesting. I will look into that.
It has to be OnRep'd actually, cause this doesn't seem like an Actor attachent
Yes
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?
The better thing to do here is to tell us what you are trying to do.
Relatively sure that runtime Component Creation and Replication isn't something that automatically happens.
You might need to ensure it's created on both sides.
And ensure they are stably named and thus valid for replication.
it is
That includes for reconnecting players
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.
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
IIRC you used RPCs thats why
I thought about that
You should use a replicated array
How would you register them
Cause the spawned Components aren't gonna map to anything locally
then I will do spawn each component again when a new client comes in for all, I think
The Onrep is gonna give you a nullptr or not
Would need to add to the replicated subobject array
Hopefully that's available to blueprints
and the components does have a realtime data inside it
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
I think as a solution is to make it actors
It'd work
unreal dosen't replicate components as it does for actors
Personally I don't replicate weapon attachments when I make them actors, my weapon contains data about attachments and clients recreate them locally
Not for runtime spawned ones no, you'd need C++ to add that apparently
I wonder if Epic would accept a PR to expose adding/removing replicated subobjects to Blueprints
it's an issue if you want to drop the attachment and pickup it (replicated).
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
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?
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?
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.
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
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)
eelDev has their own discord
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
Doesn't matter unless you specifically need some overlap between steam and your save functionality
And also only if that overlap can't be covered by the Subsystem Interface
Gotcha, thank you for the help!
thank you
--
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?
What's the basic structure of Mover 2.0?
a more generalized sequence of moves and corrections?
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
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
NPP is that
it's all variables, boundary conditions, update functions, and dependencies
Isn't that what the network prediction plugin is/wants/wanted to be
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
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
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
No real solution that fits everything
But not in its implementation
I should take a look at the NPP but I doubt i'd ever actually use it
If you ever want to use Mover, you don't really get around it I guess
You gotta at least understand the bigger picture
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
Maybe if I ever get to touch Mover sure
Physics is also driven by NPP by now
I do wanna take a look at it in the future but atm I'm mostly satisfied with the GMC
At least movement
by default?
There are some examples too
haven't looked at it yet
Still trying to grasp how the normal one works
Where is that?
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
The thing that scares me is all the talk of character
it seems like it's still super character oriented
I thought so too, but they have that same component with the follow spline mode on a simple platform in the scene
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
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?
No clue, but it's def better than doing it without it
No clue
Without it works great, just no prediction.
Think not even Fortnite uses it yet?
I will have to use it soon
So I will find out I guess
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
I mean, in theory if you ensure it ticks the same amount of times, it should work fine?
aka fixed tickrate
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?
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
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
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
GMC solves that by having the default simulation mode be an adaptive delay, you see other players a little in the past
Doesn't that make it even worse?
ensures the server can mostly always roll them back to what you saw
But you see them in the past already
When executing your moves
The problem is that you locally predict against something older
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
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
That only works if the Server actually keeps history
it does for the GMC
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
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
yeah i think I'mma stick with no prediction
can't make everyone happy i guess heh
ping lag bad
everyone seeing the same thing good
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
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
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
Here, I started documenting this stuff a bit. For whoever cares:
But that's it for today. Need some non UE time >.>
Object oriented programming was a mistake
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?
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
@summer rover C++?
Yeah, I'd do whatever
So I would say your best bet is the PlayerOptions then
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);
Ok so that FString& Options is it there i assume
was googling for PlayerOptions and couldn't find anything
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
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
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
Yeah, that sounds pretty perfect
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
you getting 60 as client or listen server?
On Listen server, both client and server get a fixed 60 fps.
Sorry.
I've tested it again. Only Server's getting a constant 60.
so not clients.
Solved!
"NetServerMaxTickRate=120
MaxNetTickRate=30"
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.
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?
Just did some reading on it, I think I get it. Yeah NPP sounds awesome. It's like it's own little sim world with a fixed tickrate and the framework for resims and reconciliation etc
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.
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?
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.
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.
Yea I was thinking I should think les OOP and more towards ECS style implementation which I have no experience unfortunately ๐
It's pretty great once you get rolling with it I think
Yes in that scale most probably.
Thank you, I think I should do more experimenting code wise. Hopefully thinks will get clearer.
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!
Never used it but in the SocialParty.cpp
FUniqueNetIdRepl LocalUserPlatformId = GetOwningLocalMember().GetRepData().GetPlatformDataUniqueId();
used for FUniqueNetId
Thanks, I'll try that.
What would then be the FUniqueNetId of the player I'm trying to invite? (I think that's my issue)
I tried using the player's Steam ID but no luck
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 ๐
arent those basically glorified timestamps with some simulation interpolation?
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
Bruh, I just looked into AWS dedicated servers and that stuff is expensive ๐
yeah don't fuck up and generate a million dollar bill your first month
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
Yea I thought there would be actual low prices for small games
If you're bootstrapping then I'd never even ever consider anything beyond community servers
you can scale if teh game gets popular but if you are broke beforehand that wouldn't work xD
I mean TF2 didn't have matchmaking for years and it did fine
TF2 also had a huge advantage to FutureCake. It released a long time ago
Nobody is making Counter Strike 3 from their bedroom solo with a sub $1m budget
OK Valheim then
community servers
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
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
But is this a good approach for the beginnings?
I mean if it becomes popular or I get investors then I would have the money for dedicated servers
sure, but solve that problem if it happens
to buy things in the in game shop
Have you built a game shop?
not yet
Do you know how much work it takes to make an ingame currency system that's not trivially defeatable?
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
Where does the database storing how many coins you have and your unlock status live?
I was thinking about utilizing the steam inventory feature for that
I hadn't looked into that much
you hear about the game that uses steam achievements as its save system?
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
That's why I love community servers.
Someone's cheating? banned
Your inventory? Serverside
Don't like it? Start your own server
Community servers would be unnecessary for small games
Depends on how small
most of my designs revolve around a persistent small server like GarrysMod or Valheim
well 1000 to 10000 people if it goes really really good
probably more like 100 people
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.
If i host my own it would still lead to huge lags if someone is from a different continent
There's like 100 official servers and a million personal
Honestly I didn't understand how that would actually work with the community servers
is it like a community server where people could do mods?
In games where mods are available
It's where you can just download the server like TF2 or Counter Strike used to be or Minecraft or Valheim
can everyone join matches on that server?
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
but people would connect to something at your location
or wherever
My concern are lags
Inventory would be handled on steam so can't be faked really
everything else isn't important
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
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
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
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?
that's Listen
Yea I know
so yeah if the host leaves that's it
plus most peoples internet isn't great for a demanding network load for certain games
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
Hmm I see. Yea the internet connection of the host is important
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
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
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
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?
If the Tags list is different it would point to an incorrect tag.
But how do you make it different? I cannot find a way to add tags to the UGameplayTagManager at runtime or do you mean the FGameplayTag container? Like client adds a tag but the servers version is not in sync?
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
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
Just write a condition into the code on the Multicast to ignore the local client?
If they were the one that triggered the effect predictively.
Not sure I can answer that for you sorry.
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
out of curiosity, and this could be answered from anyone in here, as im simply interested in what people think, but why do you think this is? what is the main aspects that truly are limited when you are solo in a bedroom with no budget other than time?
A hyper-competitive FPS has expectations from the playerbase, most notably, dedicated servers. That costs money.
so the dedicated servers (assuming 100k's of players) is simply expensive?
in theory, would you be able to have a high functioning dedicated server assuming low player count within it?
Well, yeah. That's a lot of players. Just look at the prices of dedicated servers
but the variable that causes the increase in budget would be player count based on what im getting from what you're saying?
Well, if you only have 4 people playing, no point in renting 5 high-powered servers
So yes
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"
Because you're not considering the cost of all of the art, sounds, programming, marketing, etc...
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
And how much do you value time?
Even time has a pricetag on it
scaling a game is costly, we agree there. you can't have millions of players without the marketing/player acquisition/server stuff etc
Just because you don't exchange money with a market or someone else, doesn't mean it was free
yea i agree w what you're saying
but things are getting easier
thus they take less time
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?
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?
In theory yes. But you would still have the issue of collision in case said actor has that
Making a Counter Strike that could support 1 server is already an insane prospect
Sure you can. Make a single-player game that millions of people want
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
Which I guess I would need to solve with a different channel by making player characters ignore it in default and changing the desired character to block it?
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
Just want to be aware of any edge cases I might run into, perhaps I will clamp the ping too
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
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
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)?
Check the log for an error/warning when the player gets kicked
Would help us determine your problem
C++ or Blueprints?
Blueprint is desirable, but C++ is also possible (it's more difficult for me here)
The "best" solution would need C++
I'm assuming you're trying to spawn components at runtime and replicate them to clients right?
Yes
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)
Of course, thank you for giving me the direction where to "dig"
o7
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
Yep, clients arent guaranteed to receive every value
Especially if you change them pretty fast on the server
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 ๐
Hi, it looks like the player info is only being sent to the owning characters and not to other instances. The server cant see the name of the player and vice versa. This is all on an actor component.
https://blueprintue.com/blueprint/819tkr55/
SE_UpdateWidget is called on the beginplay of the character
Really? What would that look like?
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
PlayerCharacter->SetPlayerName(GetPlayerState<APlayerState>()->GetPlayerName());
Is all i have in code
so Im confident that is all you need to do
https://blueprintue.com/blueprint/qxslerjm/
this is what ive done now
that works for sure, the problem lies with connecting to the other actorcomponents
It now only works for the server
client is not getting the data it seems
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
i dont think i fully understand how an actorcomponent works with replication
does each client have an instance of a characters actor component?
every client will have a copy of a player's character
right
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
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
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
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
this should be true
well
depends
how is it made?
spawned? or already pre placed in BP?
pre placed
okay should be fine
Okay I think I got it then, thanks!
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
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
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.
not really much leeway in a server authoritative architecture
Why does this need to be a multicast? Seems more like a "owning client" thing if you want it to only execute on the local player controller.
Because when you add network delay, its unresponsive to the Client
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
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.
Yeah, that's what I'm going for
Not necessary.
yeah wait just saw that part
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
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.
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 ?
Set Actor Hidden In Game is replicated iirc, you only need to do it on the server
Hi how can i create widget on my player controller if he's a dedicated server ?
Widgets do not exist or work on dedicated servers
You should avoid putting any gameplay logic in widgets
Yes but i want to create it in my client player controller
Create it on the client's side then
I got the same result even when i create it in "owning client"
That makes a lot of sense lol. Also, what does iirc stand for? I've always heard it but I don't know it.
if i remember correctly
Send code/errors/warnings/anything that can help us figure out what's going on ^^
Thanks
Should be since they only have their own player controller
However you should just create the UI in BeginPlay() instead of using an RPC
i didn't had this bug before but unreal crashed and now i cannot create Widget in the PC
that's also called on the client
Doing this, i got the issue, accessed none trying to read property "add to viewport"
Don't be stupid, don't click.
You need to make sure you're not the server
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
If your game only has dedicated servers, this would work too yes
i don't have the error but nothing is adding to the viewport
Use the blueprint debugger
First time i use this xD
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)
Here it's just printing the Is DedicatedServer node, so it's never firing the Client Part
This is in your PC ?
Test with is server instead of is dedicated server
i have the same result
Your PC have a C++ parent class ?
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
Let's hope it's not a BP corruption ๐
If you can, test a previous version.
When it was working
I tried with an a version from 2 weeks ago and it was working ๐
Restart from here then, it will be the best solution.
Maybe if i create a new player controller it may work
Okay I continued the test. The object is correctly replicated, only the OnRep is missing... ><
Nevermind, I'm dumb. No OnRep for pointer when the object pointed's value change.
I fixed it, actually i had a gamemode base and switched it to game mode, its was causing the issue
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```
I want to make replicated door whats wrong about it
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.
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
why are you trying to predict match state?
racing game?
Fast paced round based game
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?
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
you using NPP or rolled your own?
not sure what NPP is, but mine is a custom system
Sounds similar to your setup
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)
I'm working on a physics engine, well sort of. It's 1D physics so stuff like drivetrain, power networks, hydraulics, anything that can be thought of as a graph of connections.
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.
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.
What if 2 clients disagree on the match state?
What is this match state, a win/loss?
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
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.
How am I suppose to query the connected clients to a game?
I found this function in the uworld FConstPlayerControllerIterator UWorld::GetPlayerControllerIterator() const
The GameState holds an array of all connected Players PlayerStates.
Thats generally a better mechanism
As its available in all network contexts
Perfect, ty
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.
Sounds like you need an agnostic Attack() function that isnt aware of the weapon
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);
Ah, sorry, I wanted to post in C++ not in Multiplayer ๐
My question is general (not multiplayer-specific).
I'm currently using this solution, which involves a kind of switch (WeaponType), but I assume there may be a more elegant solution by just re-binding the correct function.
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?
Why don't you just apply gravity everywhere
Why the networking
Hi how can i show my player score on a widget ? it's in the playerstate actually, should i use a gamestate ?
The score of a player is state about the player
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.
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)
someone
SetActorLocation() produce a BeginPlay on the Client. Is it something expected?
Letting the weapon handle the attack part, with their own custom implementations ?
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
No
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
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.
We're using an animBP for each type of weapon with its own 'fire'state iirc
Its set when the weapon is equipped
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!
Owning Client?
Then how would you know which client to send to
You call a client rpc on the character/controller that needs the corrections
From the server
can I skip checking if the owner has authority inside a method marked as execute on server?
Yes
Server always has authority
does it still prevent or error out the ufunction being called by raw C++ code?
yeah my scene doesnt use gravity , i only use it on boat to float on my customize water when overlapped.
Nothing preventing you from calling the implementation yourself
At that point you're being pretty silly though
definitely, I suppose it's user error at that point lol
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
yes, should be enough.
delta serialize is mostly for containers afaik
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?
But what If I have a container of the struct
network overhead comes from setting it every second on the server or sending RPC, reading a variable is just regular c++ overhead
setting a replicated value on a client does nothing but change it locally
No
thnks
its not like you get the value from the server each time you get a variable
its all locally
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?
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
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.
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.
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
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?
you're using linux and don't know it's case sensitive?
because the I in Identity should be a capital letter, not lowercase
and VSC? you can get Rider on Linux
yeah after changing i to I it's working but why the same code worked on windows and not working on linux
well it helps to mention which code, but this is more #online-subsystems anyway
I mean the this one
???
also if you're making a native linux client, that's something you'll probably make $0 from
I love linux so when I will need to package project for windows I will switch to windows machine
btw I'm not building this project for money it's just for learning purpose ๐
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?
yes anything marked as initialonly will only be sent when the replicated thing spawns on a client
Nice! Thanks you :)
np
Hello everyone,
Do you know a Game Flow Chart (such as this: https://docs.unrealengine.com/4.27/Images/InteractiveExperiences/Framework/GameFlow/GameFlowChart.png) but for Network ?
In order to determine, whos is first (for instance PostLogin vs HandleStartingNewPlayer_Implementation) and mostly know when the Pawn is ready?
Hey, how can i have my level streaming always visible on server, but only when client fire event it appear for the player ?
has anyone played with mover2 enough to compare it to GMC?
RE RPCs, no
Well, unless you don't care about possible relevancy/dormancy
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!
Yeah multiplayer is a whole different beast and you'll find yourself reworking most of your logic for it
That's why you generally consider if your game requires multiplayer or not before you even get started on it
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
Thank you for the rely. Since I am early in my project, is it still doable? Do you know any tutorials that I can purchase for an online RPG?
*reply
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
Sounds good. Thank you!
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
Hey, how can i have my level streaming always visible on server, but only when client fire event it appear for the client ?
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.
Widgets are not replicated, which means that calling any RPC that is created in the widget will fail. Any RPC must be inside something that is replicated, for example, actors such as player controller
Ah okay, I did not realize that
How could I get the Correct pawn from the Player Controller? Using Get Player Pawn causes the Host to be destroyed as well.
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
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?
wdym? Can you show it?
btw you can use GameMode's RestartPlayer function
It'll substitute everything you have after DestroyActor
Yeah, you have to feed Self
You're already inside a controller, you don't have to get it in any way
Ah, Okay, I thought Self took care of it but the top needed Get Game Mode
Yeah, exactly
Hm, now it's just destroying the character without respawning me?
Check the log
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
Hm, now it's not doing anything? The Event being called is set to Server, does that matter still?
Yes, GM exists server-side only
Hence you cannot call the RestartPlayer client-side
Can you show what you did?
You didn't feed Self into NewPlayer
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
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
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
Widgets are not replicated, which means that calling any RPC that is created in the widget will fail. Any RPC must be inside something that is replicated, for example, actors such as player controller
Okay, well in general, Restart Player, and Restart Player at Start both aren't putting me at Player Start.
Aye, @mystic estuary Thanks for answering. I've created the widget inside the PC but alas, perhaps I should do all the changing there?
Where do they put you?
What does the log tell you?
It doesn't matter where you create the widget. Widgets cannot have their own RPCs
@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
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.
Yeah, essentially move your RPCs from widget to something like PC or anything that suits your needs really. 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
It doesn't make much sense to me ๐ค The RestartPlayer should destroy the pawn, and spawn it in a new location and rotation. I don't think that any component of the old pawn can affect the new one in any way
It feels like it is being destroyed and respawned, but it's retaining it's location somehow. Due to the log, I think it's a plug-in Issue.
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
Are you good with C++? If you are, try to step in the function and see what's going on
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
Nope ๐ I'm not great with C++, but I'll hear back shortly.
Thanks for the help so far though
You're welcome
The widget doesn't have a RPC, unless what you mean is the RPC call to the Player Controller? Is that what you mean?
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
Like so?
I mean, these are the only cases it will call something on remote machines
Not really. Like that you're affecting only the server's version of the widget
Yeah I just tested haha only server could change the number
You have to do a multicast instead, which in turn will affect the local widget
I'm getting Server 1, Client 1, but the number isn't changing haha
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
I guess it has something to do with non-multiplayer code
OKay man, my head is spinnign at this pont
At the moment, I can try just getting this working if it does the same thing. The issue here is I seem to be respawning the Host into the new body instead of the client.
point*
I figured using the game state to hold the variable, it's supposed to auto replicate the number?
Don't use global GetPlayerState. Use functions that return specific objects. Using these global accessors is generally bad in multiplayer
Getting PS at index 0 will always return the listen server's PS
It doesn't replicate anything if you don't tell it to
This code does seem to work
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.
It's weird that the RespawnPlayer doesn't work, but if this works then use it ๐
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
Can you show your modified code?
It's the same as I last showed you haha
This is the widget
This is the player controller
Is OnPressed (B_Play) called when you press the button?
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
How would you do this if you were me?
Step by step?
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
Thank you, I'll study what you said and retry. I appreciate you taking the time to answer my questions!
You're welcome ๐ Gl with the implementation
If successfull, I'll let you know how it goes haha
widgets don't replicate
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
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
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
What do you mean?
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
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
ok so put that on GameState
GameState holds group stuff
PlayerState holds player stuff
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
just use widget binding
I set the game state on construct
so does it work?
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
get rid of those multicasts
Roger, so just a basic no RPC?
In the PC or Widget
make sure you're not doing that
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
show your button code
no don't do that
LOL
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
Dude, I'm so confused, I swore you or someone else told me to get rid of the RPCs and stuff haha
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
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
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.
I like to approach it like this:
1: Make the system and its events/functions, and test it with keyboard inputs and print strings
2: Make the UI, which (this is important) calls those exact same events and functions.
The UI isn't really the code underlying the mechanic, it just talks to that code.
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.
Its just an.... UserInterface
One of the users way of interfacing with the code
is networked movement with the default cmc impossible? a default character with any network emulated latency is completely unplayable
define "correct", as the out-of-the-box character is inately awful
Exactly - you're using the out-of-the-box solution
You have to go into C++ to do this
what is the point of cmc if youre going to have to write custom c++
To not write the other 10,000 lines of code???
when it defines itself as coming with network prediction, you just end up writing 10,000 lines for any meaning prediction then
...
again you act like its already functional when it isnt