#multiplayer
1 messages Β· Page 59 of 1
Yeah I heard that π
anyways thanks. I'll probably go to bed and read some tomorrow. If I got any question is it ok to pin you in this channel?
No sorry, I only answer questions when I want to π
So feel free to ask and I will feel free to answer if I spotted one of those π
okok, np
thanks for all the info today tho!!
cool π
anybody know a cheap way to replicate physics? π currently I am snapping the actor back to a reasonable location whenever it goes too far off from the server. Replicating the physics seemed to be really costly when taking into consideration that there are hundreds of these actors
Physics replication is not only expensive (at least for hundreds of actors physics wise) but also very very tricky
Introduction Hi, Iβm Glenn Fiedler and welcome to the first article in Networked Physics.
In this article series weβre going to network a physics simulation three different ways: deterministic lockstep, snapshot interpolation and state synchronization.
But before we get to this, letβs spend some time exploring the physics simulation weβre going ...
is possible to play online with friends in PIE or do i have to make a shipping build?
Eos can do it
You can also do it in standalone - .uproject -> launch game
And any packaged build can do it, it doesnt have to be shipping
Eos?
Epic online system
what about steam?
Pie wont connect with steam client
ok then epic it is
thx for the hint btw lol
but standalone can connect with steam?
it can
well so far apparently i cant even connect to my LAN session xD
keeps returning failed on finding sessions even though im hosting one on other game instance
ohh derp now it works, i connected the player controller to the wrong pin xD
What makes FText so bad to replicate? Is it purely the size or something else? Because they replicate by ID so the localization still works locally.
It's usually more the idea. Replication is generally done via keys. Text is often associated with other things as well. Like an item name, which also is associated with an icon, a mesh, a class, etc. Thus it's much cleaner to simply replicate a single key that can statically access all of that data.
I get you, I thought it probably was something like that.
And another question, how well does FGuid replicate?
Client can't join to server..How and what can i debug with?
What server saying?
I was working to integrate gamelift sdk using the video series from aws on yt. In the third episode at 7:00 when he executes the command to build ms from the cmd i am getting errors. The docs are very outdated and I am trying to integrate sdk in 5.1, maybe my commands are wrong. Thanks for help guys!
This is the error I am getting when executing the build command msbuild ALL_BUILD.vcxproj /p:Configuration=Release
Anyone have a chat / combat log plugin they would recommend, I think my needs are pretty basic and donβt want to reinvent the wheel writing it myself
Up to where do you support Lag / Packet loss with prediction/correction when do you say "hell no you're out"
im having an issue with multiplayer sessions in packaged game
it finds the session but it shows the wrong player count and name
when i launch game from project files this works, but not from packaged version
though steam shows that im playing spacewar
Your steam id needs to be configured in the config file
in which one?
Google it, i dont know off the top of my head, probably game
i have this in my DefaultGameIni
That 480 id spacewars id
yeah
You need an id you own there
nope you can also use spacewar
You don't 'need' to but I assume the issue right now is that you're running into other people's their sessions (unless you have very specific filters). You're not the only one testing with that appid and Steam/Unreal limit the amount of sessions you can search for.
it only finds 1 session and thats mine
i know because it goes away when i close it
when i do in PIE it works fine
same for running from .uproject
but in shipping build it finds this
Does it work outside of PIE in the editor?
yes it also works when doing "launch game" from the uproject file
maybe it will be easier to use a different online subsystem for now?
ohh damn you were actually right, shipping builds no longer work with the spacewar appid
If you have a primary data asset that gets replicated via component, and the client does not yet have that asset loaded, can you still get the primary asset ID off of it?
I'm not 100% clear on the rules of primary asset data. The documentation says you can still get data from primary assets, even if they are not loaded
im not sure if ure even supposed to replicate primary data assets
They're doing it in lyra
But when the client calls OnRep_CurrentExperience() they are calling sync load
I think that partially answers my question. If they can even call a sync load, then it is replicating or they have some code I haven't seen yet making that work
well when in doubt, just test it
yeah
They don't call LoadSynchronous on that?
My approach just crashed
Even on the server side
The code used to be this:
#if WITH_SERVER_CODE
void ULyraExperienceManagerComponent::ServerSetCurrentExperience(FPrimaryAssetId ExperienceId)
{
ULyraAssetManager& AssetManager = ULyraAssetManager::Get();
FSoftObjectPath AssetPath = AssetManager.GetPrimaryAssetPath(ExperienceId);
TSubclassOf<ULyraExperienceDefinition> AssetClass = Cast<UClass>(AssetPath.TryLoad());
check(AssetClass);
const ULyraExperienceDefinition* Experience = GetDefault<ULyraExperienceDefinition>(AssetClass);
check(Experience != nullptr);
check(CurrentExperience == nullptr);
CurrentExperience = Experience;
StartExperienceLoad();
}
#endif
and I changed it to this:
#if WITH_SERVER_CODE
void ULyraExperienceManagerComponent::ServerSetCurrentExperience(FPrimaryAssetId ExperienceId)
{
ULyraAssetManager& AssetManager = ULyraAssetManager::Get();
/*FSoftObjectPath AssetPath = AssetManager.GetPrimaryAssetPath(ExperienceId);*/
TArray<FName> BundleNames;
BundleNames.Add("Server");
BundleNames.Add("Hybrid");
AssetManager.LoadPrimaryAsset(ExperienceId, BundleNames, FStreamableDelegate::CreateUObject(this, &ThisClass::OnServerExperienceAssetAsyncLoadComplete, ExperienceId));
}
#endif
void ULyraExperienceManagerComponent::OnServerExperienceAssetAsyncLoadComplete(FPrimaryAssetId InExperienceAssetId)
{
const ULyraExperienceDefinition* Experience = Cast<ULyraExperienceDefinition>(UKismetSystemLibrary::GetObjectFromPrimaryAssetId(InExperienceAssetId));
/*TSubclassOf<ULyraExperienceDefinition> AssetClass = Cast<UClass>(AssetPath.TryLoad());
check(AssetClass);
const ULyraExperienceDefinition* Experience = GetDefault<ULyraExperienceDefinition>(AssetClass);*/
check(Experience);
check(Experience != nullptr);
check(CurrentExperience == nullptr);
CurrentExperience = Experience;
StartExperienceLoad();
}
Ah. On the server side you mean. That makes sense. I thought you meant the OnRep.
A data asset, primary or not and like any other asset(like textures or sound), will be loaded when the OnRep is called.
Yeah I was talking about the client at first
but my approach didn't even work on the server, so the client question is kind of useless until I get it working with the server
Where was your crash?
On check(Experience);
it was nullptr. I could see InExperienceAssetId had the right path, so I don't know what went wrong
When OnServerExperienceAssetAsyncLoadComplete gets called, that asset should be loaded into memory...
Out of curiosity. Why the Async load here?
Just a learning experience. The game can switch experiences after each "experience" completes
But it sync loads everything
Hmm. Well you might want to attach a debugger to the server and breakpoint in GetObjectFromPrimaryAssetId. Make sure your manager is valid and that if statement passes.
I'm doing a PIE, but ok yeah, I will try that
Even easier. π
Yeah π
So it looks like
it's finding it, but is failing on this !Info.bHasBlueprintClasses condition
Looks like that is the difference, because in their implementation, they're not using GetObjectFromPrimaryAssetId
That's how I've always converted a loaded primary asset ID into the actual asset, but up until messing with lyra, none of them were BP assets
I guess that's why I never hit this problem before
I'm not sure what the equiv. would be to get it to work with BP primary assets
I guess I could include their TryLoad code, since it would be loaded, it wouldn't load it again anyway
But it seems like there should be a more elegant way to do it than that.
Not sure what that boolean is for. Seems to get passed around a lot, but not really used anywhere other than the Kismet stuff.
Kinda curious if you could just pull the UAssetManager::GetIfValid, and the GetPrimaryAssetTypeInfo and use that instead of calling the static itself.
damn i switched to EOS now and it just works lol
hmmm
does my game actually have to be verified on epic to connect online or should it work right away?
Think that depends a lot on the game type, in particular if a players lag is causing a bad experience for others, I think Mordhau gives a high ping warning at 100ms while plenty of other games are totally fine at 250ms
Mm true, packet loss over 2% is harder than 200ms
Yeah, I think tbh itβs a bit of a business decision and really is going to vary game to game (deciding what level of correction/normalization to provide to people). If you end up spending a ton of time on 0.5% of your player base instead of improving the rest of your game that is a mistake imo
Agreed .. might take a really under 100 below 1% approach β¦ that always is infuriating when games allow huge latency differences
I seem to have an issue where when i login/spawn another player the first one stops working for some reason. Anyone know why this is? (it was created as a blank blueprint project)
I have two projects, one with Enhanced Input and one with classic Input Actions.
With Input Actions, if a client moves they don't experience lag client-side. As in, when they press W or S, they move instantly, just as if they were playing offline.
With Enhanced Input, if a client inputs movement there is a noticeable delay before they move. I imagine this has something to do with the action being sent to the server first?
How can I fix this. I like Enhanced Inputs a lot but this is not an ideal situation for obvious reasons
Has absolutely nothing to do with it.
What setting would be causing the discrepancy then
All replication settings appear to be the same
If there is a noticeable delay - it is either your code or the engine itself. But enhanced input does not send to the server first.
Why would increasing the simulated ping cause client-side movement input delay then
Again - either your code or something in the engine. Input does not get sent to the server.
Gonna try redoing this with axis events to see if it still has a delay
These two are borderline fresh its possible I accidentally enabled some feature or setting somewhere
Yeah both input methods cause the same result in this project
My framerate is great on all clients but as I increase the simulated ping the movement delay also increases. This seems like some sort of setting to me
Nothing "extra" is being sent over the network atm, the only replicated variable is the PossessedCharacter which is just a character reference
Whereas in the other project it doesn't matter how bad simulated conditions are, clients movement is immediately responsive
Sounds like client predicted vs not
Yeah I guess where I'm lost is that in my other fresh project the client doesn't wait for a response from the server to move whereas in this one it does
I'm searching client predicted now or anything I've thought of related to this and I can't find it
Not at pc atm so canβt look
So I'm having some problems.
Basically I have a few delegates inside GameState that call global phase messages like Start Game.
It worked initially fine, but now I'm running into an issue where the client seems to arbitrarily find a different game state object. Depending on when it subscribes via GetGameState(), it may or may not get a reference to the "correct" one that the server calls RPCs from. It will randomly subscribe to some other "dead" GameState object.
It seems to find the correct GameState at the instant of the level loading, but calls (of GetGameState()) after that are to the "wrong" game state.
Top is client, you'll see it creates it's own gamestate for some reason, I used a replicated GUID to track the gamestate instances. You can see that the first gamestate matches the servers.
It could be due to the messages that says OSS: No game present to join for session, but I have no idea what is causing that, nor is there any information online.
My game is on a dedicated server. I want to give myself in-game permission to do things that absolutely no other client can do. Using a login system, I was able to give myself a special designation. Is there a secure, persistent way to save this designation as a boolean that can be checked against at any time?
if you have security concerns
i would put that "special designation" and all its related RPCs into a separate object, spawned only on the admin's PlayerController
it is super easy to just hack a boolean from false to true
good call with the separate object. but how to save the permission to spawn that object between logging in and after the map is loaded? itβs occurring to me that this may be more complicated than I thought to accomplish, since Iβm basically asking how to save something on the server before Iβm even connected to it! noob! π
if you're sending it via login system
gamemode knows if you have permission at the time you log in
before it spawns your PlayerController
so it also spawns the replicated object on the PC
that handles hard travel, override of HandleSeamlessTravelPlayer can handle seamless travel situations when the PC changes, by checking if old one had the extra object, and spawning it on a new one if it does
thank you very much for the advice. I probably should just use a save object in the meantime while I brush up on this a bit more. security isnβt a huge issue at the moment
its not drastically different then what you're doing now
instead of
if (bHasAdminPriviledges) { DoSomething(); } you do if (AdminObject) { AdminObject->DoSomething(); }
does onRep function only called on client when RepNotify Variable changed?
Another client's hand is visible at my level origin eventhough i unchecked the replicate option in pawn
Within C++ yes, you need to manually call the OnRep on the server. For Blueprints it automatically calls on both the Client & Server.
Also @near granite unless you turned off the pawn's entire replication then components will still show up. If I for example add a cube to my character that's not set to "Replicate" it will still do it regardless. The option is for the component internally not sending data.
At least.. For non-runtime registered stuff.
Cubes: For the modest mannequin.
Please tell me I'm not the only one who didn't know you could do this:
public:
UFUNCTION()
void OnRep_CustomVector(FCustomQuantizedVector PreviousValue); <---- PreviousValue
UPROPERTY(ReplicatedUsing = OnRep_CustomVector)
FCustomQuantizedVector CustomVector;
void ACoolClass::OnRep_CustomVector(FCustomQuantizedVector PreviousValue)
{
UE_LOG(LogTemp, Warning, TEXT("Received: %s, previous value: %s"), *CustomVector.ToString(), *PreviousValue.ToString());
}
LogTemp: Warning: Received: X=0.016 Y=0.778 Z=-1.000, previous value: X=0.000 Y=0.000 Z=0.000
LogTemp: Warning: Received: X=0.048 Y=0.778 Z=-1.000, previous value: X=0.016 Y=0.778 Z=-1.000
LogTemp: Warning: Received: X=0.079 Y=0.778 Z=-1.000, previous value: X=0.048 Y=0.778 Z=-1.000
LogTemp: Warning: Received: X=0.111 Y=0.778 Z=-1.000, previous value: X=0.079 Y=0.778 Z=-1.000
LogTemp: Warning: Received: X=0.143 Y=0.778 Z=-1.000, previous value: X=0.111 Y=0.778 Z=-1.000
LogTemp: Warning: Received: X=0.175 Y=0.778 Z=-1.000, previous value: X=0.143 Y=0.778 Z=-1.000
what exactly?
Automatically getting the previous value in an OnRep.
π₯²
All this time of storing previous variables manually while I could have done this and no one told me? π
π¬
I was looking at how OnReps got processed and noticed they give back the previous value x)
I blame Wizard for not telling me π
hello! I made my game features work in multiplayer and was testing it through "Play as Client".
Now when I tried to make one of client host - I noticed many artefacts (like UI not showing).
Im pretty sure this is because of how I checked if player is client.
I used "Switch Has Authority" node for that, and my assumption was that we are Client if we are Remote, which is not the case for Host.
My question is - what is correct way to check if I'm a client and have ownership locally
That's correct. On a Listen Server the host has Authority because it's their local game that processes everything. Usually the way I do it is using "just" IsLocallyControlled if it's a pawn or character and otherwise using the player controller with IsLocalController.
There are also checks for the net mode which I often use, but those are not available in BP. Although there's a generic IsServer node I believe.
Awesome!
And one thing that bugs me for a long time - is there any good pattern to split Server and Client logic?
I feel like it's really dirty to do it through such switches and at the best would like to have it in completely separate places.
One idea that I have for it - create separate node Graph for Server and Client
Another - create custom type which will have Server_BeginPlay and Client_BeginPlay events that are handled under the hood.
But maybe there are better ways?
Thereβs not to my knowledge. This is pretty much how everyone does it. Which honestly would get more annoying in the end because plenty of times you do the exact same thing on the server and client. Unless you use dedicated servers I suppose yeah, then it can get a bit annoying at times.
Thanks for your help, it's really appreciated π
are Advance sessions compatible with android EOS integration now?
I have a problem with the Advanced Sessions Plugin. When I use the "Find Advanced Sessions" Node it always returns duplicate sessions. Same blueprint with the normal "Find Sessions" Node returns no duplicate sessions. I couldnt find anything about this, like why this is happening or if i just have to configure something. Anyone knows why this happens?
is the NULL subsystem a requirement or can i turn it off when working with other subsystems?
Itβs not a requirement, itβs the default but it can be freely swapped out.
im trying to set up online play with EOS subsystem, but when i remove the NULL subsystem, the login always fails
im trying to log in with accountportal auth type but nothing happens and the on failure callback fires
I would recommend asking in #epic-online-services , people there know more about it. I'm not quite sure how it works, but you can definitely swap out subsystems.
thx, didnt know they had a channel for that lol
How do you know its duplicating? what are you doing with the results?
I did multiple things to test it. Without changing anything on the "create session" part i just swapped out the "find sessions advanced" for the basic "find session" node. I added a debug message printing out the length of my "Results" array from the find session nodes
I started the game in standalone with 2 clients. One creates a session and on the other client I try to find the sessions
With the "find sessions advanced" the array length is 2
The basic "find session" node only returns an array with length of 1
I only use a for each loop on the result array and create session widgets to list all the found sessions
I did try the same with the basic create session node and create advanced session node
Results were the same
So I do think it has something to do with the Find Session Advanced node
Well it's probably not "duplicating" in a literal sense. But it does return the session twice
So in my project I have a procedural world where every player is supposed to only receive information about the parts of the world surrounding that player. I read through a lot of unreals networking documentation but it seems like the built in replication features are not really ideal for something like this. Also looked into online beacons which also don't seem ideal at all. Does anyone have experience with similar projects?
The best way to deal with it from what i read would be to have an actor for every client which manages sending only the part of the world that's currently relevant to that player. However I am even more uncertain about whether to use RPCs or work with RepNotifies since I am sending a lot of data and RepNotifies have less overhead, i feel like I'd have to do some weird work arounds to use them though...
Are you testing locally just running 2 instances of the game or testing over steam on separate machines?
I've tested Find Advanced Sessions last night on two separate computers and steam accounts and it couldn't find a session. I was able to create an Advanced Session with no errors. I did not get any errors or anything. Is that due to Steam SDK/Dev ID?
Online beacons are not relevant to that whatsoever FYI.
But your question really depends on the game, a world that's generated through voxels would for example be different from a world generated with meshes. Unreal can support a decent amount of actors with some optimization, Fortnite is a great example of this. A hundred players running around in a pretty much networked destructive game with thousands of actors. Although it's a dedicated server, the concept still stands that there's plenty of room for things. But as a disclaimer this was also obviously made by a team with a lot of engine knowledge, experience etc.
Some things you can look into are for example dormancy. If we're talking about voxel worlds you can find specific data structures online for efficiently storing that data, you could even use the Minecraft 'technical' wiki (or whatever it's called) if you're building something similar like that.
I'm not testing it over steam and both clients run on the same machine
So just 2 clients locally on my machine
Mine did the exact same thing when testing locally, i never did figure out why it done it but it is exactly the same session for some reason, although it doesn't happen at all when its actually online over steam but yeah i think its just a weird advanced sessions thing
thanks for your reply!
yeah, my world is voxel based, technically i already got the data structure isself at a point I'm pretty happy with it. Not quite sure if dormancy is what i need here (if this is what you where talking about: https://docs.unrealengine.com/4.26/en-US/API/Runtime/Engine/Engine/ENetDormancy/). In my case I need to send some data in the form of compressed arrays to the clients and I'm just not sure whether i should use a single variable on a replicated actor for each client that(the variable) i replicate once for every chunk I'd send and then grab it client side via RepNotify or just have an RPC that i call for every chunk.
for fortnite they used their "Replication Graph" but I don't think this is what I'm looking for as i don't need a lot of actors replicated between a lot of clients (https://docs.unrealengine.com/5.1/en-US/replication-graph-in-unreal-engine/) (please enlighten me in case i got something wrong)
They were just some general tips, I don't know how you've setup everything of course so pick whatever you think fits in the end π
In general if we're talking about chunked data and especially stateful data we usually recommend replicated variables as they also deal with stuff that doesn't arrive and new joining players, but if you want to assign that per player the latter doesn't really matter I suppose. If you're concerned about performance for that in specific you could try using "push based variables" as those are a bit more efficient. But I've personally never used those.
In the end it's going to come down to how efficient you can get your chunk data though. Doesn't really matter if it's an RPC or Replicated variable (as both use very little network data) if your data is too big. But I don't know what fits for your game in specific.
Thanks for the reply! Wanted to iron out all the errors locally first and then test over steam, but i guess i will give this a try π
I caught strange thing, when I'm in Begin play of my actor component on listen server - GetController returns nothing.
But then on Tick it returns correct controller
Because of that, listen server doesn't display UI widget, but everyone else does
π±
Is your pawn reference valid? Is your cast failing? You'll need to do some more debugging π
It's correctly used in other places of this component, but let me check
Yes, it's correct
There might be important how I spawn players
It may very well be possible btw that your controller didn't possess your pawn yet when BeginPlay runs.
But how do I track it then? π
Try overriding "OnPossess" or whatever it's called in BP, print a message and see if it runs after or before your begin play.
Yes, it's possessed after π€
That's quite unfortunate
I'm curious what could influence that, since it works fine on client
I believe it has to do with how Unreal handles it internally with networking, either way if you're not swapping out controllers between pawns I'm pretty sure you can override "ReceiveRestarted" or something similar in BP.
Event called after a pawn has been restarted, usually by a possession change. This is called on the server for all pawns and the owning client for player pawns
In C++, there is "AcknowledgedPossession" or something like that. Which is fired on client side possession.
There are multiple ways of doing this yeah.
Pretty sure Wizard and I at some point dove into the code to find a single event for both client/server though. Which if I recall correctly is that restart one.
But this in specific is a really weird system as it's so not intuitive whatsoever. Most stuff either gets called on the client or server but rarely ever both :/
Yeah, Restart is the one.
It worked, but it sucks π
There should be a function override for it too.
So much little intricacies
Yes, but as I do it in ActorComponent, I have to use event dispatchers
Since I'm also trying to follow best practices and keep logic in components
Ah yeah, forgot about that π
Now I need to go and check every component for the same issue π
Also just random but components are not always that great. For performance critical code you want as least components (scene components!) as possible as those are pretty heavy because of the physics/transform updates underneath them. For networking component networked calls have a slight overhead (but tbh this only matters in very specific cases).
But thanks everyone for helping me out again, you make this harsh world better
If I meet that I'll come here and you can tell me later xd
anyone ever used UPathfollowing in client side ? will it work ?
is this normal?
- I have two clients running locally
- both respond to someone pressing Y
- if I'm using one client, and I press Y, both clients will respond to the key press
What makes you say both respond to pressing Y? What happens?
I printed out which objects are hitting a certain function, and I see this:
How are you calling the code?
that seems to tell me that both the actors are hitting the function that's called when I press Y
this is extending the character movement component, and using the custom flags
So from the start, I bind an action
PlayerInputComponent->BindAction("Rewind", IE_Pressed, this, &AShooterCharacter::OnShooterRewind);
then that sets a couple bools to true, which then switches the Custom move flag to "rewind", and in an update, I call a function PhysRewind(), that handles the physics (for our purposes, this is where the log happens)
hope that makes sense
weirdly enough, I'm now checking who triggers the OnShooterRewind(), only pawn_C_0 triggers the function
but for some reason, the log from the above screenshot is definitely from a state where both pawns are doing the physics, which should only trigger if they're rewinding
That still sounds very much to me like something goes different in between, I asked because the engine never 'focusses' on multiple clients at the same time when you're playing. Unless you directly modified the engine I'm not aware of a way to do this either. So you pressing Y should never allow multiple clients to do the same. With perhaps the exception of you finding an extremely obscure bug I suppose xD
Are you sure this isn't simply being executed on both server and client? Those Phys functions get called on both ends.
!!!
that might be it
can I check if it's the server or client with this function? GetOwner()->HasAuthority()
If you're using a listen server authority will also validate true for the actual listen server.
gotcha, well I'm currrently just running a Client, so I think there should only be one server right?
Preferably should use IsLocallyControlled(), however you should not run different behaviour in those things if you ask me for the reason that it will desync the server and client as they are expected to give the same output.
If you set the mode to "play as client" a server is started in the background. But that's not considered a listen server.
gotcha
Perhaps a better question, what is the general thing you're trying to do?
for this specific case? I just want to print if it's the server or client, to make sure that this isn't a different pawn
generally speaking, the behavior is implementing a tracer-like rewind
No as in, what are you trying to achieve with the rewind stuff etc.
Ah I see. Starts Google.
ahaha, sorry, from Overwatch
[SUBSCRIBE FOR MORE OVERWATCH CONTENT]
Hey, I'm Valkia. Tracer has a great ability called recall, some people call it rewind. In this tutorial, I'll show you how to time a recall based on a period of time. It's a great tip to keep you out of trouble, or to get the advantage in a fight.
I hope you enjoyed this tutorial, for more pro tips, guide...
Basically you can just rewind your movement?
yeah
it's actually working, I'm just working out some kinks
this was just something I found as I was debugging π
The methods are called both client/server side because basically all the CMC does is send over the input data (and some other things) but you probably already saw that. But it simulates the movement the same way to keep in sync with what the client did. So if you start up changing that on one of both only it gets messy and you'll likely desync your player and cause it to desync.
That's why I suggested not changing specific things in there based on server/client. But it depends I guess,
ahhh, so maybe, I just say like "print whether or not you're a server", and therefore, the output is the same, but the data might be different?
Well generally you want the input and output to be the same. If the client walks forward you also want the client to walk forwards in the same way on the server.
But yeah, if you just want to debug stuff you can print "is the server yes/no" or whatever.
IsLocallyControlled() should do the trick for that, although probably need to call it on the actual character instead of the component. Could also indeed use HasAuthority() next to it if all you play is "as client" π
anyone by chance know who was just in vc with me about 20 mins ago?
hmmm, okay, that makes sense, much appreciated Thom! π
figuring out what was causing this issue also just led me to resolve a bunch of other problems I didn't even realize I had lol
I do not sorry π¦
Yeah.. CMC can be really tough to change depending on what you want to do. Feel free to ask any questions if you have them, although I can't promise I have an answer my self though. I really hate the complexity of that thing π
seriously
what is cmc nvm found it with google
Character Movement Component, it's what the character system uses for client side predicted but server authoritative movement.
I'm trying to make my own dedicated server apart from unreal engine, and just run threads in the game that communicate with it. Does anyone know of any resources I should read explaining how physics works precisely so I can replicate it in my server?
I'm going to be honest with you, I don't think you will find many or any resources on that as it's pretty advanced. You'll need to use the same physics engine and setup in general as Unreal does if you want to get the same physics as Unreal does. Which seems like a ton of work and just isn't commonly done.
If there was a channel for it, it would be called #reinventing-the-wheel however there is currently no such channel. I would strongly advise against your planned course of action
Is there some simpler way I can gain fine grained control over the netcoding? I don't want it to do ANYTHING without my say so, I want to dynamically adjust the tick rate (and sometimes use tickless communication instead), I want to only authenticate certain actions in certain situations (such as if I send a packet stating client A did an action to client B and client B says based on his gamestate that's impossible/contradicts client B)
For example a situation I want to avoid is where in both clients screens they saw that client B got sot by client A, but the server sees that that didn't happen and over-rules it.
I would suggest brushing up on networking basics, that is a very simple problem to be solved. There are plenty of pinned messages in this channel.
None of that is extraordinary in terms of game design and doesnt warrant a custom server outside of unreal engine
It's really just a case of learning the basics and how to apply them
@verbal tendon thankyou.
So anyone ever thought of a solution to expand vori's generic rewinding component? https://vorixo.github.io/devtricks/simple-rewinding/
This sunday I had a little bit free time and decided to brainstorm over it, nothing came to my mind other than expanding the component into a subsystem that factors all relevant actors to shooter weapon 
i am trying to get an event dispatcher to get called, when triggered by a client, on the gamestate... but for some reason only the server is able to trigger the event dispatcher. Any reason why this would happen? The event dispatcher gets called from the playerstate.
Hard to say unless you provide code that we can look at and analyse.
The first screenshot is on the PlayerState, 2nd screenshot is on the GameState
The server's car will call the final print string in the 2nd screenshot when it overlaps the finish line, but a client doesn't.
Why are all of these events Multicast?
Originally they weren't, but I was told to change them to MC
Did they explain why?
No lol
This is likely your issue BTW
Oh, so I need to get all actors of class and do a for loop?
No
Lets start from the top.
Which of all of these events is called first?
My guess is OC_PS_LapsComplete?
Where is that called from?
It's called Checkpoint1, I didn't share that code, but it's a trigger box at the start/finish line
It's called every time someone crosses the line
Ok well you will likely want to only call that on the Server by guarding it with a HasAuthority instead of it being a Multicast.
Oh
Actually, scratch that.
Keep it as is.
Dont set it to Multicast.
Its unnecessary as all the Cars will trigger it locally anyway.
OK
Next you should stop CheckToSeeIfWinner from being Multicast as well.
Gotcha
Since its being called by OC_PS_LapsComplete it also does not need that since its being called locally for all Clients.
Where/How is this code called?
Event Begin Play on the GameState
Ok, so.
The Server and all Clients have everyones PlayerStates.
Using that node is bad practice as it can return an arbitrary one.
(Depending on join order/creation order etc etc).
You should instead have this being dealt with in BeginPlay on the PlayerState.
That way you are ensuring all PlayerStates when they are created (regardless of order) will have the event.
Alternatively since WinnerDetermined is part of the PlayerState already.
It is likely better to just set that variable in that Event from the PlayerState.
So if one PlayerState has the RaceEnded boolean set to true, it can replicate it to all PlayerStates?
If that variable is set to Replicate, yes.
I see
Remember, the PlayerState and GameState exist on all Clients for all Clients.
Correct, so would you recommend setting Race Ended? as Replicated or Rep with Notify?
Well what purpose is it serving? What information is it trying to convey, what systems/events rely on it being changed?
Keep in mind, I didnt specify that you needed to move that variable to the PlayerState, only how it is set.
Whichever PlayerState is the one to complete the final lap is the one that would be setting it to true.
It can remain on the GameState, since its specific to the outcome of the game itself, not necessarily specific to an individual player.
It's a timely event that lets other clients know that the winner has been awarded, so when they cross the finish line, they run separate logic and not the logic that the winner receives
If there are subsequent consequences for the change of state of that variable, then setting it to RepNotify maybe an option for you to enact on that change.
I'll let you know if this works
Multicasts are generally unnecessary, there is usually a better way to handle things. Sometimes they are useful, but its important to understand when and where.
So that worked as expected, but for some reason, at this branch node, all cars seem to travel through false, even though the RaceEnded? bool seems to be getting set to true
Variable Set! prints when the client finishes the race, but when other people finish the race, WB You Won Widget is getting added to their viewport too, even though they didn't win
Until the server's car crosses the finish line, then the variable is set and people go through True on the branch
This may need to be an Server RPC to set the variable?
π
Hi, im trying to make a 'noise detection' system where it displays a widget at a players last known location, I've got it set up so there is a radius overlap for my BP_Caretaker character class, anytime any BP_StudentBase character enters the overlap it starts a timer, if the player is moving whilst inside the overlap it'll display the noise indication widget every 5 seconds by spawning a separate actor that contains and displays the widget then destroys itself after 5 seconds, if the player stop moving it'll invalidate the timer, if they start moving again whilst still overlapping the radius it relies on the RepNotify to start the timer again, I've got everything working now but I only need the widget to be display on my BP_Caretaker class regardless of it its the client or server who is the caretaker character
So i need the BP_StudentBase character to spawn the BP_NoiseLocation actor as its from their location, but only be visible to the BP_Caretaker character?
@blazing spruce Since this is a local only effect, you shouldnt need any RPCs.
Interesting... If i dont have the start timer event as run on server the host player playing as the Caretaker class wouldn't see the widget when the Student class player would overlap, only the Student class player themselves would see the widget, but what I'm trying to make it so the Student class spawns the actor that displays the widget but they shouldn't see it themselves, only the Caretaker class should
I dont want the clients spawning actors anyway do I? wouldn't I want the server to do that considering the Caretaker class could be a client or a server player
Overlaps can occur on all Clients/Server/Host. So for a cosmetic type event the Client that wants to know this piece of information (Caretaker?) can spawn the Actor as needed.
You just need to work out who should be spawning what and when.
In Caretaker just filter by IsLocallyControlled and then only whoever is the caretaker will do the thing
You have the When (overlap starts the timer on that Client, which in turn does the spawning.)
unless you want everyone to see the stuff
Who, you need to work out as being the Caretaker which would start the timer for themselves.
Thus only spawning the Widget Actor for the Caretaker.
So the Student class is the one who spawns the actor because it works off of their GetActorLocation so I need the Student class to do the spawning, but the Caretaker class calls the start timer event on the Student class when overlapped, which spawns the actor that displays the widget
So caretaker class needs the student to do the spawning but somehow only be visible to caretaker
Every Client will know the Location of an Actor.
Not sure what you mean?
So the Student class is the one who spawns the actor because it works off of their GetActorLocation so I need the Student class to do the spawning
Just because its working from "their GetActorLocation" doesnt mean that others dont have access to that same information.
The student doesn't have to do anything here
In Caretaker:
Get Overlappingstudents -> spawn thingy at students locations
Hey guys, quick question
I created a multiplayer prototype with a listen server config. It works fine and well on my machine but I'm about to start riffling off some builds to friends. Will they be able to see the hosts server fine? Do I need to do some IP magic? I did it via blueprints. Port forwarding? Does it "just work"?
If its listen server using sessions you should be able to find those sessions fine.
So should i move the timer and spawning from student over to caretaker class cause i still need it on a timer?
By "sessions" you mean CreateSession node? OR are you talking about Steams Advanced Sessions? I just used out of the box
Sessions are sessions regardless of what platform.
But yes, thats what Im talking about CreateSession.
Rock on, thanks a bunch!
Everything for caretaker mechanics should be in caretaker
if it's not important for the student to know anything about this whole system then they shouldn't do any of it
Yeah okay that makes sense ima try move it over, only thing is the IsMoving OnRep which is on the student class which gets set on input, that has to stay there right?
The widget displaying depends on if the student is moving or not, if they're not it shouldn't spawn
unless they start moving again
Who cares about input, check if they are actually moving
just check velocity
Locally. Caretaker can just look if the overlapping students are actually moving
I would just have a timer at 5 seconds and every time the timer fires, get all overlapping students, and if their velocity is > SomeNumber, then Do the Thing
Timer -> get overlapping actors by class Student -> for each student -> if velocity > somenumber -> show thingy at Student.ActorLocation
dummy simple
Not supposed to do that with 2 events
Add movement input once
Add the vectors together
You can just read from MOVERIGHT without an event
Is it ok to use the playerstate as net owner ?
I had to set up port forwarding to host my listen server. Wasnβt too bad though.
hey, i want to create a advanced steam session in c++ i got so far: but it wont create a session because a player controller is missing or am i wrong
{
FOnlineSessionSettings SessionSettings;
SessionSettings.NumPublicConnections = 5;
SessionSettings.bShouldAdvertise = true;
SessionSettings.bUsesPresence = true;
// Get the current Steam name
FString UserName;
if (IOnlineSubsystem::Get()->GetIdentityInterface().IsValid())
{
UserName = IOnlineSubsystem::Get()->GetIdentityInterface()->GetPlayerNickname(0);
GEngine->AddOnScreenDebugMessage(-1, 30, FColor::Green, FString::Printf(TEXT("Current Steam name: %s"), *UserName));
}
else
{
GEngine->AddOnScreenDebugMessage(-1, 30, FColor::Red, TEXT("Failed to get the identity interface"));
return;
}
SessionSettings.Set(TEXT("SessionName"), UserName, EOnlineDataAdvertisementType::ViaOnlineService);
IOnlineSessionPtr SessionInt = IOnlineSubsystem::Get()->GetSessionInterface();
if (SessionInt.IsValid())
{
FOnCreateSessionCompleteDelegate OnCreateSessionCompleteDelegate = FOnCreateSessionCompleteDelegate::CreateStatic(&USteamLibary::OnCreateSessionComplete);
OnCreateSessionCompleteDelegateHandle = SessionInt->AddOnCreateSessionCompleteDelegate_Handle(OnCreateSessionCompleteDelegate);
SessionInt->CreateSession(0, NAME_GameSession, SessionSettings);
} else
{
GEngine->AddOnScreenDebugMessage(-1, 30, FColor::Red, TEXT("Session interface is not valid"));
}
}```
Nice, How did you do it?
what is the difference between set hidden and turning off visibility in terms of performance?
are they the same when it comes to draw calls?
configure your router, itβs usually done by typing your local IP into the address bar of your browser
anyone here using iris and have it enabled by default in their engine build and actually get the engine to compile?
MassCrowd module is shitting the bed when I try to compile with iris on by default at the engine level
and UIFramework
Iris is super experimental, I would be surprised if it was stable at all.
its stable enough to use, I just don't want copies of engine binaries for each target that uses it so I'm trying to enable it at the engine level
if you enable it at the project level, it requires BuildEnvironment = TargetBuildEnvironment.Unique which seems pretty excessive
Fortnite doesnt use it yet, Epic doesnt recommend yet either
so?
people are using it. it works. I'm just trying to enable it engine-wide which is where I'm having the issue. I was told that it just needs to be enabled by default at the engine level and no other changes needed. Doesn't appear to be the case though
These are the errors I get and its only related to replication code in UIFramework and MassCrowd
https://pastebin.com/0kwLSHCC
Hello everyone, I'm not sure if this question goes here exactly but I've started to mess around with multiplayer recently and I'm not sure how to deal with this problem.
Are you supposed to have a sort of fixed simulation tick to be able to reliably sync client and server?
What I mean by that is while the regular Tick is tied to the render frame and would be used to interpolate values, this fixed tick would be something sort of like the Unity FixedUpdate where the gameplay simulation only updates say 30 times per second or any other fixed but arbitrary value?
I've read about lag compensation and all sorts of techniques but I'm not sure how to use them if the server isn't ticking the gameplay/simulation at a fixed rate
I could be terribly misunderstanding something, but it's obvious that the server and client DeltaTime are going to be different on Tick, so if you don't use a technique like what I described above the game state would get out of sync pretty fast.
@surreal niche well by default nothing will go out of sync. Are you thinking about some specific feature or problem that you encounter?
Perhaps it's just that I'm thinking about it wrong
But as an example, the movement of a Pawn
If the client is sending an RPC to the server for it to calculate movement, while at the same time calculating that movement on the client (so you don't have to wait for the server response) the DeltaTime used to calculate the movement wouldn't be the same
The Character has a Character Movement Component that you can look at if you want to know how they keep things in sync
Yeah, that was 10k lines long though, and honestly my eyes glazed over. I figured understanding that would take me longer than asking!
I mean, it has to be a rather common problem
The Client usually sends its Timestamp to the Server
And the server calculates the client delta time from that iirc
Or rather the delta time since last move
So, the client and server sync clocks, and then you use timestamps to calculate the delta since the last processed input?
It's a bit more involved. Not 11k lines but it sure is easier to have a look at the SavedMove and Server Move functions
Gotcha, I'll check em out!
Thank you for pointing me in the right direction, I can work with that
It's probably easiest to just start in the tick function of the component.
And then take the branch that runs for autonomous proxy
Which then gets split into client and server (cause listen server is a thing)
Followed by performing and saving a Move and ultimately sending it to the server
Server then calculates some stuff, also performs the move and either acknowledges it or corrects the client
I'll check what the component does and see if it untangles my brain
If corrected you then have the reconciliation part, where the client replays all moves that are newer than the corrected one so the correction isn't too big
There is also a performance improving method in that whole system called CombinedMoves where the client sends one move instead of two if the moves together result in the same destination
But that's usually only being used if the client has more than 60 fps (default setting)
That's kinda all I can give you here. Rest is the CMC :<
Wait, so here's something that just popped in my mind
(character movement component)
That means that the server could be running at 30 fps and the client at 120
Correct
Gotcha! Thanks for all the info
Kinda butting in here, but while on the topic, is the client timestamp different from the server world time seconds held by the game state?
You can always have a Listenserver with terrible toaster PC
I think so yes
That value is replicated and averaged . And then reset once in while (GameState)
There is a pinned post in this channel that gives you some code for a better generally synced timestamp
ahh i see, thanks
I think I'm understanding input incorrectly at this point
How would a 30 fps server handle potentially 120 fps of input?
Could be
Does it queue them? Average them? I should probably toy with that before asking
Networking is really fun but definitely not simple. I'll take my brain home for now, thanks for the help!
Nevermind, I lied, this question is unrelated but I just remembered it.
Say you have a component that handles movement (or it could be anything really), is it a best practice to also have all replication code in there, or should you have a separate replication component?
Epic itself had the replication of the CMC in the character
Idk if that is still a necessary step but I honestly never bothered and just replicated the component
My own that is, not the CMC of course
I see, so in your case hypothetically you'd have a FooComponent that handle both whatever the component does plus it's own replication, instead of having a FooReplicatorComponent to handle just replication.
Yeah 100%
If at all the actor would handle replication
Making a second component for it is definitely wrong
Components usually only do their own stuff and talk to the owner (actor)
UE doesn't have a system to require another component to exist on the actor
It's not the same as scripts in unity
I see, thanks again! My confusion there came from a course that recommended exactly that but I just couldn't see the benefit in doing such a thing
Sounds like gamedev.tv
Hit on target
Can someone tell me when id use HasAuthority vs IsLocallyControlled
or just some examples
IsLocallyControlled -> handle inputs
HasAuthority -> do important gameplay related stuff
it's possible to have authority AND be locally controlled. That's a listen server's pawn / playercontroller
does this have any bad side effects?
like a HasAuth check that wouldnt normally run
Why would it? Just gate your stuff appropriately and it'll all Just Workβ’οΈ
A good setup will work whether singleplayer, listen server, dedicated server, or client
alright cool, im like 4 days into networking so im still nooby ahahj
TIL Async Physics were sneaked into UE 5.1 without any patch notes whatsoever lol.
As an experimental feature of course though π
Wondering why this wasn't celebrated publicly?
π€·ββοΈ
say sike right now
it has no relation to the fact that it runs twice slower
Slower as in?
as in linetraces take double time to compute
That has nothing to do with async physics, that's the chaos engine it self. Async physics are referring to a fixed step physics simulation.
But yes, from what I've heard the physics engine is indeed not too great on performance quite yet.
yeah I meant chaos
which is the one doing the async physics
I mean technically it may in the end still be more efficient than the previous system if you use async physics as you now do not have to bother with ticking your physics as much. Which is lame yes, they should totally fix the performance and I'm sure they will over time π
xD well it is a solution
(assuming you don't set your physics frame rate absurdly high)
better put a very very fast timer instead of ticking that surely improves performance
But I'm more interested in the multiplayer capabilities it gives than the performance.
yeah although I doubt it is enough to have decent deterministic physics - but hopefully I'm wrong
It should increase determinism because of that though, but no it's not fully deterministic. Unreal also will likely never implement that as barely any games truly need it.
However a fixed physics frame rate allows for some cool multiplayer stuff such as better rollbacks and in general even prediction. As an example the way the regular CMC works is really awkward compared to how a fixed frame rate can implement a system like that.
yeah true
Welcome to the club.
https://forums.unrealengine.com/t/steam-subsystem-server-travel/764644
Hi. I am currently on Unreal Engine Version 5.0.3 and I am using the Advanced Session and Advanced Steam Sessions. I have a multiplayer menu where the clients can join sessions. On join session the client joins a βlobby menuβ. On ready up, the server can start the game and server travels the clients to a game map. Whatβs actually happening is...
How unfortunate. I really wanted to make sure my online subsystem framework was all setup before I moved on. Which I may have to do so regardless after reading that forum you replied with.
Thanks!
They just 'completely' broke the Steam sessions in 5.1 and didn't even release a hotfix? Great stuff :/
@fathom aspen I found one of the issues I think why there are no patch notes π
Imagine being able to.. You know.. Actually play when you're the listen server.
Also they straight up put it under a CVar within the CMC, it does not automatically switch over lol.
Not allowed π
I wanted to look at how the CMC handled a specific part of the async physics until I noticed the CVar that I did not previously used x)
Really wish we had someone from Epic who would read this chat. Would be nice to know if they still plan on doing anything with it π
Imagine missing entire functions that were there before ...
cough cough https://github.com/EpicGames/UnrealEngine/pull/10085
Don't mention it.
It just gets me mad because it was working before. 4.26 for the win.
This is by far not the only thing, but it is the one thing that currently impacts our team. And we are not at a point in time where we have devops setup, and can run a custom engine build
They also broke Anim Linked Layers in 5.1 - by making the feature pretty much useless.
Flat out doesn't properly link another anim class.
So yeah you're definitely in a worse position. We still have the luxury to postpone.
Oh yeah, our TA complained about that one, that has impacted so many people
Only way to get it to work is to copy a working version of the node and then paste π
So you can go to a previous install and copy & paste that one to a 5.1 project.
My entire animation system relies heavily on it. It's such a great feature.
It sure is, be a shame if something were to happen to it
π
You guys know the policy for minor patches?
Like, can we expect a 5.1.1 or something?
Β―_(γ)_/Β―
if enough of us tweet @TimSweeneyEpic and complain loudly enough
Poor Tim Baijens
I mean, if we could gather some intel related to these issues to give the manifesto a rationale, I wouldn't be against making some Twitter noise, lol.
5.2 is already a branch on Github, would not expect a 5.1.1 any more.
so i was poking in source code and re writing some stuff i dont remember replicated physics actors being so smooth
did i fix something ? by mistake
i remember on client replicated physics actor are kinda laggy ?
I mean you have essentially no ping in the editor, try turning on an emulation profile and see what that does I suppose.
on emulation profile is set to average
it is smooth ye there is a lag with interaction but this is expected
I have a question regarding switching levels in a listen server/client model scenario. Right now I'm using the async loading screen plugin for loading screens when opening a new level. Now i have added a lobby level that is opened before the actual gameplay level. In the lobby level I use the execute console command node with "servertravel [levelname]" to open the next level. But there is a delay of like up to 5 seconds before loading screen starts and the new level starts loading. Is there a better solution to solving this? Right now I'm working solely with blueprints, but I'm not shy to use some c++ if that might be a solution
This is my current level transition π
Never even thought of doing it this way lmao amazing what having someone else look at your code can do π so I've set it up like this in the caretaker class so nothing happens on the student class anymore.. its mostly working but any client that is a student character will still see the widgets spawning
gate your last event there by locallycontrolled
although I'd lose the event overlap and end overlap
just have the timer run forever, for the LOCALLY CONTROLLED pawn
in the case where the timer fires and there's nobody in the area, nothing happens
Thats a good idea i like that better actually.. so I do a IsLocallyControlled check before starting the timer, would I still need another IsLocallyControlled check on on the SpawnNoiseIndicatorWidget event?
Okay so if i put the IsLocallyControlled check on the timer event and call it on begin play, the host playing as the caretaker class returns false so the timer doesn't get started?
Hey.
Just wondering what is the best way to start creating a server-auth networked game in UE5?
I have a good grasp on networking in general, have worked with lots of tools.
I see that the 3rd person template project has replication, is this also server-auth and client predicted?
Are there any tools that anybody would suggest looking into? I have looked into GAS but unsure if it is suitable.
Would it be possible to just start digging into the blueprint system and create client predicted actions, or would it be best to use C++? (I am not very familiar with the language)
Any help would be very much appreciated!
If you gate starting the timer by locally controlled then the timer only runs on the locally controlled version of the pawn
The most important thing to keep in mind is that this actor exists on ALL machines.
if you want it to do something on the owning machine, gate by LocallyControlled
if you want it to do something on the server, gate by HasAuthority
It'll be both in the case of a listen server but that's fine, just gate the appropriate stuff and it'll all just work
CMC does predicted movement, GAS does predicted abilities
Everything else is up to you
Are there any decent tutorials on using GAS to make an ability that's client predicted? Can't seem to find much, everything is just how to create one.
So ive got the timer event being called from begin play with a IsLocallyControlled check before it which fails, but if i put a timer before the IsLocallyControlled check it works, i know this isn't a fix tho it just means beginplay is being called before something else that makes IsLocallyControlled go true so i just need to start the timer somewhere else thats a little later for it to work.. however, the client who is the student class is still seeing the widget spawned, what am I doing wrong?
And this is the begin play but again im gonna change this once i get the widget not showing for clients to be called somewhere else without the delay ofc
Just do it like this.
Begin play -> locally controlled? -> set timer
Timer -> check for students -> for each student -> spawn the thingy
the thing you're spawning should NOT be replicated
omg its that π
i had replicates ticked on that actor lmao
you're the man! appreciate your help mate
Do multicasts cost less than server rpcs?
Iβm worried about multicasting damage text rather than keeping it only on the client
And how it might affect the load on the server
RPCs all cost similar overhead for just the RPC itself.
You should be more worried about optimizing the data you attach to it, thats what makes the difference between the cost of RPCs.
Same with Replicated Variables.
You want to send as little attached data as you can get away with.
Instead of sending Text itself, send an Integer which represents a lookup ID into a table which all Clients would have that they can use to retrieve the Text they need.
Sometimes you just cant get around having to send something like Text, a chat system for example. Kind of need to send exactly what the Player is wanting to input. And thats OK, because there is just no way around that.
So, damage text would be quite intensive then
Wouldnβt sending an integer for a lookup table be almost exactly the same thing though?
Sending text is far more expensive than sending an Integer. I can only give you generalized knowledge without understanding exactly what you are hoping to achieve.
Well, player hits enemy for 1222 damage, and the text actor floats above their head
For example
Iβm worried about multicasting DAMAGE TEXT rather than keeping it only on the client
Its important to be specific.
You specifically said Damage TEXT
Would be part of the RPC (Multicast)
Sending the damage value as a float or integer would be more performant, yes.
couldn't they just predict the damage that was does? or figure it out themselves
Probably, but we dont know anything about his setup so no point in speculating about what he could or couldnt achieve in that regard.
Remember than the cheapest you can do, will be "burst counter".
Dunno if this is fitting in the context, but if you have rpc who fire really fast (like a gun shooting), this from far the best way to do it.
This isnt related to his question
Oh, he is not asking for sending/receive data in a cheap way like damage ?
The way Iβm doing it right now is multicasting a widget every time the player deals damage
Iβm assuming this is really not performant at all and there are better ways of doing it
Yup -> Burst counter.
but this is really if you need optimisation.
Like for a gun this make sens, as you can send sometime about 20 RPC / seconds (depending of the rate of fire of the gun).
Doesnβt the burst counter assume the widget will be the same every time? The damage text is variable
The damage amount you mean ?
If the damage are deterministic, then you don't need to send the value.
As someone mentionned earlier.
Not sure what you mean
Your damage are random ?
No
Yes, but other clients also need to see
Anyone knows why this returns an Array with 2 LobbyController instances for the server but for the server the host lobby controller is just an unknown class?
Yeah, they can figure it too.
let's said your damage is something like SkillDamage * DistanceFactor * Power (i don't know).
This is value you can have shared on all your clients.
so you can recalculate the damage output on the client.
This is what the server gets in the array
And this on the client
Oh wait.... i think its the own controller thats unknown
I havenβt played around with it(or understand fully) but how would the main client know how much damage the proxy clients are doing if the calculation is done on the server?
Player Controller only exist on authorative and simulated proxy (iirc)
You just redo the calculation on the client.
And your server only need to know that you have attacked.
After, if i can have the context... it will be better to understand, are you doing somekind of RPG ? is it skill based ?
Okay so i assume you have a lot of different skills, correct ?
Yes
Then burst counter are not so usefull in this case, correct.
But you send a multicast RPC when you execute a skill, correct ?
If yes, all your client need to know, is this : what skill has been thrown.
The "good network" practice is : you only send data you absolutely need.
So if you know what skill who has been throw, then you don't need to know the damage output, as you can figure it out on the client.
Let's make it simple :
If your skill is "fireball", you know fireball do 500 fire damage (ex)
So your ServerRPC will just contain "Fireball"
as every client know this is doing 500 fire damage.
and the multicast will return fireball too
Only the skill who has been thrown.
You can attach some bool like bIsCritical bHaveMiss
(and better, you can even compress those data but it's more advanced stuff, and only needed in extensive use of network, like mmorpg)
how can i add some delay to players to avoid stutter (jittering) because in my game players movement is very bad while ping 60 - 90
Do it right.
Are you using Character as your pawn?
How reliable is it to have something like a damage widget popup run in client side using an OnRep_HealthChanged or something? I assume its cheaper than a Multicast?
You mean
OwnerOnly rep condition?
if so definitely better since your other clients (i.e. clients that dont care about that data) won't receive any useless packets.
That can fail though if an update is missed. You'd end up with a few damage instances combined together
I wasnt originally going to use a conditional DOREP because I assumed health was something every client needed to know in order to show a health bar or whatever
Is this still preferred since its only a damage widget (cosmetic)? I just want to be on the right path from the start an not using multicast RPCs everywhere an whatnot
2d character
I don't know your game is about and how frequent you'd expect other clients to receive these health changes notifications, but:
- If it's something really frequent and you're really into responsiveness, etc, do it w
RepNotifywithout conditions. - If it's something really frequent and you want to make sure it never misses, do it w
Multicast - If it's something that can wait a little and a small delay would be fine, perhaps it would be a good idea to schedule these health changes.
And when I say 'frequency', I'm talking about really intense fights where people are losing/recovering health at all times, etc.
Alright, thank you I appreciate it
If this is the case, why not have effects play only on the client instead of multicast?
clients don't know about other clients' player controllers
I mean... you should play effect only on client. I don't understand your question.
i have a question on this but how do you verify cheating if you're doing it like this?
using the health on server side as check?
the client is the one dealing the actual damage so it's the same
if the client cheats he might deal more damage locally but it will never propagate to other users
(nor the server)
So, I've already asked this question in #multiplayer but didnt get an answer. I'm using the advanced steam session plugin and listen server/client model. After packaging a development build I can run the .exe on my local machine and get the steam overlay in-game. When I try to copy all the files to a different machine with a different steam account the game is not able to use the steam overlay and I cant find any games. If I disable the steam overlay and test it locally with 2 standalone games it works fine. So now I'm wondering if there is something wrong with my configuration of the subsystem or if there is a different reason why I cant find a session over the steam subsystem. Can anyone give me some pointers?
The server can't move when the CVar is set?
Do both steam accounts own the game?
You need to use/test with separate steam accounts.
@fossil spoke I did use seperate steam accounts. And I'm still using the developer appid 480. My game isnt yet "on steam" so what do you mean by "both accounts own the game"?
If you are using 480 then thats ok
Are reliable functions have the same performance like if the engine would be using TCP?
So using 480 should work. But why does the steam overlay not work with my packaged dev build on a different machine with a seperate steam account? Is there some configuration that needs to be set? I just made a normal packaged dev build for windows
Iirc you need to include a dll where the game executable lies
I had the same issue with my game. I can check when I get on my pc
https://www.youtube.com/watch?v=UEivY0QcGsc
@wooden abyss
Make sure to join my Discord: https://discord.gg/ShzZjvrExp
In this video i will show you how you can fix your packaged Steam game, so the overlay and everything else works!
Could try this. I remember having to do this
That would be great. I would appreciate that!
I'll give it a look
Ah well it's just about the steam_appid.txt. I did try to add that but to a different location. I'll try this again and see if it changes anything
Fingers crossed for you
If I'm using the listen server/client model do I need to actually add this line? "If using sessions" sounds like I do when I use the advanced sessions plugin π Just making sure cause a lot of older tutorials I saw on this didnt even have this line
; If using Sessions
; bInitServerOnClient=true
In the DefaultEngine.ini
I'd try with first and then without after
I mean, it looks like you wouldnt
Because you're not gunna have a "Host" with a plaeyr who is server
Correct π
therewasanattempt.jpg
Also the entire system is whack. The callback for the async tick does not run on the game threadβ¦
So you have to hook directly into chaos to do anything xD
Wdym? Thought you went to make Rocket League 2 with that cvar
Nanite RL π
Maybe I was a Rocket League dev all along!
Anyone has any idea why Local Multiplayer is not working with a Dualshock 4? I have skip Assigning gamepad to Player 1 but both my controller and keyboard posses the same pawn always
I'll try. Is there anything I really HAVE to do after changing the DefaultEngine.ini? Like rebuilding files? Or is just starting UE enough to get those changes working?
I''m afraid I wouldn't know. I used to work on UE4 a good few years ago but just recently returned the other day to check UE5 out
So I am really rusty. Maybe someone else knows
Well I have changed it now and just restarted UE5 and packaged a build
Will see if it changes anything
Gonna test both settings now π
@red pollen Well, adding the steam_appid.txt didnt change a thing. On my local machine it works fine even without the .txt file. When I start the game I can open the steam overlay. As soon as I copy the files to a different machine with a seperate steam account it doesnt work.
Is there anything necessary for steam to detect it?
I know I could add the game manually to steam and the overlay works but this seems like an unnecessary step
What does your DefaultEngine.ini look like?
Also Steam is actually running right? π
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
DefaultPlatformService=Steam
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
; If using Sessions
bInitServerOnClient=true
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"```
Thats all i added the the DefaultEngine.ini
Yes I actually double checked if steam was running π
Can you try removing bInitServerOnClient and see what that does?
Just saving the .ini and restarting UE is enough for the changes to take effect?
And obviously re-packaging of course
Should be yeah, I don't think you even need to restart the editor as a packaged build should detect the change. But just to be sure I suppose.
I'll try and package again π will be back in a while π
Also try making a development build so you can check the logs.
If you still have the logs btw try and see if you can find something in there. For example something along the lines of:
Failed to initialize Steam
I will take a look
Its weird though cause it does work on my local machine
But guess thats a general problem π "works on my machine" doesnt mean shit π
π
Do I need to configure a development build to log?
Cause I cant find any logs on my packaged game
Or should I package as DebugGame?
Project - Packaging selecting Build Configuration : Development
Maybe
Which is dumb btw. Logs are absolutely invaluable if someone has issues with their game. Especially if you log stuff your self too.
For Distribution is disabled. I activated the "Include Debug Files in shipping builds " option. Will see if that generates logs
That's not really related to logs.
Shouldnt the Folder be called "WindowsNoEditor"? I just realized mine is only called "Windows"
Or did that change with UE5?
Yes
I might try using the actual Development setting and not the "Use Project Setting"
Might be something wrong with my settings
Can you screenshot your "Packaging Settings" (in specific the Project section)?
The default "Development" Settings seem to do the same
Are you using a BP or C++ project btw? Mine just generated "Windows" as well with a BP project.
So I guess that should be fine then π€·ββοΈ
Mine does however have a log inside:
Windows\TestProject(your project name)\Saved\Logs
I did create a BP Project but i have added a c++ class afterwards
Saved Folder doesnt exist for my build
But if you don't have a saved how the heck does your game even run lol.
I dont really know π
Can you try removing your explicitly set build target? I don't think a single project I created has that.
Just wondering if you started the project with Starter Content? Apparently that has some settings ticked to have a Saved folder created? Maybe lol
The project I just packaged to test with did not have starter content.
I did use the Third Person Sample to create my project
I'm packaging without the Build Target now
hello, i am trying to understand why my player isn't starting in spectator mode, i set bStartPlayersAsSpectators = true; in the gamemode, and i am running as a listen server
@torpid girder The spectator system is an absolute mess of a system. Would highly recommend just doing it your self with your own bool (or similar) to indicate a spectator somewhere and running logic from that.
Now it did create a log
Thank you @twilit radish and @red pollen for your time! I will try again and see if the logs help me with my problems π
can't be that bad? surely its just if (bStartAsSpect) {get spectator pawn } else {get default pawn} π
but what would i know
Glad its fixed man. Can be annoying getting this stuff running
I tried to use it at some point, I don't think Epic ever actually used it them selves as it fell apart with several bugs for me within minutes. You're free to try though, as always take people's advice with some salt but it's not complicated to do it your self without the weird system Epic created xD
That's not the only thing it does from what I remember, but it was a bit ago when I used this. But I'm pretty sure it's tied into some more stuff and that's exactly where my issues came from.
Assuming it still doesn't work I would still recommend looking for something like:
Failed to initialize Steam
Yeah first look already showed that the steam subsystem shuts down when the game is started
I just send the log from the other machine over to mine
Gonna check the logs now
Keep us posted
I'm kind of confused after reading the log. Need to test it again and I will come back afterwards. There seems to be some fishy things going on....
Turns out the folder where my wife pasted the files to was protected. Game wasnt even able to write the log file
I'm giving up on async physics for now, what a mess. The callbacks all run on the actual physics thread which means basically no regular movement methods work (Like sweeping with SetActorLocation for example) because those all check for the game thread. Then you run into the issue that actually doing anything requires you to simulate physics, which I didn't want in the first place along with a very unintuitive API. The CMC uses some weird workaround with a callback on the physics thread pushing and pulling data from the game thread(?) and then doing stuff with that π€·ββοΈ
I've pasted the files to a different folder where she had complete access and everything worked fine
Stupid mistake that I didnt realize but atleast I figured it out now π
Nice xD
Thanks again for all your support π
@wooden abyss Steam overlay on 2nd pc?
The client doesn't not apply the damage
You just display them
Yeah it works. Could even connect to a session I created
Brill man! Nice to hear.
Hi guys, what's the best way to synchronize Actors props (like materials/static meshes... that can change during the game) with a new Client joining in after these changes? Is RepNotify the best solution for these cases? Because it seems like i need to replace most of Multicast functions with a RepNotify variable, am i right?
In general it's a good idea to use replicated variables instead of things like multicasts yeah. They first of all deal with packet lost and indeed also deal with new joining players / actors that become relevant to someone again.
Booleans?
If you're modifying the state of the object it should be done with properties
Yeah i mean, if a server wants that an Actor downloads an image and displays it on its mesh, the server should change some variable to trigger the RepNotify on that Actor
yep
Yeah but in my case i need to change something like materials or meshes
You still do it with variables that reflect the state
E.g. CurrentMesh etc.
Using multicasts won't just break late join, it breaks relevancy too
I tried to replicate a uobject, but it seems like it doesn't work
Depends what the object is
A DynamicMaterialInstance for example
But that's also irrelevant for multicast vs property - you can't send a UObject over the network at all unless it can be resolved
You can't replicate those
You can't send them via Multicast either
You send the properties that the client needs to make their own identical material instance at their end
And ideally you find a way to send the minimal amount of info possible to recreate that state
But my problem is if another client joins in
Exactly
How do i recreate the state only for that single client?
The client does it themselves
With RepNotify u mean?
Whatever you need to replicate π
No
Here's an example - if you want the mesh to change colour based on the team, you just replicate the team number
hello, i was wondering, can i replicate a TArray<UStruct> CharacterData ? I can't see it being replicated, as i put a UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_Characters) on the
When the client receives the team number, they set the materials locally
You don't replicate the materials themselves
DOREPLIFETIME(AAvalonPlayerControllerBase, CharacterData); so its configured correctly
Ooh maybe i understood.
Because in my case i have an array of image urls that each clients need to download
Ok so in that case you replicate the URL's
It's an odd case, but yeah that's what you would do
Show actual code. TArray<UStruct> doesn't look right
Should work fine, so long as FAvalonCharacterData is a USTRUCT() with it's own UPROPERTY's
UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_Characters, Category = "Avalon|Data")
TArray<FAvalonCharacterData> CharacterData;
sorry my bad
USTRUCT(BlueprintType)
struct FAvalonCharacterData
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Avalon")
FName _id;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Avalon")
FName character_class;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Avalon|Character")
FString name;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Avalon")
FName owner;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Avalon")
FName hair;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Avalon")
FName actor;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Avalon")
FName skin;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Avalon")
FName gender;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Avalon")
FName race;
FAvalonCharacterData()
{
_id = NAME_None;
character_class = NAME_None;
name = FString::Printf(TEXT(""));
owner = NAME_None;
hair = NAME_None;
actor = NAME_None;
skin = NAME_None;
gender = NAME_None;
race = NAME_None;
}
};
i bet i forget to set replicates = true
I think that also OnRep_Characters should have UFUNCTION() on it
FYI. You can just do name = TEXT("");, perhaps even the empty string literal "". But not sure about the latter π
it does,
How did you check if it didn't work btw? What exactly doesn't work, does you OnRep never get called?
Hey, I'm working with a system that uses Procedural Meshes, so I have one question related to the replication of this system.
So I'm trying to attach a replicated (ProcMesh)actor component to another actor's component. While this wasn't in a networked environment, I could just use the Rename function to change the outer and attach it to the new actor. But in multiplayer, this doesn't really work if I only do the renaming and attaching server side. The clients will get this error message:
UActorChannel::ReadContentBlockHeader: Sub-object not in parent actor.
So I'm curious if anyone has an idea to move and attach a replicated component to another actor's component, so I don't have to rebuild it manually on every client, because that wouldn't be that perofrmance friendly in my case.
hello, i've been working on my replication graph, i am getting an error No ClassInfo found for AvalonPlayerControllerBase, it is very strange as i see IsSpatialized unravels the object inheritance until it gets to UObject and then crashes
So after testing with my working steam subsystem and logging π I found out that the Find Sessions Advanced finds way more lobbies than I was expecting. I'm thinking it probably has something to do with multiple people using the dev id 480 for testing purposes and it also finds all those lobbies? If that is correct, is there a way for me to filter those lobbies to those that are only relevant to me (so only the ones I actually created in my game)? Or do I just have to live with that?
I believe you just have to live with it. I just got my own appid. Easier that way. Going to put it on Steam anyway.
Yeah I want to put it on steam as well at some point but I've basically just started developing the basic skeleton of my game and wanted to implement the basic multiplayer functionality as well and then go from there. So I'm still far from going to steam and dont want to pay 100$ at this point π
Not sure how long this will take or if I even make it to steam
I mean - you can always change the name of the stuff on Steam anyway. So even if not this game, another game.
hello, i am trying to test out my dedicated server, i am not 100% sure what mode to run in, I have a feeling i need to run two instances one server, one client
There are filters you can search by, but I have absolutely no clue if those are available outside of C++ / in some plugin.
Correct. Dedicated servers are a completely standalone application unlike for example Listen Servers. Pretty sure if you run "As Client" that Unreal boots up a dedicated server. But I'm not actually sure if that uses the correct target honestly as it also works in non source build projects.
i get the impress when you play as client you are automatically connecting to the server
If you launch it in standalone mode you can see the actual process. But yes it does auto connect.
i wanted to simulate finding sessions to connect to
There was also another way but I'm trying to find it again.
hang on did UE 5.1.1 drop?
Yeah.
wow i was sure 5.2 was on the cards as the cross compile for linux info talks about a 5.2 release
5.2 branch exists which is why it's weird yup.
Also you can launch a server through this:
"C:\<YOUR INSTALL PATH>\Engine\Binaries\Win64\UnrealEditor.exe" "A:\MyProject\MyProject.uproject" -server -log
Just run it in some console with the appropriate paths π
You see any patch notes for this yet?
not downloaded the source yet
The 5.1.1 Hotfix is now live, with over 350 fixes for Unreal Engine 5.1! Feel free to discuss this release on the 5.1 Forum thread. If you experience a bug with the 5.1.1 Hotfix, please follow the How to Report a Bug guide to report it on the Bug Submission Form. Issue Summary UE-168544 Audio works with only one Media Plate Actor UE...
Oh hot damn. Finally.
Noice
This patch should also be what fixes the anim linked layer issue
Hi, can someone help me with that?
I have a function like this
UFUNCTION(Client, Unreliable)
void ClientApplyWindForces(UVehicleMovementComponent* VehicleMovementComponent, TArray<FWindForce> WindForceList);
Does it actually not compile or is it just the error from your IDE?
It does not compile
What is the compiler output?
(If you're using VS it's underneath View -> Output)
How have you defined the method inside the cpp file?
Even empty it throws the error
I tried to add const but I can't
As in not the implementation but just how have you defined it?
const TArray<FWindForce>& WindForceList
void UVehicleForcesComponent::ClientApplyWindForces_Implementation(UVehicleMovementComponent* VehicleMovementComponent, TArray<FWindForce> WindForceList)
{
}
let me try
it compiled, thanks!
The forum post I found lied to me π€£
the weird thing is that I tried with * but gave me the same error
- is a pointer. Not a reference.
Why go to a forum post when the error was right there π
yeah but why the pointer doesn't work?
Because thems the rules
Epic Games being Epic Games I suppose π
Because my 'big brain' thought that wasn't an enforced restriction. Like it totally makes sense. But the forum post I found was complaining about the wrong implementation xD
idk - seems pretty enforced to me π
I guess I just have never had to pass a TArray in a RPC π
well thanks guys!
Unless the word must is just a suggestion these days π€£
Mustn't π
"Must on Tuesdays"
Sounds like a question for Zlo/Jambax
anyone had a problem with camera lag with high velocity vehicules?
Lag as in FPS, lagging behind the vehicle in position?
Also are you sure your camera is not marked to replicate the position to the owner?
Spring arm is not replicated / camera is not replicated but when accelerating I can have some weird jitter happening
And it's not the vehicle it self at that point that jitters?
if no cameralag no problem (that's a ship but that should the same)
ok did my own cameralag and now it's working
I dont know but I might have an idea based on my journey with Blueprints VM
When you pass by reference, you copy the adress of the FProperty
at least on VM side
So replication framework might trying to benefit from that thing
It might be to just prevent the TArray from copying the internal data tbh. Regardless of blueprints.
Ofc but I believe its also related with how reflection system works rather just trying to avoid copies
Blueprints VM is also tightly coupled with FProperty system i.e. reflection system
so I dont mean the BP graph there
the system runs everything basically
Hi guys, I have some down time at work and want to throw this question out there, if you can't answer it without additional details / blue print screenshots etc., no worries, I can ask again later when I have access to my project.
I'm trying to wrap my head around some bits of replication. I have a bool stored on my character called isCrouching that I check in my animation blueprint to run my crouch animation (couldn't get the crouch / uncrouch functions that I'm aware are replicated by default to work). But using my variables (set to replicated), my character crouches, but in a multi client environment, both characters visible on the client I press my crouch key on perform the crouch animation, and neither character on the other client do anything. I feel like I'm missing something key here to get only the character pressing the key animating on both clients. Does anyone know what I might be doing wrong?
Im guessing you have getcharacter[0] wired in your blueprint update animation
Which makes both characters read crouching state from local pawn
Hmm, yes you may be right, I believe that is indeed the case
Use TryGetPawn instead
Roger that, will try that when I get home today. Thank you very much
Surprisingly enough, I haven't dealt with a shotgun weapon type yet. I had to actually deal with it last night. I don't like dealing with shotguns in networked games. That is all.
Like...I get it - just grrr
Get controller/character/pawn[0] is dangerous until you understand it, but TL;DR; is that it evaluates differently on each machine
does UE_SERVER work for listen servers too?
the comment above the declaration implies only dedicated servers
Pretty sure it's only for dedicated servers yeah. There's however WITH_SERVER_CODE which can be used with both.
Thanks!
Although I think the purpose of the latter is mostly to just strip out code whenever you aren't using multiplayer whatsoever. Probably for smaller build sizes or something? π€·ββοΈ
So kind of depends on what you want to do I suppose @unborn nimbus π
making a plugin for single player and multi
Really wish those defines were better documented :/
so just need to handle both cases
It seems to suggest that it's false with a "Client only" build.
Gets whether this is a client only (no capability to run the game without connecting to a server) platform.
Not quite sure when that's the case though.
i have this in the PlayerController...very simple code to show an attack hitbox outline when a player attacks...why doesnt it replicate to all clients? character and hitbox are set to replicate. only the client who attacks sees it, and the listen server
all clients see the print string
Because player controllers are not replicated to other clients except the owning client.
You can for example use the player controller to RPC towards the server but you need to execute that multicast in for example the game state, player state, pawn or whatever is visible to all clients and makes sense.
damn really...its so confusing...ok thanks
It will make more sense once you have done it plenty of times. But it's indeed not always obvious in the beginning what exactly is available where π
in my FPS i put the RPC code in player character and it all seemed to work pretty good
obviously i still dont understand it lol
Your player character is owned by a certain client but is replicated to all clients. So that can work just fine in general.
The rules are pretty simple in this regard:
- A client can only call a server RPC on an actor that the specific client owns. So their own player character or player controller to name some examples. They can for example not directly call a server RPC on the game state because they do not own that actor despite it being replicated to them.
- An actor that is not replicated or relevant to certain clients can not receive any updates like RPCs from that actor because it simply does not "exist" from their perspective. This can be implemented per actor though and may take a bit of time to learn which exact actors are replicated to who.
thanks for your help Thom ππΌ i have lists of these kinds of rules and still dont really "get it" but i'll keep going at it
Just keep going and you'll get it eventually π
Practice practice practice.
Can't tell you how many times I've started a super small project because I didn't understand something at first. No shortcut about it. Practice.
that's a good one here's another https://www.conanexiles.com/wp-content/wiki/2908586013.html
Will forever be my loved one π
i like, very good
Yeah, I was actually looking for a way that just grabbed 'self', didn't find anything right away, and the zero index had me thinking that would always be ordered in a way that your local client would always be 0, which I guess could still be the case, idk, gets so confusing when I start looking at things in a multi-player perspective
I've managed to get a dedicated server running, however i can't see data being replicated to the client
Hey, one question about actor dormancy - I set netdormancy equal to DORM_DormantAll. Is it normal that struct (replicated using onRep) with NetSerialize() func in struct is replicated to clients? My actor wasnt "wake up"
You need to provide more information than that
Nothing to go on
sorry i went down the rabbit hole trying to figure out what was going on
Ok general performance/planning question.
I've had variations of this conversation before but I'm old so I'm allowed to repeat. I'm working on an open world coop shooter, featuring combined arms warfare, tramways, turrets, reusable rockets (thanks Elon). I'm pretty good at writing efficient BP code, and I can afford to convert heavier functions to C++ later in development. Map size is 1x2. AI behavior is somewhat standard. So far the game runs well at a steady 120FPS in editor with AI.
So here's the question, which may require a longform conversation (I can paypal you a coffee or 2).
Should I try for Listen Server or Dedicated Server setup?
Host costly really are Dedicated Servers?
How much would a Dedicated server impact the player count?
Because it's "combined arms, I'd like to have player counts as high as possible, hopefully in the 20's or more, but solo-playability and lower budgets are also nice. Assume I can spend around 100k closer to launch.
Arm-chair-general advice is appreciated
if i run UnrealEditor.exe Avalon.uproject -server -log, am i running the development server?
I would kind of assume so. But I'm not 100% sure, would be really weird if it used a different target though.
The question as to whether or not you want Listen and/or Dedicated should not be based on your performance expectations.
Its more of a question of what type of gameplay/genre your game is.
Is it session/matchmaking based?
Also.. Rather if your business model can afford it too. If that's not the case it doesn't matter because then it's no option. They are expensive π
Well there are some modulations I'm already considering, the genre can slightly alter based on the server setup, NO matchmaking, more like searching lobbies as in the old days of gaming
There is a Game mode that is session based, and a Game Mode based on permanent worlds
i liked server lists more than match making
Either one fits what I'm doing
If thats the case then you maybe up for supporting both.
Mixing modes like this is a recipe for disaster.
Well I do prefer permanent worlds, but if the player counts are lower I go for session based
I'm happy either way
i persist my world in an external service
As they mean multiple things
just can't get the states to replicate down to the client
Ok so if clients are running listen servers, the game is easier to make, but the player counts for battles are lower.
Sure, that can be true.
If I run dedicated servers, I get bigger battles
Potentially.
surely if you go dedicated that is a game design choice
you are not tied to a player hosted machine resources
where was the right place to handle Connect Failed or connection lost ?
GameInstance
It has an override event that notifies you of network errors
It's combined arms shooter, touches of Overwatch and Planetside, but some players in the back are also sending artillery and rocket-borne-supply/turret drops, so that whole combat dynamic makes more sense with more people.
I'd directly recommend a DS model
Ok but you kind of should be targeting a solid number when designing a game, you cant just say "we will support as many as we can" because you wont know what that number is until later which means all of what you have designed might not work with that final number.
@fossil spoke ?
100 would be Sex
Ok well the next question is then can you manage Listen Servers to support 24 players.
Which is unlikely.
My advice.
Support both.
But focus on Dedicated
Make sure your systems work in a Listen Server environment, but focus on working towards your target (24 players) with Dedicated.
and in listen servers you might want to offer host migration.. and in Unreal that's complicated to implement. I encourage following the strategy Matt mentions
This way, you can at least test gameplay design choices on a cost effective listen server, before committing to large scale tests that might cost money on dedicated servers.
Ok
@rose egret Engine.h has two events you can use if you like.
OnTravelFailure()
OnNetworkFailure()
or justNetworkFailureEventandTravelFailureEvent
I had considered that approach to be poisonous, but you are making it sound nice to just keep both options alive, but aim for Dedicated, which is honestly more of what I want. Thanks all.
Please DM me your paypal for your coffee.
@twilit radish ya I saw them now I gues they are better than GI