#multiplayer
1 messages Β· Page 102 of 1
ohhhh hmmm
Or any of it really.
you're right if i call this in an onrep
No game mode on clients.
It will also run on the server, though.
For every client that joins.
Which graph is that in?
Lobby player state
That'll run on every player for every player too then.
As every player state is on every player's instance.
I would move your update call to the game state or something π
can i do a check to see if this is the local playerstate?
tbh, you do want it to update if another player's state changes, though.
well if any player state changes it notifies the GM
that's where the update function lives
What does the update function do?
and that loops over all PCs and tells them to update UI
No need
this is the current flow im trying to implement
but if thats wrong that'd be great bc it's not working lol
that will run for every connected client as well?
Every client (and the server) runs begin play on every actor, even the other player's player states.
So you're binding that event on everyone for everyone.
You just need to trigger a UI update from that event.
wow works perfectly
π
thank you so much
np
hmm still a bit weird (changes from the server dont propagate now) but I think i can figure it out
Btw
I wouldn't use a boolean for your team, it means you won't be able to change it later on if you want to expand how your game works.
I'd use a uint8 combined with an enum or macro.
#define TEAM_SPY 0
or enum ETeam { Spy. Merc }; etc
Even if you didn't want to add more teams, you could add "flavour"
e.g. teams could be spy, merc, elephant, leprechaun, etc. And you just pick 2 for each map.
(team 2 vs team 7 still makes sense and would work with a uint8 up to 255 teams)
Or, if you want to make it even easier to identity things, use an FName!
yeah that makes sense
just checking here this seems right, no? should run once on each
its the same when i do it from the client, which works
I'd add a bp to the onrep in c++ and see if it fires twice each time you change something.
Or a UE_LOG
how to fix host being able to push clients around by walking into them?
When testing multiplayer in client mode with network emulation off, clients still report to have 30-40 ms ping, is this normal or is this a sign of something wrong with project setup? (Profiling reveals nothing as far as I can tell)
Another question, I need an animation BP running on the server to synchronize with the client so that the client sees the server's current animation pose, accounting for latency. What would be the best way to do this, ideally within the animBP?
oooof. YOu sure?
Are you saying client needs to see server pose in real time (before any information about that pose could have made it over the internet)?
There's an idle animation for the character holding a laser weapon, when it shoots since the animation is out of sync it'll cause visual desync to players with higher latency
Tell them to get better internet
though this is with the free 3rd person anim pack from back in UE4, we don't have an animator for the project but I'm thinking it would be better to use seeded random procedural generation instead
ok so you don't need the client to predict the serverside pose, just that the animation is synced with the shot direction
Can't tell local network emulation to get better internet...
client seeing server late is fine, as long as it's ping ms late
Assuming you have a good enough network clock (there's a built in one but it's kinda not great), you'd just have to sync up the animation start time
Both server and client need to agree that the loop started at GameTime of 30.235
clients 30.235 is later than the servers but that's fine
Right now I was trying to sync by the client ping as the difference in start time but the player state doesn't report its ping until after the animation starts playing, though if GameTime is synchronized between server-client that could work as a better start time
What about this network clock? Is there some docs info on this? I did bump up the server tick rate
It's just a get game time of some sort
oh ok
Returns the simulated TimeSeconds on the server, will be synchronized on client and server
UE just crashed a few secs after opening just now, but from testing I would say it's up to a half second off when network emulation is on (ping reported at 120 ms). When net emulation is off (ping reported more like 30 ms, hence the question before the one about animations) the animations are much more in sync as expected, wouldnt probably be noticable in that case in normal play
Yeah that's what I mean
that's fine, as the laser shot will lag behind too
The problem you have right now is things aren't synced up at all, the loop is starting at completely different times
I think using GetServerWorldTimeSeconds to sync the start points is probably what I need, I'll see when I'm working on it tomorrow
YEah I'd do something to the extant of:
BeginPlay:
LoopStartTime = GetServerWorldTimeSeconds (replicate this)
OnRep_LoopStartTime
AnimTimeOffset = LoopStartTime - GetServerWOrldTimeSeconds
now how you'd use the offset, I have no clue. There's gotta be some way to offset a looping animation somewhere.
Sounds like hell tho, I'd just not have an idle that you can fire out of, I'd snap to some aim pose
Yeah I figured that, using the starter pack animations isnt that great for this project, I'll probably work with a new arms-static idle animation and then apply a random aim offset that can be synced server to client based on GameTimeServer sometime in the future
Hey everyone, I'm running into an issue where I'm using the "Event UpdateCustomMovement" node, which triggers just fine normally in singleplayer or on listen server, but when I switch from listen server to dedicated server while playtesting, it doesn't trigger. I've been scouring the web all day and haven't been able to find a reason as to why certain events won't trigger in the dedicated server play mode. Any ideas?
Is the event working when you play as client in editor?
so when i play with client and server in the listen server mode, it triggers, but when i switch to dedicated server mode, neither clients trigger. I'm testing with 2 players.
i thought it might be something related to the controller, but i can still look around, the update custom movement event just doesn't fire
Are you setting the movement mode to custom somewhere?
yup yup
Cause as soon as there is code from you involved you gotta share that as you could be doing stuff wrong there already
custom mode works just fine in the normal mode, and listen mode, just not dedicated. I even check to make sure that the movement mode is set to Custom when I begin play.
Update Custom Movement triggers in the other two, just not dedicated
ill share a screenshot here in a sec if that helps
This is net mode Play as Client
This is with Play as Listen Server
Keep in mind I'm mostly experimenting here so there's some goofy stuff going on (like unnecessarily casting every update), but my main concern is why the event UpdateCustomMovement doesn't trigger during Play as Client
So
What is the "CustomMovement" thing?
Cause it's replicated and you are instantly using it, so I assume you made sure that whatever is replicating there is actually valid?
Also you are using the Controller on BeginPlay, which is wrong
BeginPlay is not guaranteed to call when the Character is possessed
Especially not in Multiplayer
You have to call that in something like OnControllerChangedEvent and limit it to IsLocallyControlled
Besides the point, but when seeing this I gotta assume that there are more problems caused by wrong multiplayer code
CustomMovement is safe to use like that only if its a subobject of the Actor whose graph that is
So if you're referring to the Custom Movement node that has the enum, it's an actor component attached to this Character
Yeah, I mean I guess even if the Replicated Enum is "wrong", it's still custom MovementMode I guess
I wouldn't know why that would not call if you are a Client of a DedicatedServer
(the top part that is)
as for controller use - 2 scenarios
1: Server - if the World called BeginPlay, you spawn the Character, Character calls BeginPlay and after that its possessed - no Controller yet
2:Client - if the Character Actor replicates before Controller, that also fails
Yop
Gotcha. So what should I do to ensure that the Controller comes first? Is there a specific piece of documentation I can check out?
ideally APawn::OnRep_Controller (c++ only) or overriding AController::SetPawn (also c++, prefer this option, as SetPawn is called from both Possess and OnRep_Pawn in COntroller)
so with SetPawn you don't need to handle server and client cases separately
Alright, I'll take a look into that. In general, it seems that replication and doing anything related to custom movement is incredibly hostile to blueprints.
well, doing any serious prediction with custom movement modes, like dashing, climbing, wall walking... etc
requires you to use a custom CMC class with custom FSavedMove class to carry those extra bits of information
and that is also c++
That makes sense. I know delgoodie has a really comprehensive series on youtube but I haven't really gone in depth with it yet as it's pretty long. Do you know of any other series either written or video that are worth checking out?
always worth checking pinned messages on this channel
Ah right, my bad. I'll check it out. Thanks!
There is also "OnControllerChangedEvent" or so in BPs
Which you can override
Also calls for Server and Client
when testing networked code. what is a good range to simulate latency with
There's no hard answers really, but a typial usage might be 1-2% packet loss and 100ms latency. The editor has presets for "average", "bad" etc.
It also depends a bit on what you are trying to test.
I often disable package loss, cause it's not like I can do anything about it anyway.
I haven't really had to fight with package loss yet, cause UEs networking handles this more or less anyway.
And pings over 100ms can already be seen as unlikely, but you can of course also go up to 200ms, just to see how bad it gets.
Like, if you notice something on 100ms that looks like an actual bug, then 200ms might help you repro it better or just visualizing it better.
Doesn't necessarily mean that you expect the game to work on 200ms
(although, without packageloss, 200ms should theoretically work as well as 100ms or 20ms, just with a higher delay)
thanks. that all sound pretty fair.
im testing a health system and so far even if i crank it up to 200. it just runs a little slower. everything seems pretty airtight.
but its cool theres a packet lost button. i didnt know that.
Pointers to objects are replicated by assigning a NetGUID to the object. When you "send a pointer" to a replicated or net-addressable object, that netGUID is what is sent.
Every Server/Client connection has a unique mapping of NetGUID's to object instances.
How this might be possible?
Only the properties you mark as replicated
If the object is not statically addressable (i.e, via path name), or spawned at runtime, then the network system sends the object class so that the client knows what to spawn.
For example when an actor is spawned at runtime and replicated to a client, the first packet will contain the class. Either as an FName path or another NetGUID associatted with the class, so that the client knows WHAT to spawn. Then any replicated properties can be read-in after that.
Nope what you suggested is fine
Only if they differ from the default-serialized values
The server does everything it can to only send a property if it's actually changed.
What you suggested RE replicating a pointer and an OnRep is fine.
The object replicates independently of references TO that object
And note that by default UObject does not support being dynamically spawned and replicated, that requires extra work
Only AActor + UActorComponent support that out of the box
In the case you described, the OnRep will fire whenever that reference changes (e.g, becomes valid, becomes null, or changes to another object), but not when a property within that object being referenced changes.
For reference π
There are some nice QOL changes in UE5 and above that allow you to skip requiring a special actor/component:
https://forums.unrealengine.com/t/using-the-replicated-subobjects-list/727659
That post suggests you also need to somehow maintain the list of objects on the client, which is false.
Classic UE documentation
Im a bit confused, im getting a warning when RPC'ing from PlayerState, about no owning connection... I thought this was owned by a local controller, and should work ?
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_PlayerState_C_0.
Yeah usually that would work fine. It might be that the Owner hasn't replicated when you are calling the RPC?
It definetly has replicated by that time, far into gameplay ?
I suspect its related to the invoker but im not really sure why, or where i've misunderstood this π
Invoked directly from a Widget
Yeah in which case it should work. Are you sure you're calling it on the local players' player state and not some other player state?
You only "own" your own
I'll walk up the tree and verify, but pretty sure it can't be anyone else's
Yeah you want Inventory replicating from Server. How to deal with stacks vs items etc is up to you. The way I do my inventory entries is:
- ItemDefinition (static data asset)
- Count (1 for non-stackable, # for stackable)
- Instance (either null, or some other object that represents the item, e.g. weapon actor or w/e)
Jimbux
Like fortbucks but more useless
Hmm. Owner of playerstate is nullptr,
RIP in penguins
so does that suggest others?
yeah
damn
Probably belongs to another player
On the Server/that player, the owner would be their controller
I had pretty weird bug, client camera is facing wrong direction and replication is not working on client but in view its okay,
When restarting a pawn (respawn through gamemode) only the server will execute OnPossess, it doesn't happen on the client owning that playercontroller, does anyone know a solution for this? I need to reset some stuff in my PlayerController but the reset is only triggered server side (from OnPossess)
ahh damn, I thought if I ever annoyed Laura I could just go hide in multiplayer where she cant find me, my plan is ruined.
I actually have some strange issue thats been bugging me. If I play as client, with 2 standalone games everything works as expected. But if I play as client with 2 pie windows, actions on one happen on the other client, even tho there is no RPC code on that function. so I have a widget with a text input, the onentered delegate seems to fire on both PIE clients, but there is no reason it should as there is no networking code on that function atall, and when playing as standalone clients this does not happen. So if it was a rouge RPC it should happen on standalone aswell, so PIE with 2 clients has strange behaviour, standalone with 2 clients works as expected.
Hello, how can i disable server correction for character rotation?
it makes my rotation stutter during movement as my player faces the cursor in top down, doesn't need to be corrected by the server
The problem is serializing/replicating it. Structs don't really support inheritance since they are stored as data, so you end up slicing
Also this - only the elements you change are serialized, even with standard TArray
The difference is that FFastArray doesn't preserve item order, and uses a custom ID for each item, so that removals/additions to the middle of the array don't mark all subseqent objects as changed
There's a million ways to appraoch inventory though, generally. I've landed on something now that's flexible and performant so I'm happy
I strayed away from that. My item definitons are Data Assets
Well in my case the instance object is optional - it might be nothing, it depends on what class of data asset the definition is
My approach was that the inventory doesn't care what's in it - the data asset acts like a "factory" for creating/removing items, and the item has all logic self-contained
I'm planning to release it, just CBA to go through the hassle of making sample projects π
100% correct. Went the wrong route in BP which led to this issue. Sorted it by using Owning Controller -> Player State , instead of the devious "GetPlayerState(0)" . Thanks
You can use the bulk-editor for consolidated editing. It's not perfect but it helps.
That's what we do yee
calling a server->client rpc on begin play on a player controller doesnt seem to work
if I add a .1s delay it'll run it though
I'm guessing there's another event that should call the rpc instead of begin play, what's that called?
Are you trying to send data to the Client?
to do something on the client
after the server starts initing specific stuff
that stuff is replicated
anyone got an idea on this?
I just give literally everything a unique ID, its all stored in a db then I just recreate it from the json data. Having unique ids is good for many reasons imo
I would usually put an ID into the asset itself, and the asset manager builds a map of them by finding them from their primary asset ID. ANother approach is to maybe hash the primary asset ID or something
I usually use a Tag
And the FName for the ID
Then I can query things by Type.ID and also generally reuse the Tag if needed.
Also saves my butt from typos
There's the option of OnRep
welp seems like no solution for disabling server correction for player rotation, but i got another question
How should i deal with prediction of spawning some replicated objects? So the client spawns an object locally instantly and later gets replaced by the replicated one once thats spawned on the server
Predictively spawning Actors has to be coded by you from scratch fwiw.
If they are moving, like a projectiles, you also want to "forward" the location by the latency on the server
thing is the property is modified after begin play aswell
nope its just buildings in a world
OnRep calls whenever the property is changed by the server, and replicated to the client(s) @ebon zealot
making a tower defense
The base idea is to spawn them on the the Client and then on the Server. When the Client receives its copy you gotta figure out a way to map them to the local version
yes I only want to call a specific thing when the property is modified in begin play
I dont want it to be called every time it's modified even outside of begin play
No OnRep is called during BeginPlay
I donβt actually know what you are trying to do, but the postlogin event is the first place it is safe to call replicated function on the player controller, if that helps
Ah thanks I think that's what i need
are you saying OnRep doesnt work in begin play?
Hello, I am a little stuck on my multi-player and I would really appreciate some help because goigling wasn't fruitfull: my players collect collectibles. How many they have ist stored in the player state. Works like a charm.
The plan ist to have the game end, when someone has 5 pickups.
The issue I can't wrap my head around is: where and how to I check for that and when to call the win of the game when someone has 5. I'm really stuck. I assume I need a customGameStateBase, do I?
OnReps are not called from BeginPlay, so it doesn't make sense
BeginPlay/OnReps are not linked to each other at all
Blueprints hacky OnReps might fire, but not because values are actually replicating.
so modifying a property during begin play isn't going to cause it to replicate?
It will replicate yes, but it will not call the OnRep immediatelly
You have zero way to know where the property was changed from
when will OnRep be called?
When the value replicates
And the client machine reads the properties in from the data stream
Which is usually before begin play if something is newly replicated
here maybe I didnt explain it properly
player controller begin play -> add initial inventory items -> tell client initial inventory items are added, the client will handle these items differently from the new items added after / during gameplay
You have no way to do that
Not really sure why you would though anyway, that seems quite fragile
well whenever an item is added to a specific slot for the first time (by the server) it'll need to do extra shit to make it render
but after that the client can assume the items and do the rendering itself
so all I want is call that render function once the items are added by the server for the first ever time
Why not just set a local flag on the item for whether it's been locally initialized or not?
if my original approach wasnt going to work i was going to do that
but I thought this would've been slightly cleaner
Far from it IMO
BeginPlay() and OnRep are not linked, they can happen at anytime. You've no garauntee that the inventory will have even replicated by the time the actor begins play
mainly because 99% of items wouldnt need that initial item bool
thus having extra data
but maybe i shouldnt worry about it much
For an initial packet, OnReps will be called before BeginPlay()
BeginPlay() can be called at ANY time, it's why it's such a terrible place to do initialization.
No the initial is still only pushed when the item becomes relevant again
But properties are alwasy read in before begin play. Unless that actor is say, part of the level - in which case BeginPlay() might be called first
But the two have zero linkage whatsoever, so logic that depends on their call order is extremely fragile
PostInitializeComponents() is by far a better place to do self-initialization. As soon as the actor is spawned, it initializes itself - regardless of whether GameState currently exists or whether the match framework has even called StartPlay()
BeginPlay is abused
Does UVitalityComponent* VitalityComponent need to be set in GetReplicatedProps(sp) in order to receive multicast events? The component is internally set to replicate. The OnDamageTaken event I wrote is triggering, but the parameters are null when passed.
ex
//CharacterBase.cpp BeginPlay()
if (!VitalityComponent->OnDamageTaken.IsAlreadyBound(this, &ACharacterBase::SpawnDamageText))
VitalityComponent->OnDamageTaken.AddDynamic(this, &ACharacterBase::SpawnDamageText);
// Spawn floating text actor/widget
void ACharacterBase::SpawnDamageText(AActor* DamageInstigator, float DamageTaken)
{
...
}
//VitalityComponent.cpp
void UVitalityComponent::Multicast_DamageTaken_Implementation(AActor* DamageInstigator, float DamageTaken)
{
// Rider Debug Inspect: BP_Character_C 20.0
OnDamageTaken.Broadcast(DamageInstigator, DamageTaken);
}
Floating Text when the damage is dealt to the enemy actor:
You don't even need to replicate the component. If it's a default sub-object, it can still send and receive RPCs
The actor itself needs to be replicated/addressable of course
Kinda what I figured.. I just realized as I posted that, that the event is triggering. It just had invalid values.
Is it possible to have fully client authoratative movement in unreal?
i want the server to be the one who experiences the rubber banding
with character? Yeah, just literally check the "client authoritative" property
bServerAcceptClientAuthoritativePosition is the one, rather
that still seems to have correction though
is there a utility thing to check if an array was fully replicated in OnRep?
no, you can't know
or do I have to go through each item and check properties
Check bIgnoreClientMovementErrorChecksAndCorrection or it'll still send movement corrections back
it'll still correct itself on server right?
to match the client
I donβt understand, check it against what? where is the list of items you are comparing it to coming from ?
Server will just accept whatever client gives it
I think I got it. The delegate is firing.. The problem was that the Multicast delegate was also firing on the server, resulting in duplicates. The floating text actor isn't replicated, so it was resulting in one with valid data and one without.
well just that they arent null
it does it on stages i think
it sends an array of nulls with the same amount
oh this is fucking beautiful thank you my man
and then it starts filling it
The array size will be set first. Item pointers will populate as those objects replicate/become relevant.
i'm making a casual coop game so i don't need no server auth
I just check every on rep if all items are non null
it works for now but it deffo doesnt seem rigid
Server doesn't send an empty array, it sends the same data - but pointers will be populated at arbitary times
At least, if they can't be reconciled right away
Since you have no ability to know which may replicate first, the object storing the references, or the objects being referenced
Okay. I think I see the issue with my Multicast thing now.. Multicast is sending it to all clients (dur), and I'm trying to have the damage text appear next to the actor taking the damage, but it's appearing next to me.
Since a client event would only trigger on the owning client (in this case an NPC), that wouldn't work. So I'm assuming I have to pass a 3rd argument for the actor who took the damage.
Well that reminds me about a question I had , Its my understanding that a multicast delegate (delegate not rpc) has nothing to do with networking. Is this true ?
Multicast sends it to everyone, including the server.
I know that true for an rpc
In my case, I had to consdier a dedicated server, which shouldn't be running the event
I was told a muticast delegate is a misleading name
I will take a read, It was my understanding its called multicast because it can hold multiple functions that it can call, but I think it can be confusing in the context of unreal and muticast rpcs
float UVitalityComponent::DamageHealth(AActor* DamageActor, float DamageTaken)
{
if (FMath::IsNearlyZero(DamageTaken,0.001f))
return mHealthValue;
const float oldHealth = mHealthValue;
const float NewDamage = 0.f - abs(DamageTaken); // ensures a negative
const float newHealth = ModifyVitalityStat(EVitalityCategories::HEALTH, NewDamage);
if (newHealth < oldHealth)
{
if (newHealth <= 0.f && oldHealth > 0.f)
{
//OnDeath.Broadcast(DamageActor);
Multicast_VitalityDeath(DamageActor);
}
else
{
//OnDamageTaken.Broadcast(GetOwner(), DamageActor, NewDamage);
Multicast_DamageTaken(GetOwner(), DamageActor, NewDamage);
}
}
return newHealth;
}
Essentially this is what I'm trying to achieve. When OnDamageTaken (broadcast within Multicast_DamageTaken) is received by CharacterBase.cpp, the receiving player processes whether or not they dealt the damage. If they did, it spawns the damage floating text actor, showing the damage they did. So far, that works. Problem is, the text shows up next to the player who dealt the damage, which is telling me that this delegate is being triggered on the player who dealt the damage. It should be triggered on the NPC who took the damage.
OOHHHHHHHHHHHHHHHHHHHHHHH I think I just had an epiphany
It can't trigger on an NPC. It has to be triggered on the player who dealt the damage and then spawned.........whoops.
HasAuthority doesn't necessarily mean it is the server or client, just FYI
In most cases, yes.
I was thinking of this wrong. I was wanting the multicast to trigger on the NPC who took the damage and show the damage instigator the damage value........... It needs to be triggered on the damage instigator, and spawned on the actor who took the damage, because a multicast won't fire on an NPC.
yup, I had to use both those checks together yesterday to fix something
- Client does a server RPC damage
- Server validates and then calls a MC on the target
- Everyone can see MC
This works because the Server is what owns the NPC. (assuming a standard setup)
That's how I have it set up.. For some reason my floating text is showing up on my character and not the NPC.
AH... Fuck me. I found it.
/** Sent to all clients from server when the DamageHealth() function runs
* successfully, but the character survives the damage. Used to trigger clientside events.
* May arrive prior to the mHealthValue actually being changed.
*/
UFUNCTION(Client, Unreliable) void Multicast_DamageTaken(
AActor* DamageTaker = nullptr, AActor* DamageInstigator = nullptr, float DamageTaken = 0.f);
I put Client. π€¦ββοΈ
[Edit] Works. >_<
Im still confused about an issue I encountered yesterday, where there seems to be a crossover of functions when playing as 2 clients in pie, that is not present when playing as standalone clients
It makes no sense to me, the function isnt even replicated. But the delegate is called on both clients in pie, and works as expected on standalone clients
So I have just been using standalone now for testing, there should be no difference in 2 pie clients and 2 standalone clients, but there is
Can you show code/BP? Probably a simple oversight like my issue above.
If the function is crossing over (I'm assuming you mean crossing over clients and running twice) it's probably being triggered on something replicated by the server. Just my initial guess.
Not at pc right now but ill post it inabit. Thats what it sound like for sure but its not a replicated function, just a text input in a widget that gets displayed on both clients widgets. And if it was replicated or a rouge rpc, the issue should be the same when using standalone clients.
Thats why I double checked about the multicast delegate, because all iβm doing is taking the text entered and updating the widget on the widgets text entered delegate. Its a strange one, and I dont understand why it would do it on pie clients but not standalone clients. The functionality of both should be the same π€·ββοΈ
The only thing I can think of is an improper server check of some sort, though I understand you're saying it's not replicated. The only difference is standalone is one client with authority, and the other is two clients without authority. So basically it's running twice. You can run 4 clients and see if it runs 4 times, too. If that's the case, it might not be networking, but something like your player character is replicated and it's running on all 4.
So by standalone what I mean is in the editor, its set to play as run as client so it runs a server in the background. If I set it to 2 clients and as pie, it opens 2 clients and a server but those clients are pie windows, you can change the option to standalone so it still opens a server and 2 windows but those windows are not pie windows and more like packaged/standalone windows. I am running 2 clients and a server in both configs.
Im sure its something simple and a check like you said, but its really confusing me lol. I just dont know why 2 clients and a server in pie acts differently to 2 standalone clients and a server.
Nothing is simple when it comes to this multiplayer crap π€£
I could just do all my testing with the standalone windows, which works as expected and is how a packaged game would be anyway. But I would still like to find the cause of why its doing what it does in pie
If I understand it correctly, "standalone" means that game is a client and a server in and of itself. By your description, you're starting two individual games and an empty server
but that dfoens't explain things running more than once
Oh, I'm thinking net mode. You're talking about the play feature.
ye, its still a client and connecting to the dedi in standalone mode
Honestly, my suspicion is that the widget delegate is shared between pie windows when its not supposed to be. If it was a network code error then the same should happen on the standalone windows. I could be wrong but thats whats it kinda pointing to.
I might make a blank project later, make sure there is no replication atall and test that widget delegate on 2 pie windows just to rule it out
Hi, does anyone has experience with marking property as both Instanced and Replicated? Is it safe to do so? Will instanced flag be ignored on client? Also the property is inside of replicated subobject, so it may not be replicated at all times, since I may remove it on server during runtime or decide to not add it to replication from very beginning, but later on.
ok.. I worked it out, it was exactly what I thought it was...
I unchecked this box and the problem stopped
so it was not a network issue, it was the delegate being shared between pie windows because they were running under the same process
so fwiw, if anybody is testing multiplayer in pie windows, I recommend you uncheck that box, because the engine is clearly not separating the clients correctly in pie windows when running under the same process and you may get some funky behaviour. Will probably report this as a bug later.
If it's a static delegate then that makes complete sense
its these that were causing the issue
InputLayer->OnTextChanged.AddDynamic(this, &UTerminalWidget_Base::HandleOnTextChanged);
InputLayer->OnTextCommitted.AddDynamic(this, &UTerminalWidget_Base::HandleOnTextCommitted);
What is InputLayer?
its an editabletextbox in a widget
Sounds like there are other shenanigans at play here
well pie clients should not share an OnTextCommitted delegate, if it goes away when unchecking the box that runs the client windows in the same process thats an engine bug to me
They don't share it - the problem is elsewhere in your code
So, if I attach an actor to another one, the attached actor's root component is being added to the target actor as another component, which makes both actors being deleted due to cull distance even if the attached actor is always relevant? Just trying to confirm if I understand correctly
They are sharing it when running on the same process
Something somewhere is static, I garauntee it
PIE clients do share the same memory, so it stands to reason that if you create an object that is statically accessed, all clients will be able to get to it
its very possible, all im saying is that I ruled out a network issue, and its more to do with pie clients sharing memory etc
Yeah, but I'm just saying it's not an engine "bug" as such
ill have to investigate further, but atleast I know where to start looking now. I was checking replication and rpcs, when it wasnt that
The inventory system I wrote has no problem replicating the array, but it doesn't OnRep which slot was changed, so you end up having to iterate the entire array for everything that needs to know if it updated. The way I did it was just set the array to Replicated, and created my own Client_InventoryUpdated(int SlotNumber = 0) that gets called everytime a slot updates.
Then anything that's interested in knowing if the inventory has updated runs in O(1) instead of O(n) everytime the inventory updates
The only issue is things arriving out of order, but you could write some type of listen/check using OnRep and a Client RPC.
Yours should work but you'll have to iterate the entire array every time.
I just iterate the array every time. My inventory is only like 5 items. Not a big deal.
Do the simplest thing, but no simpler.
Rep conditions, Owner only
And if you're doing a client RPC - it's already client specific
Is there a console command to toggle 'Run under one process'? Diving into the settings menu everytime is getting tedious.
DOREPLIFETIME_CONDITION(UInventoryComponent, InventorySlotsArray, COND_OwnerOnly)
Now that I think about it, obvs O(1) is better than O(n) but with how infrequent the inventory updates, the difference is probably negligible.
My check is just comparing ints pretty much. Even with 30 items, it is very negligible.
What often gets lost in the sauce is that O() notation is for the behavior at large data sizes
O(1) is better in the extremes, but it might actually be much worse with small data sets. Depends on what the constant time component is
No it's not. It's how it scales in the worst case. It is applicable with 2 elements and 20k elements. It is more, "does it matter at my scale"
Yeah, sacrificing accuracy for speed. In this case, it'd be a negative outcome. If the array update isn't received by the time that InventoryUpdate is received, then it'll update before it's ready.
OnRep is likely the better outcome for inventory updates
Afaik, you want a good balance between O() and Ξ©()
I think the main issue with my O1 v On case with the inventory slots, is that if you go with the O1 option, you might update before the array replication is received... Which means you need to implement some sort of "Okay, I hear you're updating but I need to wait for the replication" thing, which complicates it even more. The O(n)\ here seems worth it, on second glance. Might change mine to just doing an atomic OnRep update.
Best case isn't really a factor in this situation.
Almost any time I've got a giant blob of error like that, it's because I didn't define a declared method, used the wrong class name or had a delegate that didn't exist.
Usually it's because I didn't define the method
"unresolved external symbol" - you are missing something in your build.cs
If it's throwing that on a native, then yeah that's most likely the case.
Go to that type it is complaining about, ctrl click on it, then copy the macro part of class SOMEMACRO_API Thing, and throw it in your build.cs includes.
Without the _API part though
Slightly related question that maybe you might be able to help me with.
I have a relatively large array in my game. When I try to replicate it I get an error of the type:
[2023.07.19-15.30.26:281][ 70]LogNetPartialBunch: Error: Attempted to send bunch exceeding max allowed size. BunchSize=75039, MaximumSize=65536
Would using the FFast TArray solution help with that, or does that only help with the CPU time the server spends trying to find which array elements to replicate?
I won't really make too many changes to the array, but yeah sending it at first seems a bit problematic.
I mean 75039 bytes are like... 0.075 mb or so. Doesn't seem to be that bad to send to the player on join
OnRep still works with fast arrays
Guys , what's the issue? im moving a pawn in server , is all good , but in clients , they're like slowed
I have a drop function who is replicated on server but when i drop item from client, others client (including sv) can't see it
The server has to drop it. If you drop it on the client, it doesn't exist to anyone else.
Send a request to the server from the client to drop the item, then spawn/drop it on the server.
player wants to drop an item
server_dropitem
verify drop request is valid
dropitem()
spawn replicated actor
Even a limited knowledge of c++ makes certain things much easier than using blueprints
Well making multiplayer stuff strictly in bp is not recommended anyways
any help for it?
I was trying to do database access in blueprints and the data management was absolute hell
Turns out my problem earlier is normal behaviour when running pie clients on single process, so I dont have to worry about it
Hello, how do i save multiple structs for each player? with one i got it working but multiple... just how? especially if 1 struct is saved like 4 times each player, so i cant do it with loop for each with break.
Something like this?
Spawning the item, yes, you're sending it to the server which is good. I think the server->client->server calls are redundant, though.
Just have the server check if they have the item, and if the drop is valid, then spawn the item. All the client needs to do is tell the server that they want to drop an item.
void ACharacterBase::DropItemOnGround(int InventorySlotNumber)
{
if (HasAuthority())
// Replicated SpawnActor Logic
else
Server_DropItemFunction(InventorySlotNumber) // Call function on server
}
void ACharacterBase::Server_DropItemFunction(int InventorySlotNumber)
{
if (HasAuthority())
DropItemOnGround(InventorySlotNumber) // Run drop logic as server
}
A basic, non-func, unoptimized C++ version.
is there a way to have a level open with the listen option by default, so basically on startup? instead of using an open level node
I have a philosophical question about how the different multiplayer code paths work together -- particularly the CMC client-side prediction, GAS prediction, and actor replication
both CMC and GAS are doing client-side prediction with validation/rollback, but on different code paths. does it make sense to integrate them or do they run together seamlessly while being separate? for example, if at T=5 I activate an ability and move the character at T=6, both of those are "user inputs" so my instinct would be to shove them both into SavedMoves. (is there really a difference between crouching via compressed flags and doing a super jump or sprint in GAS?)
with entity replication, let's say that I am running forward in the CMC and I bump into a box, triggering its physics and knocking it over. do I simulate the physics for the box locally and allow the server to correct that via actor replication? do I wait for the server to tell me that the box moved? if I roll back the CMC move, do I just let the box correct itself via actor replication (because I never actually bumped into it)
sorry if this is a bit jumbled, still trying to wrap my head around how these all play with each other
doesn't actually seem all that difficult tbh, if the client is just doing the ability and then sending to the server for validation, if the validation fails the server should still have the correct/previous values to just send back to the client. I guess there might be a few extra things to consider but the basics of it seems simple enough
Thats basically what I was saying, you don't update the damage on the server if the validation fails so the info on the server is still the correct info. As for the revival, I might consider applying damage instantly on the client and then validating after as that can be rolled back fairly easily, but if the damage leads to a death it might be better to wait for validation before destroying the actor, just a thought
ue5 hangs when Player 2 joins the game
How to fix it
Be it standalone , as listen server , as client ,,, It Hangs Slowly like it get lags so hardd
Actually the whole engine lags
Why?
WHen it is only 1 player
it works fine
very generic question with many possible causes
Is It?
It worked fine , It suddenly got like this
Is there a way to find out the exact prob?
it is, it could range from hardware to code
Only lag in editor for me
if it worked fine , then started freezing up, what changed between those 2 times
Maybe stand alone too but that's like same machine trying to join
It worked fine yesterday but today..
When it comes to actual different machine connection there shouldn't be lag (packaged version)
Is it?
did you add anything between yesterday and today ?
Lags everytime another player join (from same machine)
Oh
then is it okay to package?
Exactly
Oh The Same machine is the prob?
if you can test a packaged build on another machine ^^ that is your best bet
I mean the other player probably eat your memory when you joining. Since they are in the same machine it's only natural that your system lagged altogether. Imo
oh
well if its trying to run multiple instances of the same game and possibly a server aswell, it might struggle
depends on how much is going on
Non async loading map always shit your pc
Ohh
Thanks Guys
I'll try packaging and running in different machines
Ohh 1 more thing
I have two maps in my project , Main menu , and the game's land map
In the main menu it doesn't lag
Only in the game's land map it lags
In the main menu , the character cannot move , but is spawned and a hud for starting match (start button ) things like that is in the hud
When the match is started and when the player enters the world map , engine lags
It also lags when the world is opened and I just play in editor with 2 player no.
Still the machine is the problem right?
This is kind of a vague question but how do you go about debugging issues caused by packet lag? I have a root motion dash ability that works great in multiplayer, even with 200ms latency. However, as soon as I add even 1% packet loss, I start getting issues with double dashing and being snapped back into place. I still end up at the right spot and it often looks seamless on other machines, but locally im rubberbanding.
your gold standard here is being able to see the code path that caused this
if possible: can you set breakpoints that fire when a double dash happens so you can see how you got there?
sometimes you can't set breakpoints because the problem is timing dependent, so it needs to run at full speed without breaks. options there are recording information that will allow you to reconstruct the call stack. one easy one is just really chatty logging -- "x happened", "y happened", etc. and you can see the control flow that happened and form a hypothesis about what's going on
There are also console commands and logs you can enable specifically regarding the movement system to debug I believe, maybe they can be useful here too. Although I don't exactly recall which ones π
For a replicated automatic rifle, would you put the timer inside the server event or after the button press and have it call the server event?
Can i replicate uobject with blueprint?
Hi, i have that error when i want to build the dedicated server
Erreur MSB3073 La commande ""C:\Program Files\Epic Games\UE_5.2\Engine\Build\BatchFiles\Build.bat" ZGameServer Win64 Development -Project="C:\Users\xxx\Documents\Unreal Projects\ZGame\ZGame.uproject" -WaitMutex -FromMsBuild" s'est arrΓͺtΓ©e avec le code 6. ZGame C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets 44
Player respawn. I am getting an error on the respawned character (player ref not valid, pending kill or garbage). Yet the player spawns completely and has a working red dot.
I'm using the fast array, I'm looking to invoke some logic on PostReplicatedAdd on the class that I'm using to hold it]
You could manage this in a number of ways.
Either have the Container be initialized with a reference to the owning class object (not really recommended if the Container is meant to be generic).
Alternatively, you can setup some delegates on the Container which owning class objects can bind to.
You would just broadcast those delegates in the appropriate functions inside the Container.
Okay, I was wondering if there was a built in way to do it
But this seems like a much better way than what I was going to do
FastArrays are self contained, they dont expose anything like that to external classes.
You need to implement it yourself.
There is a third way I can think of, using an interface
Keeps it generic and avoids bloat
So when PostReplicatedAdd is called, I could get the owning object and call an interface function on it that will handle the change on the client
Sure you could, but delegates would be more appropriate.
Since you wouldnt need to track the owner
If the FastArray is dependent on the owner (its purpose is highly specialized) then you may as well just expose functions that it calls directly on the owner.
The ASC does this for example when it uses FastArrays for stuff.
Since the FastArrays its using are highly specialized there isnt any reason to make them generic enough for other classes to make use of them.
Thinking it through with your input, I agree that using delegates would be the better way to go
Thank you for your help π
Hello everyone!
I have a quick question about Anim Notifies
Are these always triggered? I saw in some forum answers that they could fail to trigger, specially if their montage tick type is set to Queued, I'm having an issue where I put a notify in a montage I loop if the player holds a key, but sometimes the server stops triggering it, the client continues to trigger it and playing the animation.
If I play in Listen Server the animation stops playing in the server, this is because I need the Anim Notify in order to keep looping the montage.
Also I tried to put the Tick type as Branching point, but it triggers twice in the client and in the server
So I know you can't call a PlayerController RPC from an interface or owned actor, but could I call an RPC in the inherited class?
e.g.
class AExtraRPCs : public APlayerController
{
UFUNCTION(Server, Reliable)
void someRPC();
};
class AMyPlayerController : AExtraRPCs
{
};
If Iβm working on a multiplayer game. And I want a specific macro to be replicated so the server knows what forces where applied to the client? What order should I have my events run through?
I cannot figure out why my client is just stuck in place vibrating violently. Client can see server and server can interact and push client around, but client canβt move
You'd have to ensure that whatever you're spawning is of the child class. So you'd end up having to set your playercontroller class to AExtraRPCs in order to call its RPCs.
Did you make sure you clean your session before logging to the new map? If you change maps without unloading the main menu stuff, it could still run in the background.
Ah gotcha, I don't know how to make that pretty π but ty
Useful errors are in the output tab, plus this looks like you're trying to build the server using the Epic launcher engine, which is unsupported
Hello, I'm having a problem connecting a mobile ue5 built-game to a windows dedicated server.
It initially connects to the server but then immediately disconnects.
Anyone else faced this issue before?
Hey! i want the server to save stuff but i need a local struct from the client but if i cast to the client the struct is full of emptiness while local it has stuff in it
You canβt cast to a client, only a class
oh i see, ty!
you need an RPC or replicated variable, casting is only really saying βis this thing of this classβ but you are not getting a remote instance of it just by casting to it
im pretty new so thanks for the clarification! i never knew how rep variables worked π so they are replicated but the server still knows from which client the variable is, right?
I donβt want to confuse you so I wont try to explain them much, my wording might be misleading but I dont think thats a fully accurate description. The basics is that a variable exists on the server and that variable is sent/replicated to all the clients so they can also see it but not edit it, but there is a few different types. RPCs are different than replicated variables.
Thanks for the info! but how do i get a rep variable when i cant cast?
if the info is stored in a replicated variable that the server has authority over and is passing that info to a client, then you can just cast to the actor and check it on the server. If you have a variable that is not replicated and does not have server authority, and is local to client. you would need to use an RPC to pass that to the server
aaah! ok very helpful! thanks so much π
Hello, I'm having a problem connecting a mobile ue5 built-game to a windows dedicated server.
It initially connects to the server but then immediately disconnects.
Anyone else faced this issue before?
Hi there. Is there any difference between having a replicated property with a rep notify, and having a replicated property with COND_InitialOnly that after the initial update, is updated via a reliable NetMulticast RPC (in which I put the code I would place in the rep notify)? I don't care for the fact that replicated properties might skip changes on the server and jump straight up to the newest server value. Should the RPC approach have quicker arrival times to clients? In terms of performance, is there a significant overhead that comes with the RPC approach? Thanks.
Hey Folks,
SUBJECT: I wanted some help regarding relevancy and OnReps
I wanted to as about the IsNetRelevantFor (https://docs.unrealengine.com/4.26/en-US/API/Runtime/Engine/GameFramework/AActor/IsNetRelevantFor/)
What I want to achieve:
I have a custom class derived from ACharacter, PlayerCharacter
This class has some replicated variables that rely on OnRep of each of these replicated variables, and the condition is default. This is called on owner and on simulated proxies
I want to leverage this in my squad mode (co op). What I mean is variables like health, custom player states (knocked down, prone, crouch, armed etc) are all notified through their respective OnRep method. As mentioned earlier the OnReps are called on simulated proxies as well.
OnRep will only be called if the pawn is relevant, I want to override the IsNetRelevantFor method and make sure that a teammate is always relevant throught the game no matter where ever they are
Let's say Tom and Jerry are a team and Spike and Tyke are a team.
I have a TeamSystem class that holds this information on every client device and on the server, which pawn is their teammate.
Basically
Tom and Jerry (PlayerCharacter) will be mapped as teammates
Spike and Tyke (PlayerCharacter) will be mapped as teammates
Client 1 -> Tom
Client 2-> Jerry
Client 3-> Spike
Client4-> Tyke
pseudo code
APlayerCharacter::IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) const { Check if RealViewer(this actor) and Viewtarget(another actor) are teammates if teammates return true else return super }
Its a large message but have tried to give as much info as possible
THANKS IN ADVANCE
Checks to see if this actor is relevant for a specific network connection
It would be useful if you could share your client and server logs here
if you do something like in your psuedo-code, nothing will replicate for opposing teams, including position. so if your game is say an fps or some other kind of pvp game, your opposing team will just not show up in the game, except maybe they will be stuck at their spawn point or something
Thanks for the response, why would that be if they are not teammates then I would just call the super::method which anyways does the distance relevancy checks based on the properties set, right!?
oh sorry i didnt read your code correctly. so you want your team mates to always be relevant? then your code should be fine
Yes, exactly, the teammates would always be relevant.
The Idea here is
Local Client 1 -> Tom, gets notified by the simulated proxy of Jerry of his/her state since the OnRep will be called on simulated proxies as well.
When broadcast delegate from Multicast RPC clients cannot get that rpc call, any idea about why?
I think your logic is a little bit messed up somewhere though. Normally the flow of shooting looks something like this:
onClientWantsToShoot (no matter if the listen server or an actual client)
sendRpcToServerToShoot()
// Maybe also play some VFX or whatever
onServerReceivedRequestFromClientToShoot
if validShot
damageWhoeverGotHit()
invokeNetMulticastToShowClientShot()
onNetMulticastClientShot
if NOT client that shot
// Do whatever you want like playing VFX, sounds, playing a notification of some kind.
// Maybe the player that you shot died or whatever.
```The important parts to note in here are:
- `damageWhoeverGotHit` and `invokeNetMulticastToShowClientShot` are on purpose seperated. If someone got hit by a bullet you likely want to update someone's health, maybe they have armor that broke or whatever. That's what I would consider a "stateful" change and should not be inside a RPC but instead use replicated variables to prevent relevancy issues etc.
- The net multicast only triggers the logic for the person that did not shoot. You very likely want to play some kind of shooting VFX / sound the moment you actually shoot locally on a client to prevent latency making shooting feel laggy. However eventually that multicast will also arrive to that specific player which has already triggered their sounds, VFX etc. and thus shouldn't do that again.
Kind of yeah. Games often do predict things like the sound playing, a shooting effect (muzzle flash etc.) to indeed prevent latency from messing things up but do not actually predict the hit. That's up to the server to do (and if needed for your game in specific validate the shot).
But then you do indeed get the 'issue' that the person who actually shot with their weapon also gets another request to play VFX etc. So that's why you need to specifically check whether or not they already did so π
A blood splat is fine I would say. If you're referring with an explosion to a grenade or whatever that's a whole different story xD
I personally wouldnβt bother with client predicted shooting myself but its down to you at the end of the day, Games like overwatch for example AFAIK dont use it and that feels responsive enough, providing you dont have stupidly high ping you will never notice. The reason I say it doesnt use it is because sometimes when you enter the training ground you can be given a really poor server with high ping, as its just a training ground I think they give you low priority on the network, and when you shoot things it can have a noticable delay but during normals games this never happens.
I would not predict health honestly. There's a good reason why most games don't do this, simply because if it does go wrong and the server has to correct it higher level players will get thrown off by it rather quickly. Especially if the person or enemy they shot is already low health and should basically be dead at that point.
I explain how I came to that conclusion
its an educated guess based on my experience with the game
Maybe we should clarify a point. "Local prediction" in my case was purely VFX, sounds etc. Those do 99% of the time get predicted in games because you don't want to shoot locally on a client and have to wait 100-200MS before a sound gets played. But the actual damage, whether a hit was valid etc. are rarely ever predicted.
the little X mark on your crosshair when you deal damage to someone only occurs once the server has verified the hit. everything else is predicted
also the sound it makes when that X mark shows up
I am just going off what I have experienced with high ping in the training ground, it waits for the server before applying any damage. If they do use it during games then I stand corrected, I was just basing it on that experience
you are correct, that doesn't mean they aren't using client prediction. damage is not predicted, but shooting is
when you left click, your gun instantly fires, your shot position/direction is saved off and sent to the server, effects are played, sounds happen etc. but if you have lag you will notice you dont get hit markers or the hit sound instantly, since the server has to verify that your shot hit something
i dont remember if they use rewinding or if they just sanity check, i think i remember then talking about rewind? havent watched their lag comp talks in a bit
Thats kinda what I mean, the damage is not applied instantly on client and then rolled back if not validated by the server
that's pretty common, and usually not what people mean when they say client predicted shooting. client predicted shooting in most cases usually just means "when you press a button, your gun fires on your screen" so that the game doesn't feel laggy
usually damage numbers aren't predicted, though you could i guess
most examples i've seen don't predict anything to do with actually affecting the health of enemies, just purely visual/audio feedback and your own ammo
i think we are all saying the same thing just using different terms
ye I think there is just some misunderstanding of terms
i thought originally you meant they do no client prediction, which to me means you press left click and NOTHING happens until the server tells you your shot was valid, which would be super unresponsive feeling at even low latency
I just remember altaro talking about the GAS system and how that applies effect on client predictively and then roll backs, and I think he was talking about predicting client damage the other day and then rolling back, could be getting mixed up tho
you were talking about predicting client damage and then rolling back the other day and potentially having to revive people, the comment I made about overwatch was just saying that they donβt do that, and I wouldnt bother trying to do that personally
You only predict effects on yourself, and nothing majorly state changing. Would be pretty jarring for the player if your "death" was rolled back anyway.
You want to predict as little as you can get away with
anyone know how i can retrieve the state of another users 3d mesh capture?
Theoretically only by replicating whatever leads to the same result
so rpc items attached to player, player color, etc?
Well if it's a state, I would rather use OnRep/RepNotify
never used those yet
:D I hope you did, because you should not use RPCs for State anywhere
ah what canya do
if every player is using the same 3d mesh render rep notify applies still right?
Idk what that exactly means.
What exactly is even a 3D Mesh Render. Do you mean a capture 2D of a 3D mesh for the UI?
ya sorry
i was gonna ask if i need a whole new capture with a whole new mesh for other players?
my guess is yes. cause how can i look at my character and theirs using the same capture and have different items etc on them
Yeah, you'd need one per player
so are you saying for every person that logs in, i need to spawn a scenecapture component?
It depends on how this all is supposed to work
If you need to see all characters in your UI at the same time, then yes
just one player at a time
whether it be the owning player or another player
only one inventory window should be open at a time
does this mean i could use one scenecapture?
If you only need one at a time, I guess
so just a little bit more info... lets say i have someone in my friends list. theyre offline. how do i get their save game state of what they had equipped before they logged out (which i have set up). do i need to associate their id with set repnotify variables before they log out?
You could do that yes
Well if that did , then why does it the lag/hanging only happen when more than 1 player are playing
?
in this case, i have different types of items that spawn onto my player mesh. do i set this mesh variable to repnotify and set it after the item is attached to my player?
No, you need to set the actual mesh not the component to repnotify
oh
And in the repnotify you can assign the mesh to the component
i mean the mesh variable is my character mesh
You gotta diff between Mesh being the SkeletalMeshComponent and Mesh being the SkeletalMeshAsset
asset meaning the actual skeletal mesh file in the content browser?
Your image is spawning an Actor and Attaching it to the Component
If you do that on the server and you ensure the Actor is replicated, then you don't need to do anything
Attachment on Actors is replicated
so where exactly in this should i be repnotifying
depending on item type it spawns actor and attaches it
If you do this on the Server and the Items are replicated it should be fine already
If not then then whatever data you need to spawn those actors would need to be repnotify
does anyone know if steam online subsystem can be used with mobile platforms like android and ios?
Steam doesn't participate in the mobile space, so I wouldn't imagine it would be all that useful, even if it were able to be used.
how can i implement multiplayer in mobile games then?
cause there are no subsystems specifically for mobile
alright thanks
That depends on how youβre getting each player their controller and if their sessions get cleaned up as they change maps.
im trying to find the best way to mute the enemy players voice, i've never messed with this so im a bit lost, im thinking about doing it when they join the server, is there a local call back for when a player joins that i can use? is this a good idea at all?
If it's muted locally then no. Generally what you do is join a channel, the server decides which channels you can/can't join and handles the requests
@quasi tide can you please help me with this? it says mobile platforms arent supported by EOS
is the solution to buy a 3rd party plugin?
Or...just expand on it yourself?
EOS does support the platforms. Just write your own subsystem
You could always just buy the one from Redpoint as well
But remember, code plugins are a per seat license. So everyone on your team needs a license.
can someone help me? idk how to make it work for also the clients
the set view target with blend
camera
i want everyone to view from the same camera
or same spot ig
Only run it on the client.
but how tho
GM is server only
ik but like, i want them to see from the same camera after they enter the level
I understand. You just need to only do this on the client.
You can do it in beginplay and have it behind a HasAuth check or do a client RPC.
This code is only executing on the server
Where is this being ran?
on rep
Pawn? Actor? Game Instance? GameState? Some random other actor
Sooooooooooooooo - you want to get the local playerstate inside of the playerstate that is being onrepped??? What?
I don't know really
I think that would work
Basically I just want to play a widget on the winner/loser repsectively
This is inside the gamemode
You can get the first local player controller from the GI and then get the playerstate from that
GI?
GameInstance
ah
Again
I think you should tell me as I don't do it properly
Could you show me the code of how to do it
No? I'm not on a computer that has Unreal installed
I'll pay you
Get game instance. Get first local player controller. Get Player State.
That is the order
If you can't type in 3 nodes, you should stay far away from multiplayer.
That doesnt work tho
Show me
Could I technically be able to replicate only client position and rotation and leave the movement components and physics interactions purely client side? I understand that would be bad if there are cheaters but ultimately it only leaves the server the job of locating the vehicle and copying it's location and facing rotation.
And the next steps?
Are you sure you don't mean gamemode?
U mean Client side prediction
Positive. Guess it's C++ only.
This is not helping if you're gaslighting me when its not even correct lol
The method exists. I apolgize that I can't remember everything that is exposed to BP.
But if you don't want help, sure - godspeed
that's what that is?
I thought prediction required the server to run the movement for the client, and the client just sends a bunch of rep notifies?
then the client interpolates the locations sent vs the location it has
Well Like you said. U don't want to server to check anything . and Just duplicates values the client send to all the other player(who are also client)
OH.. I suppose my method doesn't take multiple clients into account
so client to client wouldn't be seen. I guess I can run a multicast from the server to the clients after the client sends it's location to the server.
That way the server is the only positioning everything and the clients just have to interpolate themselves into it, instead of the server doing it.
Iunno
I'm kinda dumb with this. I just started
@quartz iris Replace your Get Player Controller call with the one that is built into the PlayerState. Then compare if the controller is null or not.
If the PC is valid - you're in the PS that your client owns. If it is is invalid, you're in a PS that your client doesn't own
Don't use any of the versions that ask for an index
PlayerState has a function to get the player controller that created it.
Use that one
Client That is Replicating to server will update faster then other playersclient seeing the update later there will be delayed between all the clients update that' what i am saying\
The cast to playerstate right?
I guess my question is the order in which events need to happen
Why would you cast?
Because I can't get the playerstate you're asking for atm
You don't need a specific playerstate for this comparison - you just need a playerstate
Well You Have to find about with doing it. actually there will always be some type of delayed between events. So even If we take any order to do that things will not go smmothly as theorized in Networking Arcitecture.
An overview of the essential concepts for writing multiplayer game code in Unreal, in under 25
minutes or your money back.
Sample project: https://github.com/awforsythe/Repsi/
Patreon: https://patreon.com/alexforsythe
Twitter: https://twitter.com/alexforsythe
00:00 - Introduction
01:24 - Net Mode
03:33 - Replication System Basics
05:13 - Acto...
Theres something call replication pirority
It's has been explained in one section of this video
that requires c++ right?
Well even if you are using blueprint . c++ code is going to run anyway so he just explains it in good way . How overall ue4 networking arcitecture works and yeah there will be some c++ code mention there but he will explain
It's stock Unreal
You can use this to determine if you're local or not (in this case)
Theres an error
You just need to check if it is a valid PC or not.
The error is because this BP is not a player state
Which I asked where this was being called a long time ago
The Gamemode
GameMode only exists on the server
.
How should I be doing the show widget system for the winner?
But it won't end up on the client
I need it to be handled via the gamemode
So I need to move the gamemode code into the gamestate
I don't know what this is trying to say. I very specifically asked where the code is being executed.
There is no "best" place
Obviously you don't init a pawn in a darn widget
well someone is high
Initialize it wherever you decide to spawn it?
Just spawn it on the server and make sure it replicates
- Spawn on server
- Have an HasAuth check in BP
Problem solved
So just to be sure, i'm copying this code to the gamestatebase from the gamemode? Including the variables
This will work fine?
GameState is a class designed specifically to ferry information to all clients that are generally GM specific, because the GM doesn't exist on clients.
let me rephrase that lol
So it shouldn't be in the gamemode
Correct. Any networking stuff should not be in the GM. They simply won't work.
That doesn't mean the GM can't call a method that is networked though
So you'd get the GS and then call your multicast or w/e.
People use it differently.
Some people literally just use it as the point of entry and that's it
Some use it to manage score required to win, etc..
That won't work because the code is being executed on the GameState
Ok
In multiplayer, you really need to pay attention to what class and machine the code is executing on.
Cedric's network compendium goes over the main classes in this regard.
Constantly refer back to it.
I sure as heck did in my numerous attempts at understanding this stuff.
There are honestly only a few things that are quite rigid.
Such as how a player logs in or how to travel from map to map.
Otherwise, you don't have to use a lot of the built in stuff.
It is just helpful.
Not a MP one, no. But a SP, yes. My current game is MP. But I've done a few contracts in the MP sphere as well though.
TBD
can i replicate uobject?
Pretty Sure You Can , Pls Look At Pinned Messages in This #multiplayer Channel or you can refer to the reply of this message @rain condor
I'm Testing now in the Pc within the editor and with android .
The Height Of Player 1 (Android) changes (becomes small) for Player 2 (From Pc (In Editor))
Android View
From Engine/Editro/Pc
What's the problem here?
And The Player 2 character's Jump and some movement Jitters
Does anyone know how to fix this?
I am having an issue with some networked code, i am calling destroy on an actor when interacted with but Destroy returns false when the client interacts with that object. here is my code for the interact function
{
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Green, TEXT("Interacted"));
bool btest = this->Destroy();
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Black, FString::Printf(TEXT("%s"), btest ? TEXT("true") : TEXT("false")));
ATGB_ADW_UProjectCharacter* Player = Cast<ATGB_ADW_UProjectCharacter>(Character);
if (Player) {
Player->AddItemToInventory();
}
}```
is this just an issue where you cant call destroy on the client?
If it's a replicated actor, then the server is in control of it and can only be destroyed by the server. Additionally, you wouldn't want just your client adding it to their inventory as the server should likely know what is in the client's inventory.
Replication is always one way, server to client. Clients can call RPCs which allow the to request the server to do something, so then you set up the RPC in such a way that the server validates what the request is, performs it and replicates the results.
ok thank you
so i would create a destroy actor RPC and then call that when interact runs right?
Definitely not.
You wouldn't want your client to have access to destroy any actor they please.
You would RPC that you're attempting to interact with a particular actor. Once running on the server, you do the rest.
oh ok
that makes sense
thx for your help
i just call the Interact function from the server
How to replicate movements correctly?
Hi, does anyone one have experience with custom net drivers?
i've issue with creating dedicated server, anyone able to vocal and help me a bit please?
Specifically what are things that I would need to consider when writing one
im using steam and from the little stuff that is documented theres nothing about channels, i belive its peer to peer through steam but im not sure, i just need to know wheres the best place to mute a player that joins the match
lets say I am making a game like minecraft where you can break blocks, the block itself cannot actually call functions to the server because it won't have the authority to. So I guess it would be inside the player? In simple cases like this it could be fine, but doing this in everything? This would just make the player script extremely massive.
RPCs would need to be on something the player owns, not necessarily entirely on "the player" (whatever that is - there's already at least 3 different things that represent the player by default so you're already splitting things up). And replicated components on those things would be fine too.
When you're breaking a block, you would be sending a message to the server indicating you're swinging the pickaxe at a particular block on your character or player controller. The server would register the hit and decide whether that block takes damage, etc. As you're already running on the server you can access the block being hit and do what you need.
alright, thanks
Input > RPC to Server > Server does stuff.
is there any resources on repnotify (C++), can't find any actual docs on it, just the very short page for the ContentExamples project
Guys
What is the limit on multiplayer for UE5?
In peer to peer , in android how may players can it support?
Fortnite probably doesn't use stock UE... anything, though.
Not that you have access to yet anyway.
It uses a dedicated server isnt it?
Yeah How Many Players Does Peer to Peer Support in a Multiplayer match?
What if it is in Android?
Well, there is no peer-to-peer in Unreal. It's still a server/client set up. You can have one player act as the host which is known as a listen server. No one can really answer how many players it can support as there's too many variables involved:
A) The CPU speed and RAM available which can vary greatly across android devices and is far more limited compared to standard computers.
B) The network connection is likely to be poor if running on cellular networks limiting how well the game can run with more players. Sometimes it may be better when connected to a Wifi network, but as the server will never be connected to a hardwire, you're likely limiting how well it can host a game.
C) How complex the game is itself and how much data needs to be replicated.
I would say trying to do any kind of real-time multiplayer hosted on an android while on a solid WiFi connection, shoot for at most maybe 4 players?
top section adds entered chat into a chatbox(works fine) bottom section adds entered chat into a component above players head. if i were to replicate the component to other players, what would i be setting as the variable to rep notify
yeah I straight up cannot find anything that talks about OnRep
Is this the content example that you have already seen ? https://docs.unrealengine.com/5.2/en-US/multiplayer-programming-quick-start-for-unreal-engine/
there is brief part about it in there
yeah this is something else, thanks
Do you have any specific questions?
Also have you checked the multiplayer compendium in the pinned messages?
Yeah, just a few,
- When is it called?
- Where is it called? (Server? All Clients + Server?)
OnReps are called on server+client when used in a BP and only on the client with c++. Honestly I'm not sure if you define one in c++ and then subclass the class in BP whether it will treat it as a bp or c++ variable in this respect. Whether setting it in BP will trigger the onrep simply because it was set in BP. I don't really use bp that often.
And it's called (in bp) as soon as the variable is set on the server and (in all cases) by the client when a variable update is received from the server.
can you explain it for C++? Won't be really using BP
So usually if you're doing c++ stuff, you would do something like this: ```cpp
UPROPERTY(ReplicatedUsing=OnRep_Value)
int32 Value;
UFUNCTION()
void OnRep_Value();
void SetMyVariable(int32 NewValue);
void UMyClass::SetMyVariable(int32 NewValue)
{
if (HasAuthority())
{
Value = NewValue;
OnRep_Value();
}
}
void UMyClass::OnRep_Value()
{
UpdateMyUiOrWhatever();
}```
is there more than one OnRep function ?
You have to define your own OnRep functions
So in that example, in the header, you would use cpp UFUNCTION() void OnRep_Value()
I understand that, Im just wondering what the OnRep in that doc is that explains this if it was something else
Which doc?
I know the syntax, those are the only questions I had
And explains its called on the client when the server updates the value
it answered your questions, thats what im saying
didn't read it because Daekesh personally offered to answer the questions I have on it
What?
also was busy doing something else
I know, you said it was something else, but it wasnt. Thats why I wondered if there was more than one OnRep
Is that directed at me? I still have no idea what you're on about.
wouldn't it just automatically be called once I change new value? isn't that the point of the OnRep?
no, I was just wondering if there was some OnRep I wasnβt aware of. It doesnβt matter.
Not in c++. OnRep is called on the client, always, when a new value is received. That's why it's OnRep - On Replication. On the server that doesn't make sense. It's not replicated to the server. It's just there already. In BP they call the OnRep on the server too because it's just, idk, more convenient?
I guess adding a setter, authority check and manual call is too much for BP people.
Technically OnRep isn't even a thing. It's just a convenient pattern to identify those methods. You don't need to call anything OnRep. And the UPROPERTY tag is ReplicatedUsing. Unless the BP setting is called OnRep?
I wouldn't need to actually put my variable inside the LifetimeReplicatedProps if I do it the way you do?
That's a thing for every c++ replicated variable, I think. I'd forgotten about that.
They refer to it an OnRep function in the rep notify section, void OnRep_CurrentHealth()
That's just a convention.
You don't have to follow it. It's not set in stone.
And it can be any function which matches the signature (ufunction with void return with no params)
ye, thats just what I know as an OnRep function. I know it can be called something else but I was just confused they said it was something else π€·ββοΈ
They were explaining it's blueprint implementation so I wanted to know the C++ implementation
ahh, I sent you blueprint docs ?
They said it was something else...?
No, you are just confusing me. What do you mean by they were explaining the blueprint implementation ?
#multiplayer message Yes, this message to me translates to βno thats not what Iβm looking for, thanksβ
So thats where the confusion startedβ¦
no, I am saying it's different from the one I looked at previously, you asked a question before sending that link
Then it was just a misunderstanding.
how do i get the state of a specific clients scenerender capture
and associate the scene render capture with an id
Same way you'd get any other information about a client.
Have the client send an RPC with that data to the server.
how would i associate a playfab id they get when they log in (variable) and attach it to the rpc
is there a way to just replicate the image that is retrieving the scene capture instead of replicating every item that is attached to the player
You want to replicate the image?
I.e. stream a video from the client to the server?
Or is it a single image updated infrequently?
single image
Either way, I think that's too much info for regular replication. It might just fall over. But you can try. You'd have to access the image data and send that.
A TArray<uint8> effectively.
I doubt uint8* would work.
A material is just like a program that runs on your gpu. It contains no real data...
What are you trying to acomplish?
Why do you need to send an Image across the network?
show what items other players have attached to their inventory
im new
I had the same question, I thought you were trying to do some opencv stuff on the server or something
ur trying to do the same thing as me?
nope, I just wondered why the server needed an image
and the only thing I could think of was some crazy opencv thing lol
ohh
Hello, from a FOnlineSessionSearchResult, anyway to get the current player number ?
Just 4?
Then Is Replication process in Dedicated server more complex?
Which Type Is Preferred for 100 player multiplayer game?
I gave 4 as an example if you're trying to make something that can be hosted by any random Android phone. With mobile you have to set expectations to be low as they're not super powered devices with tons of RAM and network capability. It could be more, it could even be less depending on the device, the game, and the network.
You won't be running a 100 player server on a listen server, especially if it's on an Android.
You could potentially run a 100 player server on a dedicated server but it would require extreme levels of network optimization.
Even with dedicated it takes massive work
The replication process is the exact same between listen and dedicated, and if anything programming for dedicated is somewhat simpler. With a listen server you need to take into account that the server of the game is also a client, so anything that you normally would want to happen on a client only may also need to happen at some point on the server too which can have its own set of quirks depending on what you're trying to do.
Im thankful there is a plugin that replicates material in marketplace
Going to get that later when i get to the part
Why replicate the material though? It's usually much easier to just replicate some basic state and locally set up a material for it.
I mean you can replicate a material or an instance that is in the content browser already. Just not it's parameters. But those are usually driven by other replicated state.
I want cloth customisation where the user insert their own texture from their computer
Simmiliar to maple story 2 cloth customisation
They give you a template for the texture then user can edit the texture in their comp which they can upload to the server for everyone to see
If its a material that we have access in content browser, then there is no need for me to replicate the material
Bandwidth: dedicated servers, bandwidth is the maximum amount of data transmitted to and from the server per second. bandwidth is only about the internet speeds right?
Well, kinda
There are some suggestions for how good the average download of a player is
But your DedicatedServer should also not push out tons of data
Oh yes! good to keep that in mind thank you
Hello everyone, i have a question, if i make a dedicated server, i have to make 2 Projets? 1 client and another server to avoid leak server informations to clients ?
i can click on my players to open their inventories. i was gonna detect what player is clicked by line tracing and getting a name tag component and the name thats within the component. is that a reasonable method?
Seems very unreasonable, unless you meant to type βI want toβ instead of βI canβ. If you can already know what player you clicked on to show their inventory, why do you need to use another line trace to find that info you already have.
i dont know what player when i click on it yet
i was gonna use the linetrace to get the nametag within the name tag component and use it to verify other aspects of their ivnentory
βI can click on my players to open their inventoryβ is that a factual statement or a dream ?
nvm
instructions unclear, conflicting information. If you wont clarify it then π€·ββοΈ
this is a spiritual journey i need to conquer on my own
Through c++, I am used to creating blueprint references using TSubclassOf, compiling then assigning through the editor. In the case of a struct definition that isn't created until runtime, I need an in code reference to the blueprint. What is the best way to achieve that?
Something like this?
ask the #cpp wizards, you stand more chance of an answer there probably
Hi. Do replicated actors(those who aren't the authority) tick? I didn't see anything in the doc saying they don't tick, but I'm having this situation where a replicated actor ticks only once and then never again, even if I re-enable the ticking manually after.
I think so, the tick should run on all instances of the actor I believe.
Thanks. Does my issue ring a bell?
its not one I have encountered, are you using bp or c++ ?
c++
Oh
What is the easy way but good working one , to set up a dedicated server?
I would offer to look but Im new at c++ anyway so wouldnt be much help, I would have asked if you are calling super begin play, but if it ticks once and works on authority you must be, right ?
Should I get help from third party?
I am calling it. It's weird. During the tick CanEverTick and IsActorTickEnabled are both true. Then no more ticks and if I check the actor after that CanEverTick and IsActorTickEnabled are both false. Then if I set them to true it has no effect(no tick), but they do stay true.
I dont know then, Its hard to say if its a c++ issue or a MP issue, you could try cpp but as soon as you mention replication they might send you back here lol, worth a try thoβ¦
I'll try. Thanks for your time.
And There's no p2p in unreal right? then it's a listen server type , how many players can it hold? 12- 32?
However many your computer can handle.
How often should this event fire when the UI is set to 2 players and "Play As Client"
how long does it take a TArray to replicate?
If you're worried about that, it might be worth looking into a fast array
no im not worried about it, im experiencing an issue where the client crashes when updating the main hand because the inventory hasnt updated, this is my code
{
UpdateMainHand();
}
void ATGB_ADW_UProjectCharacter::UpdateMainHand()
{
UE_LOG(LogTemp, Warning, TEXT("Testing: %s"), (Inventory[0] ? TEXT("true") : TEXT("false")));
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Green, TEXT("Test"));
UE_LOG(LogTemp, Warning, TEXT("Item: %s"), *Inventory[CurrentSlot]->GetFName().ToString());
// Attach the weapon to the First Person Character
FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true);
Inventory[CurrentSlot]->AttachToComponent(this->GetMesh(), AttachmentRules, FName(TEXT("GripPoint")));
btest = true;
}
void ATGB_ADW_UProjectCharacter::AddItemToInventory(AItem* Item)
{
if (GetLocalRole() == ROLE_Authority) {
if (Inventory.IsEmpty()) {
Inventory.Add(Item);
UE_LOG(LogTemp, Warning, TEXT("Item: %s"), *Item->GetFName().ToString());
CurrentSlot = 0;
UE_LOG(LogTemp, Warning, TEXT("Item: %s"), *Inventory[CurrentSlot]->GetFName().ToString());
UpdateMainHand();
}
else if (Inventory.Num() < 5) {
Inventory.Add(Item);
}
}
else {
UE_LOG(LogTemp, Warning, TEXT("Someone Without Authority Attempted to Add Item To inventory"));
}
}```
it errors on Inventory[CurrentSlot] when the client calls the Update main hand function
and i have discovered that Inventory[CurrentSlot] is null on the client but not on the server
here is the code for the header file as well
int InventorySize = 5;
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Replicated, Category = "Inventory")
TArray<AItem*> Inventory;
UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, ReplicatedUsing = OnRep_MainHandUpdate, Category = "Inventory")
int CurrentSlot;
2 projects? Is it should we have to?
Yes sΓ©parated projects ? Client/Server
Okay, first of all always check if the array item is valid before trying to access it
What slot is it printing out as the current slot? Is it what you are expecting?
yes
I meant in the update hand function
yes
Why are you updating the main hand on both server and client?
the only issue as far as i can see is that the AItem being added to the array is not replicating properly between the server and the client
The update main hand function is ran to draw the item on the clients screen as well as on the character model that everyone else sees
I'd recommend looking into the fast array if you want to attach something to the players hand when an item has been added
ok thx, i will try that
I'm confused
How to make a dedicated server
Should I make my pc as a dedicated server?
Will the EosCore Plugin help in creating a dedicated server?
Will it create a brand new dedicated server?
Or will it make my pc as the server
will this work on android?
or should i not replicate the inventory and just replicate the item that is in the main hand?
and just let the client talk to the server whenever they need to change main hand slot?
im trying to figure out the best way to notify clients of a player joining the server, i know theres login/logout in the game mode but the game mode only exits on the server? is there a callback like this that gets called in the client? or do i have to add like a multicast in the login for the clients to be notified?
anyone able to help me out. I got a dedicated server and within the gamemode I Open a new level and it doesnt appear to be bringing the players to the new level like i recall listen servers doing. I have seamless travel enabled and im not opening the level with any special options thanks for the help!
i have not done this before but i think you need to use "server travel" instead of open
How did you get a dedicated server?
did you make it?
u need to compile from source if u want to make a dedicated server
theres tutorials on youtube for that
Hello there mighty multiplayer experts. I have a question you might be able to help with.
As you can see on the screengrab I run a Event on the PlayerController (1) to spawn a possessable pawn at the location of a random PlayerStart(2) and then also possess it as the playercontroller. After that I try to bind a event to a dispatcher to update some variables later on. The Dispatcher is called on the Pawn (character).
This is indented to be a base for multiplayer (dedicated) (Play as Client Net Mode).
Problem right now is, the bind event does not fire when the dispatcher is called ... why could that be?
Oh well then If i make a dedicated server that way, how many players can it support in multiplayer like battle royale
Does the failed print run?
how can u increase the array size limit u can send over the network?
it does not
And the after print runs? O.o
it does
I'd maybe check that you're not somehow unbinding that event, or make certain it's being called.
And called on the right instance.
Right now it runs off of a Tick inside the Pawn
I'm confused by that RPC setup in the PlayerController
But I guess that's not the concern atm
And you're sure that branch is running true, ever?
Tested and yes
Well, your bind is ServerOnly
Are these booleans set on the Server?
Cause they aren't marked for replication
I assumed this was all server code. I am a little curious why the controller needs to care about sprinting for anything though.
I would say no, and also no to replication
Yeah, also what is that ServerRPC setup in the PlayerController
It's like you are standing in front of the fridge to get food, and then walk to 3 different rooms just to get back to the fridge
What does the RPC do
RPC as in ... ? sorry : s
You know what an RPC is or?
Cause otherwise I will send you to the Compendium before doign anything more
Controller probably also shouldn't be saving it's own boolean to a state that isn't really relevant to the controller itself.
Controller has access to it's possessed pawn which has access to it's sprinting state. But it still shouldn't really need it.
For the record:
GameMode's PostLogin will call for new players. Can also use HandleStartingNewPlayer or whatever it is called. You can do your spawn code there. There is 0 need to have the RPCs in the PlayerController, unless you are passing data to the Server for the spawning that the Server doesn't know about.
And even if you want to trigger this from the PlayerController, you can just do that on BeginPlay instead of limting it to LocallyControlled, you can limit it to Authority.
For the sprinting: You need to set those booleans on the Server. Your "Svr Sprint True" (and apparently false, even though you could just make one event and give it a boolean input) need to set that variable.
Furthermore, BP replication of custom movement, like sprinting, will feel really shit
Movement Replication is advanced and needs C++ to be working well
HavenΒ΄t come to that, it works okay right now
Yeah cause you have no latency in the editor :P
Will process the other information and optimize, ty for that ^^
was thinking about that ^^
I'm still unsure why, but that Actor had bAlwaysRelevant = true and this is what caused it... (replicated actor only ticking once)
Well, quickly moving the Spawn event to the OnPostLogin inside Gamemode also fixed the Problem with the Event Dispatcher ^^
doesnt make sense π€·ββοΈ atleast you worked it out
Widgets gets removed from parent when using open level, is it possible to keep them using blueprints only? (to use as loading screen for example)
IMO I would recommend just checking out the CommonLoadingScreen from the Lyra project. All you need to do is copy the plugin folder and then set the widget class in your project settings.
For testing, all you have to do is set your Netmode to "Play As Client" and this will run a dedicated server instance in the background and the editor will act as a client that connects to it. If you want an even more authentic experience, you can set the editor to "Standalone Game" which will then create real instances of both the server and client instead of having the editor simulate them.
If you're new to multiplayer, it'll be a long while before you're ready to actually package a dedicated server. Once packaged you can then deploy it to whatever computer you want to have running it, start it up, and then have clients connect to it, but again, it sounds like it'll be a while before you'll need to do that and you have a lot of other systems to figure out.
For releasing it what should I do?
For android..
You're not even at that step yet. Don't worry about it for now. Learn how to make something multiplayer.
Learning how to make something multiplayer can give you further insight into what you're trying to accomplish and help you to determine what you're capable of and what you need.
That's a very vague question to try and answer because there is no set number of players a game server can support. It depends on the limitations of your game. For instance the complexity of the code that has to run every frame, the desired player experience in terms of client prediction vs rubber banding, the frequency of actors sending updates over the network and the server's hardware are all factors that define this number for you. If you want a game to support lots of players on one server then you'll probably want to design it in a way that keeps players far apart from one another as much as possible so that you don't have to constantly update as much data.
Well I kinda have created a multiplayer game and want to release it
does it depend on the fps?
It depends on everything
FPS is part of the player experience yes
If 100 players are all in the same room that's 100 characters each client's PC has to update every frame. But if 100 players are spread out all over some huge map then you can use various optimizations to only update the number of other players which are relevant to the current player.
fortnite is cheating! its unfair π
Oh
Optimzations to only update the number of other players which are relevant to the current player?
there are a bunch on top of that
And you're asking about EOSCore and what a dedicated server is and how to make one.... If this has anything to do with the project you've been mentioning recently.... You had jittery character movement, and strange scaling issues on your character. You said made a combat system that isn't working out a couple of days ago and asking for recommendations for a combat system on the marketplace.... You then start asking about hosting a "peer to peer" server in Unreal which isn't a thing, then asking about hosting 100 players on a single server. This is not stuff that can easily get solved in a couple of days.
Not to be mean, but you're miles away from being able to release anything sane unless you've scrapped that project and decided to go for something extremely simple but I doubt that based on your questioning about running huge multiplayer games and it doesn't sound like you've gotten a handle on multiplayer yet. You still need to figure out matchmaking / online subsystems at the very least.
If all you're actually trying to do is test by having a couple of androids connect to a server, at the bare minimum, all you need to do is have a computer running the editor and hitting play on a level with it set up to run "Play as Client" which will then create a dedicated server instance for you. You can then grab your internal IP address of the computer its running on and have the clients connect to that IP address at port 7777 and they should then be able to join the game.