#multiplayer
1 messages Β· Page 125 of 1
That was my hack around it. It runs on the Lobby game mode and checks when a player joins via OnPostLogin
You can change the instance to the Extra Settings session, this was made by me before I understood/used them.
cool, thanks!
Like they still join but then they get kicked out.
I was trying to do something like that
Then when loading sessions you can just do a check to see if the session is full.
Keeping old projects pay off π
π
ok, thanks, I'll try that
Any array works like this unless specified otherwise
Index is just the offset in memory to read from
hello, i have some initializations on begin play, but sometimes repnotifies are received before begin play starts and i get crashes or unexpected behavior because they weren't spawned/initialized yet. What is the proper way of handling that? Here are a couple of possibilities to handle this:
1- If we receive the repnotify we make sure the things it needs are initialized also there, even if it means duplicate code
2- Defer what the repnotify executes to a point where begin play has already executed
3- Have a way to only replicate variables that have repnotifies after begin play executes
4- Move the begin play logic to PostInitializeComponents which i think always fires before any repnotify
You can always add a list of delegates to be executed on beginplay.
Or perhaps on end frame after beginplay.
@latent heart do you mean option 2?
Yeah.
But what "begin play" indicates is up to you.
You can't rely on the end of frame for the first begin play that happens.
why don't you try to do the initializations when rep notifies are called
maybe consider sharing your code if you still need help
@lusty sky that's option 1
there are cases where begin play triggers first and others the repnotify triggers first
so either i defer everything to begin play, or i need to initialize in both places
this situation happens with GAS with the InitAbilityInfo
you put the initialize code twice
to whatever function is called first
How about checking if the actor has begun play and then calling it only if it has, and then calling whtaever setup you need in beginplay?
that should be initialized on possess right?
i would need to have delegates to be able to do that, because the repnotify executes logic
If you say so.
in the repnotify i chekc HasActorBegunPlay() if it has execute the logic, if not add to delegate
when it finished begin play broadcast the delegate
to execute the deferred logic
But then how do you detect if everything has begun play?
its kinda weird that on reps fired before begin play
Depends if you're using deferred start or not.
@cosmic yoke when testing try to uncheck run under one process it can cause some problems, and try to emulate bad network to catch race conditions
There is a chest on level and it has Inventory Component which holds some variables. First screenshot is BeginPlay of ChestBP to save any variable at begin. But when a client tries to get any variable of component of ChestBP, he always get default value of variable. Variables are right when Client to Client, but they cant access of variables of chest. Where am i doing wrong?
Client prints length of "Duff" is 0
But if i add a default value to variable, it prints 1
That'll be why then.
Begin play is called at start, not when actors are loaded.
(or when they are loaded if start has already happened)
(I'm sure you know that, but others may not!)
yeah π
Does anyone know how to get player count with advanced steam sessions?
anyone had an issue where PushModel
fails to replicate a property, turning off pushmodel it works, but fails when its enabled
MARK_PROPERTY_DIRTY_FROM_NAME(ThisClass, RepAmmoCount, this)
but the property fails to replicate
thing is, it replicates initially
fails after that
guys am i doing something wrong? new rotation is a variable i have made
did you declare NewRotation in CPP_Character.h?
this is just visual studio being weird
also make sure you call Super::GetLifeftimeReplicatedProps
else your entire character will break
ok so im trying to replicate rotationg of my charcter
but whenever i play test, the joystick controls both players
i have another input that adds velocity and it works correctly
i also did in the same way with rep notify
i added a print and it just prints from client 0 for both screens
any ideas why?
will unreal perform the network id lookup automatically if i try to rpc a TArray<AActor*> ? if not i can just do TArray<FNetworkGUID> yeah?
Nvm Trying to send a FNetworkGUID via rpc wont compile
Is there a way of sending a variable amount of actor pointers In a rpc, or do I need to make a rpc signature for 2,3,4, etc.
TArray<>...
But does it do automatic network ID conversion
Yes
yes it should
It will never send raw pointers across the network for anything, unless you hamfistedly force it to by reinterpret cast or something.
So I take it Iris is abandoned?
Is it usable? I know itβs marked as experimental but so was geometry scripting when I was using it just fine
Enhanced Input has only just gotten out of experiemental...
And the previous system was marked deprecated like 5 versions ago.
There are some people that use it. I believe they say there are benefits to it, but a lot of extra boilerplate or something.
hey guys im using a touch interface for my input but my input only registers to one client. both the client and the listen server control the same character instead of controlling their own, kind of like this: https://www.reddit.com/r/unrealengine/comments/jofcxz/replication_problem_with_touch_joystick/?utm_source=share&utm_medium=ios_app&utm_name=iossmf
any ideas on how to fix it
You can't ahve input events run on 3 different machines.
It doesn't work like that.
If you want to share input, you need to forward the input events to the server from the clients.
no i dont want to share inputs
i want the joystick to rotate my character
but it rotates mine and the other players character
like one joystick is controolling both
this is also in the default thirdperson template
wth
Are you using "get player character / controller" with the index input anywhere?
nope
Seems to only be controlling that one character there, not both.
I get that it's controlling the wrong character in one of those instances, but...
Search your editor/project preferences for "process" and make sure the 'run under 1 process' isn't ticked.
sorry if i was ocnfusing
oh holy crap you fixed it
thank you so much
π π π π
First time working with unreal and I'm a bit confused about how multiplayer works. This is in my player controller:
This is an indication that your code is wrong somewhere.
but that was the default thirdpersontemplate i didnt change anything in it
From my understanding: On the client side GetGameMode will return null. But will the player controllers that live on the server trigger the begin match function?
It may not be set up to use multiplayer correctly.
I would just like to do things the right way, but I'm using local multiplayer only for now
The player controllers all live on the server.
It is hiding the error.
Ok nice, so they will trigger the Begin Ozo match that is implemented in GameMode right?
And on clients the code will just return a nullpointer?
All the clients will have a copy of their own player controller and the beginplay method will be called for each of them locally and for every player on the server
Ok cool thanks! Perfect thats nice
That is, the server has a copy of all of their player controllers so it will be called on each PC object on the server - i.e. all of them.
Regardless of whether that player is actually the server (in the case of a listen server) or not.
Very cool, thats how I hoped it would work
Just to be clear, as I don't think I was very clear, the remote clients do not have any other player's player controller.
Only the server has them all.
it works fine with wasd it only does that if i use the mobile joystick
It might be the mobile joystick is shittily coded.
probably
anyone have any idea why a pushmodel prop wont replicate
even when its marked dirty
i guess ue5 isnt made for mobilwe games
ofc its made for mobile games
lyra has an implementation of virtual joysticks that work
aight i need to try it out
usually when this happens to me its because I forgot to "DOREPLIFETIME_WITH_PARAMS_FAST" it
i have that
it replicates initally
but never again after
it hits here just fine
(on initial replication)
this hits just fine
and you can see i am marking it dirty
it hits and calls it just fine
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
FDoRepLifetimeParams SharedParams;
SharedParams.bIsPushBased = true;
//Initial and owner only
SharedParams.Condition = COND_InitialOrOwner;
DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, bFromPickup, SharedParams)
SharedParams.Condition = COND_None;
SharedParams.RepNotifyCondition = REPNOTIFY_Always;
DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, RepAmmoCount, SharedParams)``` the properties are fine also
hmm, my lifetime params are a bit different than yours
FDoRepLifetimeParams Params;
Params.bIsPushBased = true;
Params.RepNotifyCondition = REPNOTIFY_OnChanged;
I have no .Condition
yeah but regardless
even in lyra they dont work
do you think it could be an engine version error that causes my both players to control one character when using mobily joystick
now that I think about it, I think I once tried REPNOTIFY_Always and didnt work for me either
ended up changing to REPNOTIFY_OnChanged, I didnt really need to always replicate anyway
have you tried REPNOTIFY_OnChanged instead?
and make sure the value actually changes
maybe the value is not changing then?
it is
hmm strange
RepAmmoCount on server changes from 0 to 30
client is always just 0
cause the property doesn't replicate back
Any idea why when i played alone works fine but when played on client line trace it's weird?
It's necessary replicated line trace? Or i need only destiny location?
How does the SpectatorPawn gets spawned on the server as a not replicated Actorc but the same spawns only at the client?
And why the heck the same Actor BeingPlay method doesn't get called at the said client
Each item in your inventory uses an RPC?
What if instead you handled the inventory state using RepNotify?
and just have one RPC to handle an inventory change which has some input for the inventory item's ID or something
eventually means reliable after sometime
but a single unreliable RPC can be dropped and won't happen again unless manually called
but if you make them reliable RPCs then players could potentially cause an overflow if they trigger too many RPCs which results in a disconnect
Yes you can do client side prediction by just setting the variable at the same time with a regular custom event
There are a few things you need to do to solve this:
- Use replication for updating the inventory from server > client, as lawlster mentioned.
- Don't use the index of an item to identify the item in an operation from client > server. Use some other id that uniquely identifies that specific item, because the server may have changed indices while the client was sending its RPC.
- Inventory prediction is very difficult to get right and you'd be better off separating out the bits that need prediction from the rest of the inventory. If by "equipping" you mean dragging things into slots I wouldn't bother predicting at all, or only "visually" predict it.
If by "equipping" you mean scrolling through a hotbar/quickbar/whatever, then the answer is it's complicated, but less complicated than predicting the whole inventory.
So more of scrolling through available weapons then
quickbar/hotbar
So the basic flow for that would be to have the "hotbar" basically be a simple property that specifies which slot in the inventory is selected.
When the client wants to switch weapons, it changes this slot locally and sends an RPC to say "i want to swap to this new slot".
The server replicates the new selection back and in the OnRep you check if it's the same as what the client already has or if it's different. If it's the same you do nothing, if it's different you run the "equip" logic for what the server sent.
There's a lot of extra complication here though. The server rejecting the selection isn't too bad - it just replicates back the old selection (you will have to force this depending on the replication method).
The complicated part is something like the server telling the client to equip an item that the client doesn't know about yet.
Which can happen if the selection replicates before the item itself does.
I haven't made any inventory systems before but I do understand that its considered best practice to try and always use replicated properties for anything stateful and use RPCs for events. Multicast events are only really used for anything else that doesn't affect gameplay as much such as particles or audio that everyone should still see / hear.
Yep, you want replicated properties rather than RPCs for a lot of reasons. The most obvious one is general network performance - reliable RPCs are sent out immediately so if you have a lot going on this could hinder performance (and if you have too many you'll overflow the reliable buffer and disconnect). Replicated properties are only sent out at specific intervals and only when they change, and they are reliable (they will eventually be received, it just takes some time). For something that's predicted this is generally fine as long as you don't need additional information from the server.
The other reason is that you don't have to manage sending out RPCs for other players if they join late. Also, multicast reliable RPCs are very expensive.
That doesn't really solve anything
The actual solution is that the thing managing the hotbar needs to also listen for when items get added. If the newly selected item doesn't exist yet it has to defer processing it until the new item is received.
This kind of data race is super common and unfortunately something you just have to learn how to deal with.
Deferring things until you have all of the required data is pretty common.
Ehh, I guess? That's about deferring synchronous operations until later. This might not happen until who-knows-how-many frames later so it's async.
Yeah I don't know about creating a queue. This would be more like just not firing off any "item equipped" events until the item exists.
You listen for both an "item added" and "selected item changed" event. If "selected item changed" fires but the item doesn't exist, you don't do anything. If "item added" fires and the selection is for that item then you fire the event.
You could do that as part of a more generic solution but it's somewhat unnecessary for this
there's only a few possibilities here when you receive a new slot selected:
- the item already exists locally, immediately fire off any functions to show meshes or whatever you need to do
- the item doesn't exist locally. Mark it as selected (even though it doesn't exist) but don't fire off any functions to "enable" it (since it doesn't exist). When a new item arrives, simply check if it's the item that's supposed to be selected and then fire off your functions.
You don't need to store any extra state for #2 - if an item has newly arrived then you know for a fact that you haven't fired off events that result from selection.
Lyra's quickbar might be worth looking at for some inspiration. It has a pretty simple quickbar component.
Is there a way to conditionally replicate a component? Similar to AActor::IsNetRelevantFor?
Not as a whole object, but you can do conditional property replication
DOREPLIFETIME_COND is the macro I believe.
I got a door that opens and closes with rpc. When players joins mid game the doors start glitching out. I read you need to use a rep notify but is there a way to fix this issue with rpc. The doors use a timeline and I can't use that in a rep notify function.
Use OnRep for state. In the onrep function, just call the custom event that does the timeline.
via multicast or server?
Neither
when calling the custom event
You don't need to do either
You just replicate the state and the onrep function will run locally. Inside of that function you call a custom event that just runs the timeline.
what do you mean by replicate the state?
Variable replication
You just change some variable value, that represents the state of the door (most commonly something like bIsOpen). That is then replicated to clients. Because it is stateful, joining clients will get the most updated value. Inside of the OnRep function, that will be called when the client receives the updated value, you just call a custom event that actually runs the timeline.
awesome thank you
hey guys for some reason when i am using mobile joystick in multiplayer, both players control the same character instead of their own
i tried it in the ThirdPerson starter and in Lyra
same problem
check in blueorint channel u might find an answer
alright
help needed , i have a multiplayer game of 8 players , im trying to make the players have the ability to switch cameras from third person camera to a free-look camera to navigate across the map , so far it works , i can keep switching between the character and the camera , but that only happens for the host , client arent able to possess the camera , how do i make the clients possess the camera ? (there's only one camera that they share)
guys i have a problem that is fixed if i uncheck run under one process, is that an okay fix or should i not do that
If u uncheck run under one process then basically unreal treats each and every players as a different/seperate/new system. For ex lets say u have an auto login system and u have logged in once so in upcoming times it will auto login successfully but if u uncheck run under one process it will treat it as a new/different system and so u have to login again
Do bp Rep notifies execute on client joining an in progress game if the rep was updated/activated prior to them joining?
Yes
Ty
Replicate a byte, increment it each time a shot is fired. Play FX from an OnRep
If it's automatic and fire rate is fixed, use a timer and a replicated 'bisfiring' bool or whatever
More reading: https://jambax.co.uk/better-burst-counters/
I'm using bp
Repnotify still works in BP
anyone here used iris and got it to work, could maybe give me a little hand? π
[2023.10.22-23.05.38:786][140]LogIris: Verbose: Generated identifier(0xf8d1408505cb4131) From /SCRIPT/KAOSCORE.KAOSCOREGAMESTATEBASE:KaosCoreGameStateBase_LifetimeConditionals
[2023.10.22-23.05.38:786][140]LogIris: Verbose: Generated identifier(0x403e205f56e2c0dc) From /SCRIPT/KAOSCORE.KAOSCOREGAMESTATEBASE:KaosCoreGameStateBase_State
[2023.10.22-23.05.38:786][140]LogIris: Verbose: Registering descriptors for Class KaosCoreGameStateBase : ArcheTypeOrKey: /Script/KaosCore.Default__KaosCoreGameStateBase
[2023.10.22-23.05.38:786][140]LogIris: Verbose: FReplicationProtocolManager::CreateReplicationProtocol Created new protocol KaosCoreGameStateBase with ProtocolId:0x4245a685fbaa6463
[2023.10.22-23.05.38:789][140]LogIris: Verbose: Registering descriptors for Class KaosCoreAbilitySystemComponent : ArcheTypeOrKey: /Script/KaosCore.Default__KaosCoreGameStateBase:AbilitySystemComponent
[2023.10.22-23.05.38:790][140]LogIris: Verbose: Registering descriptors for Class KaosCoreExperienceManagerComponent : ArcheTypeOrKey: /Script/KaosCore.Default__KaosCoreGameStateBase:ExperienceManagerComponent
[2023.10.22-23.05.38:840][140]LogLoadingScreen: GameState hasn't yet replicated (it's null)
[2023.10.22-23.05.38:868][140]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.05.43:740][673]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.05.48:873][289]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.05.53:874][889]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.05.58:874][489]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.03:874][ 89]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.09:100][716]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.14:100][316]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.19:817][ 2]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.25:592][695]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.30:951][338]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.36:318][982]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.41:324][582]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.46:326][182]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)``` seems iris doesn't want to replicate my gamestate to client
infact nothing is ending up going to client
now getting
[2023.10.22-23.16.11:825][205]LogOutputDevice: Warning: Script Stack (0 frames) :
[2023.10.22-23.16.11:825][205]LogOutputDevice: Error: Ensure condition failed: !Context.HasErrorOrOverflow() [File:I:\Daniel_AresGame\Engine\Source\Runtime\Experimental\Iris\Core\Private\Iris\ReplicationSystem\ReplicationReader.cpp] [Line: 1618]
Overflow: Y Error: None Bit stream bits left: 0 position: 6377
[2023.10.22-23.16.21:351][205]LogStats: FDebug::EnsureFailed - 0.000 s
[2023.10.22-23.16.21:351][205]LogNetTraffic: Error: UChannel::ReceivedRawBunch: Bunch.IsError() after ReceivedNextBunch 1
[2023.10.22-23.16.21:351][205]LogNetTraffic: Error: Received corrupted packet data with SequenceId: 505 from server 127.0.0.1
[2023.10.22-23.16.21:351][205]LogOutputDevice: Warning: Script Stack (0 frames) :
[2023.10.22-23.16.21:351][205]LogOutputDevice: Error: Ensure condition failed: false [File:I:\Daniel_AresGame\Engine\Source\Runtime\Engine\Private\NetConnection.cpp] [Line: 3662]
Received corrupted packet data with SequenceId: 505 from server.```
I have a delegate that is firing - but it is always on server auth .... i want to run a local function minus any RPC if this is possible? I dont need an RPC event - dont need the overhead/network traffic... because end of hte day it goes to UI rendering things.
Is there a way to pull this off?
if the server is the only thing that knows the event is firing then no
clients can't pull events out of thin air unless they already had the data necessary to know the event happened
thanks for hte clarification
i'll have to track down GAS stuff - theres local prediction - which i should be able to rely on
is this a rule of thumb? Any RPC that would fire off a delegate - client doesnt have access to?
i can RPC this event series here - and i can see that it is running on client at this point ... however hands down the delegate i'm trying to execute doesnt make it through the clients UI
but works perfectly fine on the server
yep that seems to be the case - i can run a function with direct access to the widget chain - but the delegate doesnt bind in clients :/
#Live&Learn
Huh? Delegates have nothing to do with networking and have no idea if they're called on a client or server. If you broadcast a delegate it executes on the local game, end of story. It doesn't matter if it's from an RPC or not.
Hello folks! I am pretty new to unreal and I am learning how to create a multiplayer game, today I have been running into an error message saying "LogPlayerController: Error: EnableInput can only be specified on a PlayerController for itself" whenever an client is running. After a little bit digging, I noticed this error message was from the APlayerController Class. From the function it seems to be implying the clients don't have their own player controller, although I have set the BP_Controller to be replicated?
At the moment, I have created a character BP with a Character Movement Component, both are set to replicated, and a controller BP which is set to replicated as well. If anyone has any insight about how to resolve this error message that would be greatly appreciated! I have read through all the posts on google and sadly none seems to help...
Not sure if this would help or not but this is a screen shot of the function where the error message was triggered:
This is the game mode I am using:
Strangely enough, you don't need to have player controllers marked as replicated.
Are you calling enable input on your character class anywhere? Like maybe you're calling enable input while running on the server, or somewhere in Begin Play?
Hello Datura, thank you! I will try unchecking the Replicate box and see if the error message goes away or not. The tutorial I was following has the replicated ticked and that is why I have that set....
I am not calling the enable input anywhere! Although I am indeed using the enhanced input system and calling "AddMappingContext" in my GSPlayercntroller cpp
I am not sure if that would be relevant in any way
A small update... the error message went away when I re-generated a blank controller. Guess I will have to start from the scratch again π«
I remember I ran into similar issues when I first started. I don't remember the exact details but I remember it was happening because of live coding. There is nothing wrong with using live coding but you have to be a little more careful or it creates problems in bp side. Make sure you use live coding for small codes and time to time make a normal full compile(from VS when the editor is closed).
And it is always a good idea to double-check if bp is overwriting CPP settings. Like the replicated checkbox.
Thank you! @lilac jasper I will be more careful next time...
Could anyone provide some insight on what might be seen as the "max" RPC size, in bytes?
I'm doing a heavy network call, but IDK if I should split it into like 50 calls, or 1 big one?
If in the end the amount of bytes end up being the same, I'm not sure if splitting is really needed.
For context 1 call is 45 bytes, but say I had to do 300, or 600 calls, very well reaches 13500 bytes, or 27000 bytes?
and, thats at the most basic of data.
This data needs to be on demand as the player wants to access it.
But, also don't want to store it all the time, as that just leads to massive memory leaks, since one of these actors can do this 300 calls, but what if the user has 10 or 20 of these actors.
RPCs I think max out at 65KB.
Oh..
Well, that makes the answer simple.
Now I just gotta make it work. π
I didnβt realize they had a forced limit like that.
what videos/documentation is best for COMPLETE begginers to learn multiplayer?
so im reading Jambax's guide to replicated uobjects and in the actor that contains the uobject to be replicated, ReplicateSubobjects is overridden to replicate the uobject/s on the given channel. is this actually needed? shouldnt marking the uobject as Replicated be enough? or does unreal only automatically replicate actors?
There's good stuff in the pins in this channel. Cedric's Compendium is great.
Unreal only replicates actors & actor components, and you do the ReplicateSubobjects override so that it uses a replicated actor's channel to send it.
In 5.0 and above, you're better off using the replicated subobjects list
https://forums.unrealengine.com/t/using-the-replicated-subobjects-list/727659
However note that there is no need to make the list client-side too as that post suggests.
The only main advantage here is you don't need a specialist actor or component to register the objects with.
ah thanks. im pretty sure i understood this. ill have to play around with it at some point. is there more/better docs for the pushmodel or is it still just the comments in the header?
just the header comments. Push model isn't worth the effort IMO
Iris will do it properly though
so do you think i should just wait a bit until its more ready and just learn that instead?
Probably not tbh, the default system isn't going anywhere since Epics plan is for both to coexist. Iris is really going to be more about scale
But push model in the 'default' system we know and love is barely worth persuing
Makes no measurable difference even to large scale games
Hi mate, just going back to a conversation we had a while ago around clients being able to call Run on Server events I just want to make sure I'm doing this correctly before I go through and change everything in my project where clients are directly calling Run on Server events, is this the correct kind of set up? The Run on Server event is doing all the checks to make sure it can happen and if the conditions are met it runs it, but since this type of event only happens to the particular client who is wanting to heal, its called from a Run on Owning Client event to request the action, is that correct?
It's close.
The "Request Heal" Run on Client is not necessary as you could call the Run On Server event directly.
The only bit that could be "cheaty" is that a player could potentially skip the hold requirement of the input and trigger the heal repeatedly if they wanted. The way to fix this would be to move the hold logic to the server.
So Input > Run On Server "Input Pressed" > Call the pressed input on your custom macro > Hold Output from Macro triggers the actual healing bit you already have running on the server.
Input Release > Run On Server "Input Released" > Call the released input on your custom macro.
Also this branch here isn't really necessary. Use a Clamp Float node instead which you'd connect into the Set Health node and set the Max on the clamp to Max Health.
Okay interesting! So if i don't need the Request Heal event, how come I can call the Run on Server event directly? Doesn't that allow the client to do the thing we're trying to avoid? and what if i were to add this node on to it which increments/decrements the number of bandages the player has once healed?
The PCref stuff is just widgets being updated
Is there a "more proper" way to set player rotation with a gamepad stick than a plain RPC? I set local rotation via state machine plugin and call server to set it there via this setup. I'm a "BP only guy" so that narrows the field of possible solutions, but still
A client must be able to call Run On Server events, otherwise the server can't know to run them. The idea is you need to control what happens after the event is called on the server.
Technically, you cannot prevent a client from repeatedly spamming the Run On Server event and it can technically be called at any time, even if you're not expecting your client code to be able to call it, someone can figure out how to call it whenever they want. That means your only way to prevent cheaty behavior is circumvnent what they may attempt to do - like if you need to hold an input for a certain duration before you want them to heal, that's something that you probably want the server to ensure is happening... That then means a player can spam the Run On Server event all they want, but unless they actually hold the input for as long as the server wants, they won't be able to do the heal.
As for the decrementing (or incrementing for that matter), that isn't something you should allow a client to call at all. You can just decrement the count after a bandage has been used (which would already be running on the server). Incrementing should be when the server decides that the player should be given more bandages (like when the player walks on to a bandage item, the server detects the overlap and then grants them the extra bandage.
The number of bandages should be a "Rep W/ Notify" variable. No need to RPC back to the client, just use the OnRep function to drive anything that you want changed when the updated value is received from the server.
So i could set Current Bandages after setting the Health to take off a bandage? If i make it an OnRep variable what would i need to do in the OnRep function in this particular case? just updating widgets? or is there some logic that needs to take place?
Yes, and whatever you were doing in the Run On Client event could happen in the OnRep.
Maybe its my understanding of OnRep's but i thought that they're to replicate information to all players (eventually), is that not always necessarily the case?
OnRep functions are called when a replicated value is received by a client, and in blueprints, it also ends up being called on the server when a value is changed. You can differentiate where the OnRep is being executed based on the Local Role and Remote Role of the actor and the authority, (Has Authority > Remote typically calls on all clients who have the actor relevant, where Authority is usually the server).
You can change the replication conditions on variables so that the variable only replicates to the owner - there's a bunch of settings for that when you are modifying the properties of the variable.
Oh yeah I forgot about replication conditions although have never had to use them so far lol, so okay for this particular bit of logic i can do it that way but in other scenario's how exactly would a client request that the server does something without the client calling it directly themselves?
Also, does using the decrement/increment node on a OnRep variable call the OnRep function or do you actually have to set the variable for the OnRep function to be called?
Events can happen on both the clients and the server. You can differentiate that it's happening on the server using Has Authority an use the authority path assuming it's an actor that was spawned by the server. Overlaps are an example where you probably want to detected that overlap on the server without the client telling the server that they overlapped.
If you know you're already executing on the server because of something a client triggered, any functions you call from that point is then running on the server too.
Not 100% on that one. I think it does, but you can always test it.
Okay that makes sense, so if i use a Has Authority node and the Remote pin is being called, does that mean the client is trying to call some logic that ideally the server should be running? Unless ofc i want the clients to actually run different logic to the server?
Should overlaps always have a Has Authority node and is that enough to ensure the server is the one detecting overlaps and not relying on the clients to tell them that they've overlapped?
If the triggering event was executed on a client, and that event is hooked up to a Has Authority > Remote path, then yes, the client would be executing what is on the Remote path.
Yes, so long as it is on replicated actors that are spawned by the server, Has Authority > Authority paths will execute on the server if the event was triggered on the server.
Okay cool, and just to make things really obvious, i assume that if these replicated actors are already apart of the level itself then they are spawned by the server right? you don't have to actually Spawn Actor from Class everything for it to be spawned by the server do you?
Placed actors are usually spawned on the server by default, yes
Perfect, appreciate you help as always mate! I'm sure we'll be speaking again π
Rando question but has anyone heard whether Epic has plans to improve CMC, maybe something along the lines of bringing what's in Fortnite into the standard UE 5 dev environment?
I did hear they were working to replace it with something more generalised.
Or something like that.
Movement 2.0 was it
I shall once again hold off on purchasing GMC lol
π
Ive held off from a vat plugin so long that its prob 5-10x original asking price
Now i regret it
sry guys, how can I get the max players in session without having a session result?
I mean the max players of the current session the player is in
Surely you need a session to get the max players of a session?
that's the problem... I need the reference of the session the player is in
So get that then.
maybe I should use another method to retrieve that ref
I can't find the node to get the current session
Now that I can't help with!
Hey, is it possible to replicate a web browser (widget) in multiplayer. At the moment, the server and client can access it, but the client canβt interact with it
Sending Run On Server and Run On Client RPCs usually involves setting a client as the owner of the actor.
Yes. Client can get a mouse controller from the box collision but the widget itself doesnβt seem interactable
Can anyone advise on how to properly restart a co-op session without dropping a guest player?
i have this blueprint that is run from the server, on a replicated actor. it has this timeline that is replicated which should change color of the background lighting. however, as seen on the gif, on the left (client) it just suddenly changes while on the right (server) it works as expected. why is this happening?
Whats the replication frequency of the Actor you have the timeline on? If you throw in a ForceNetUpdate on the actor when start the timeline on the Server, does the Client one start to play more in sync?
hmm.. i could try that. if i remember correctly i did also try to run the timeline with an rpc which should work, but it did the same.
Hey all im trying to get this system replicated where a actor weapon is spawned and static meshes that are attached to the preview weapon are updated to what is selected in the SetStaticMeshes custom event
Its working in singleplayer fine and not in multiplayer
If i explictily set the meshes like this it works in multiplayer
So im guessing that the information where i select the static meshes isnt getting passed in from this blueprint where 'drop weapon' is called
Any help much appreciated
When spawning actors that are replicated to other players they should be spawned from the server not client.
Its called on event any damage which already should be run on server no
Sorry forgot to mention where its called
Because the actual spawn actor is fine its replicating but im just struggling with the static meshes
If I have a nested struct with an inner-most array which i add elements to, how Can i expected only that array entry to be replicated, or will everything, even the owning struct, be replciated?
Wondering if i should swap for fastArray or not ..
Its a quest system, so i don't reallllly see the need but...
Tried to network profile it but guess that wont work during loopback x)
Hello guys I'm trying to use multiplayer with listen mode, I want my other players to be a sphere instead of their Pawn for the local player. How do I create an sphere that replicates to the server all the player movement without replicating the character pawns?
Strange bug, I don't really know what to make of this. My player controller is applying a selection effect in what I presumed was a local context, I'm doing no networking here:
if (InputTag.MatchesTagExact(TAGS::INPUT::LeftMouseButton)) {
if(CurrentSelection.IsValid() && IsValid(CurrentSelection->GetAbilitySystem()))
{
const auto UISubsys = GetWorld()->GetSubsystem<UUIControllerSubsystem>();
UISubsys->UnbindAbilitySystem(CurrentSelection->
GetAbilitySystem());
CurrentSelection->SetPortraitRenderTarget(nullptr);
}
if(CurrentMouseOver.IsValid() && IsValid(CurrentMouseOver->GetAbilitySystem()))
{
CurrentSelection = CurrentMouseOver;
const auto UISubsys = GetWorld()->GetSubsystem<UUIControllerSubsystem>();
UISubsys->BindToAbilitySystem(CurrentSelection->GetAbilitySystem());
CurrentSelection->SetPortraitRenderTarget(UISubsys->PortraitRenderTarget);
}
return;
}
For some reason on a 2 client setup, the render target is bleeding over to the other client when I hover over
I have no idea why that would be replicated
but only on the render target?
Perhaps a bug with the engine doing this locally?
Hey guys
How can I make my replicated project of unreal 5 (blue prints) work multiplayer through steam services i
Its not that its replicated.
They both point to the same file, so it doesn't give correct results in the engine, you'd need to get a physical 2nd PC or something.
So they have 2 different file paths.
Normally when the game is played, both players point to file A, but on computer 1, and computer 2.
But, now "players" that are on the same computer 1, see the shared output of file A.
Why are you setting it to Always notify?
Dont apply a condition at all?
Regular DOREPLIFETIME is fine
That may actually fix your problem
If not, post all of your code.
You maybe marking it dirty incorrectly
Please dont paraphrase, just post the code so we can see.
Any idea? π
Why not make a pawn that has a sphere mesh?
Player Pawn? Well, I've tried to use my oculus Hands Character Pawn but the Hands started to get frozen in the floor after that and I could move both players hand pawns (could only move fingers) at the same time like I was controlling both or something like that but they were stuck on the floor and the sphere too so.. I thought it would be hard to manage that
I'm wondering if anyone has a solution to laggy UI in multiplayer.
Basically I have actions that players can queue up using the UI, but I dont know the best way to set them up so that the player is able to create and then modify an action that they have queued for the end of the turn.
Right now I sort of have something working but it isn't consistent enough because sometimes clients will make multiple actions instead of editing the first one they made due to lag
Trying to replicate a montage in a actor class
But this doesnt seem to work properly.
none of the other clients know what mesh you're referring to
you need to pass in a reference to the character you'd like to play the montage on
This is sort of impossible to make out :( You need to provide more information, show some code, etc
How common is it to implement custom player movement prediction inside the character movement component?
Referencing this specifically: https://forums.unrealengine.com/t/character-movement-optimizations/264969
I was seeing some rubberbanding with very basic character movement in a very basic setup. This fixed it a bit - but I'm wondering if something else was misconfigured
oh thanks, Easy fix π
Appreciate that
Works great
Its more of a question of how to structure the logic to begin with
I essentially need to let a player create an actor from a ui and then modify a property in that actor, I am not sure how to get around server lag though
I'm not sure what you mean by server lag, there wouldn't really be any beside the player's ping, spawning and setting it's properties would be pretty instant
All you'd need to do is create the button, when the player selects that button allow them to see all of the nececcary properties (presumably by changing a struct). Once all the properties has been created you'd want to send that struct to your controller... From there you would call an RPC to the server with the struct being sent... Finally the server would spawn the actor and set it's properties based on the struct it received
well server side its instant, sure, but its very easy for the client to send two commands to "create thing" when they really want to create and then modify the thing
you should create and modify it before sending, unless you want to be able to make edits later on
I do need to be able to edit later on
then you need to create a way to keep track of all of the actors you created
Setup either an ID system to identify which actor you want to edit, or use direct actor references
to be clear I dont have trouble with the client getting the actor that they created, I have a problem where they are able to accidentally create multiple of them because they have not been informed yet that they made one
oh
Just wait for the server to verify this information
Make a bool bCanCreateActor or something which on beginplay is set to true, whenever you create an actor set this bool to false, have the server send you an event "run on owning client" which tells you that the actor has been created, then you can set the bool back to true
that's simplest way I could think of doing it. You're just waiting for the servers validation here
You can add a timeout (say after 5 seconds, automatically set it back to true)
I'd say bCanCreateActor should just be a replicated variable, no need to RPC back to the client to set it true or not.
also an option, I don't like replicated variables but yeah
In this case the RPC is the right call, because they are able to create multiple in different places, just one per spot, so having it be an RPC for that spot is fine
wait I don't think he can use a replicated variable, because it'd defeat the purpose if he's worried about lag I think
exactly
I'll give this a try, thanks guys
I hadnt set up this kind of functionality before
If you do go with RPC, make sure you set the sending event, and callback to either be either reliable.. Or add a timeout
because if you never receive the callback you'll never be able to spawn another actor otherwise
hey π I built an inventory component with FFastArraySerializer to learn a bit but in my game the players should have "authority" of their own data instead of the server. so I am planning to remove all the replicated stuff from the component, but I have a few questions about the networking concepts that are a bit blurry in my mind:
- if I declare the inventory component as a
UPROPERTY()in a replicated actor without doing anything else, is it gonna be available both in the client and the server? is there a way to make it only available for the client? - the game is gonna have chests and it would be amazing if I could use the same inventory component for everything, but chests should be managed only on the server and the inventory contents replicated to the clients. so for that I would need to keep the replicated stuff in the inventory component, right? then how would I keep it local for the players?
Why should clients have authority of their inventory? You don't care if they add whatever they want to their inventory?
Hi guys, multiple RPC vs a RPC with array data, which one should I use?
Depends on what you're doing and if that data should be aggregated to begin with.
You don't care if they add whatever they want to their inventory?
nope, the players have full control for their data. the reason being that the game is coop rather than competitive, you host a server to play with your friends so cheating is not a big deal. I want to make the experience as smooth as possible
you can also use the same character on multiple worlds so its easier to keep the data on the client
I have been thinking about adding a setting on the world host to save the players data on the server to avoid cheating (like how it works with minecraft) but I think this would add too much complexity π€
I have damage feedback component that send net multicast rpc to display text on client, I am wonder if send multiple hit in one RPC is saving bandwidth more than multiple RPC per hit.
Ok. So having a UPROPERTY() of your component class doesn't meant it'll be populated with an actual component. You can create the component at runtime only on the client if you so desire and then store the reference that you created in that UPROPERTY. You can leave the inventory component marked as not replicated too.
In order to have an inventory component that replicates, you'll likely need to subclass your current inventory and mark it replicated. You can add this to chests and what have you, and players can read from that "shared" inventory class and see its contents. You'd have to make requests to the server to transfer items from that inventory and the server could RPC back to the client to indicate to add the item to their inventory.
You start to run into issues here as you're now relying on the server to send an item out of an inventory but without confirmation on the server side that the client successfully received it. You can code around this with extra RPCs but that's also having to send specific details of the data sent from the server to the client and back again to ensure that if it didn't work things get reset properly, but this is also assuming that something didn't happen to the connection before validation was confirmed.
Same with sending the server an item to a specific inventory, you'd send the item details to the server, along with what shared inventory component you want to place the item into, with the same caveats of validating.
I see, so I could have the same inventory component implemented with FFastArraySerializer for both players and chests, but only flag it to replicate it on chests actors?
Yep.
got it, I am gonna play with it, thanks a lot!
good point about the item confirmation, I might need to do something to avoid an item being sucked into the void if the client suddenly disconnects 
I am thinking more about this and another solution would be that when the player enters in a server, the client sends the save data and the server uses it as the initial point
so I don't need to deal with two different authoritative models
the inventory might still lag a lot tho, so I will need to think more about this 
This isn't different for rpc's tho
nah he's setting the bool locally
It really sounds like a tad flawed logic client side
Creating and modifying one action should be possible even without a server connection?
And whenever the client is 'ready', the action can be sent / commited
I think the actor is replicated, he just wants to create one, and make it impossible to create another. Althought the server could just make it impossible to do that I agree
The replicated bool should work just as good as an rpc
The initial actor would be local only untill it's configured?
Ah well seems they got an idea / proposed solution
I have no idea what the exact details were for him, but I wasn't focused on the best way to do it, I was focused on the easiest
I may be all wrong ofc
Anyone�
How to get the Local Controller? I thought there is a function for it. It's not exposed to bp?
Dont think so
Owning controller is usully the route i go..
Depends om where and for what tho
Hi, I have a box collision which is letting character to control web browser widget. In multiplayer Server gets control and can interact, but client gets mouse control but cant interact.
I have a mesh (for the screen) Attached widget to in and Box collision. (Blueprints are attached)
hey guys since i cant have events in a function
how can i "return on notify begin"
when calling an event
since im RPCΒ΄ing the event since its a anim related motange
( its not rpc on the pic)
Custom events can't return data
Not sure what you are doing but you can probably broadcast event on the on notify begin
Is possible that when I try to replicate a Character Pawn to the server this character position and rotation gets stuck because now is owned by server? I don't know how to solve it, my char pawn in the client is stuck on the floor
I am developing my EOS service with Steam. If I want to switch it out with Epic's backend, will it be a simple config change for simple functionality like session finding, server travel, etc?
Doed the code trigger?
yeah
Inside the foreach ?
5 is the only number displayed.
not even the 3rd one
get overlapping actors they remade it somehow from 5,1 to 5,3 ?
i updated yesterday
detection area*
both deers derive from the enemy parnet class
do they need some kind of collision parameters enabled if its picking classes inside ?
If you're not seeing 3 printed, then the Get Overlapping Actors array is empty, and if that array is empty that is an indication that the deer may be ignoring the collision response you have set on your Detect Area.
exactly my thought
so the collision respone on the detect area how dose that work ?
oh wait fixed it
it was on ignore,
nice ty
I am trying to create a multiplayer first person game, and have a separate first and third person model. For swapping held equipment I am spawning a replicating equipment actor in c++ for the static mesh with owner only see and owner no see for first and third person respectively. This works fine on the server but the owner no see and owner only see are not set on the client. Is there a good solution to setting those properties on spawn while using the same actor blueprint for both equipment actors, or is the best solution to have two blueprints for each equipment, one with owner no see and one with only owner see
You'll need to create your own way to replicate this information across. On your base equipment Actor, you could add a replicated boolean such as "IsFirstPerson" for example. During your begin play on the client, check this value and call the SetOwnerNoSee or SetOwnerOnlySee on the equipment's mesh component
Alternatively, if you know before hand which model is which, just have begin play call those methods correctly on the 1st and 3rd person meshes. This logic will also run on the Client when it calls BeginPlay
Ok, thanks for the help
I'm trying to make a character that rotates when I press A or D
In local multiplayer it works fine but when I try with 2 different machines the client is having weird problems.
On client side he rotates very slow (50% less as on server side)
While on the server side it looks like he is rotating with twice the speed.
When I calculate the new rotation on client and then send it to the server who calls a multicast to apply the new rotation the client rotates extremely slow.
This is what I have rn.
// Called when i press A or D
void Turn(float Value)
{
CalculateTurn(Value);
}
void CalculateTurn(float Value)
{
if (!HasAuthority())
{
Server_CalculateTurn(Value);
}
const FVector NewRotation = GetActorRotation() + FVector(0.f, Value, 0.f);
SetActorRotation(NewRotation);
}
void Server_CalculateTurn_Implementation(float Value)
{
CalculateTurn(Value);
}
I'm pretty new to this so I hope there is a more professional way to achieve my wanted results
client calls this part
if (!HasAuthority())
{
Server_CalculateTurn(Value); rotates once on the server
}
const FVector NewRotation = GetActorRotation() + FVector(0.f, Value, 0.f);
SetActorRotation(NewRotation); // rotates again on the client
i'd suggest splitting up the logic a bit more it seems very strange that CalculateTurn -> Server_CalculateTurn -> CalculateTurn
@quartz star
When replicating gameplay events like abilities in RPGs or MOBAs that need to be seen on-time and reliably, are replicated variables the correct approach?
I cannot use an unreliable multicast RPC because these abilities need to be seen.
And I cannot use a reliable multicast RPC because it would be too expensive to call them if I have tens to hundreds of characters using abilities often.
From what I have read, replicated variables seem to be the correct approach. And I had naively used unreliable multicast RPCs for my ability code and it isn't reliable enough. I just want to confirm this before making big changes to my codebase.
Thanks.
How can I get world input direction in multiplayer? I know I can't use last movement input as it's not replicated. I've tried doing math with acceleration but no luck.
Just replicate it if you need it.
Why not use GAS #gameplay-ability-system ?
It handles all that nitty gritty detail for you.
I like to do things myself. And I have been looking at how GAS works while adding multiplayer functionality to my own ability system. I have client side prediction and synchronization working, along with a couple of abilities already.
I just wanted to confirm the part where the server multicasts the usage of the ability to display animations/vfx . I have tested this with both an RPC and a replicated variable/struct. Right now I believe that using an replicated variable/struct is the correct choice.
Also, I think regardless of system used, it would be nice to know what is the general approach.
At first I thought it would be an RPC, because to me, a one time usage of an ability makes sense as a function. But after reading some great articles and posts about variable replication and what can be done with it in Unreal, it seems that variable replication is the correct approach. (https://jambax.co.uk/better-burst-counters/ https://forums.unrealengine.com/t/replicated-properties-vs-rpcs/264973). It also seems to me that most things--even events should be done through variable replication.
What adds a little bit of confusion to this is that I believe GAS uses unreliable NetMulticast RPCs for their GameplayCues (https://github.com/tranek/GASDocumentation#concepts-gc-batching). I would think Gameplay Cues would be a good parallel to what I am trying to do. I could definitely be wrong though.
Variable replication is typically never a good idea for one time events. Replicated Variables are stateful. Events (RPCs) are not.
Gameplay Cues are exactly what you are looking for.
They are Multicast to all Clients.
To perform cosmetics
Change your character's shirt? Variable replication (OnRep)
Show that someone is ignited due to a spell? RPC
What about the reliability? Think a moba ability, every player needs to see it, you cannot have a situation where it is not received.
GAS was literally created FOR a MOBA
Yes, I know this... I think your response diverges from what I was talking about. The fact that a net multicast RPC would need to be reliable for something like this. And from I have been told NetMulticast RPCs should be used sparingly.
Net Multicast for "short lived" effects makes a lot of sense due to the time to NACK and resend the effects to clients might be longer than the effect itself should be seen. For longer term visual effects, a replicated array could make sense. It really depends on how important it is for your game for the effects to always show up on the Client or not
The situation where something won't be seen is when you have packet loss or other bad network conditions. Everything is going to shit if that happens, and by the time a reliable effect gets resent an instantaneous effect may not even be relevant anymore.
That said, if the effects being played are tied to other data you already guarantee on the client (such as a montage being played) then you can potentially infer the effect's playback rather than replicating it as a separate event.
This is from what I have read in the unreal documentation. It seems though, the way I have seen replication used, stateful can mean quite a few things.
https://jambax.co.uk/better-burst-counters/ Uses variable replication for weapon firing. And quoted from the article:
"This is also a preferred approach to using Multicast RPCs, for several key reasons:
We want to leave the unreliable RPC buffer free for more important data, such as Character Movement and/or other mechanics that must remain responsive. (This matters more as we scale up).
We still want to know if a player has fired, even if we miss a few updates.
The solution works for weapons firing multiple shots and I have it working with a one time use ability.
It seems as though variable replication is generally less expensive overall, and I believe there isn't a difference in speed to the client. Atleast from the articles I have read--again Im not someone with multiple years experience in unreal multiplayer.
An instantanious effect is not stateful, that's why it's instantaneous.
Hence why I said "typically" not how you use Replicated Variables.
"That said, if the effects being played are tied to other data you already guarantee on the client" well that is the crux of it isn't it? I'm looking for way to reliably get that info to the client in a multicast scenario.
Your comments seemed to imply that you were moving in the direction of thinking that you will want to use variable replication for EVERYTHING
Weapon firing is stateful, it very easily fits into this. A ton of effects are potentially tied to it too, which massively lowers the cost compared to replicating everything individually (think about how often an automatic weapon fires, multiplied by every possible effect that it can result in).
A single ability activation does not fit any of that criteria.
Sorry for any confusion.
This is exactly the use case for the ability. A ton of effects are tied to it.
Sorry, I should say that a single particle effect does not fit any of that criteria.
Most ability activations are not instantaneous. You have some form of animation or wind up or something. GAS does accomplish this via variable replication.
And for sim proxies montages are replicated separately. Some effect data could be tied to that.
If the effects that you want to play need to be reliable, then variable replication is probably your best approach. If you use RPC's, you'll need some way to handle the player re-connect case and also potentially other Player Actors becoming relevant to your client after the effect was triggered. This can be done with RPC's but you'll need various hooks into the networking system to handle those edge cases (which variable rep should do for you by default)
So it seems that my solution with variable replication with something like https://jambax.co.uk/better-burst-counters/ is fine?
And for things that can't be tied to animation or the simple fact the ability is running, once again - the situations where an unreliable RPC are dropped are few and far between without other elements of gameplay being impacted.
If it works for your needs, then sure.
There are not really any "wrong" ways, only "better" ways.
The downside to variable replication is that it relies on the Rep Frequency and you generally will be sending all changed values each time you replicate an actor, where as the RPC approach allows for more fine grained control of the data you are sending. If that does become a concern, you can use a "Container" actor to hold all of your effects and just make it owned by the Actor they should be affecting
A wrong way is something that doesnt work at all.
Yes, I do have an animation wind up as well. Thats how Im able to get client synchronization and prediction done.
A better way is something that would be more efficient.
Whats efficient comes down to your requirements/needs.
Among other things.
Also, variable replication can still result in something being "dropped" - if replication data is unable to be sent by the time the ability finishes and whatever variables it used are set back then a client won't see that an ability ever triggered. There is no way to guarantee both timely delivery and reliability. The latter can only be guaranteed without the former, and only at a high cost.
You have to pick your tradeoffs, nothing is perfect.
Yes, and having a small struct or a single variable replicated for many characters every time an ability used should be fine, right?
My other solution of using a NetMulticast RPC, even though unreliable I thought would not be efficient after I had done more reading.
I'm just worried of a situation where I spend a couple of weeks finsihing the abilities for characters and turns out I was wrong in my approach.
Profile. This is what its about. You make an educated guess as to what is going to be the most efficient. Then you build it and profile it.
If its not where you want it to be, then perhaps you need a different approach or optimize what you have until its sufficient.
I disagree that my response diverges. Looking at how GAS would do something, a framework designed for a MOBA (one of your referenced genres), would give indication how Epic themselves use the tools for your given situation. And considering Fortnite uses GAS quite heavily, they're still actively using and developing it.
Oh yes, that is true. I am leaning on the side of something happening, albeit a little late, than not happening at all. I think I have the timings with the animations and effects done in such a way where a it will accommodate for ping issues, I just need it to happen.
Also as to severe network issues--things are going to be bad either way. π
I'm very well aware of what GAS is, I looked to their documentation and their sample projects as guidance before. And I stated this in my very first response to the discussion.
I just wanted clarification on the uses cases for RPCs and variable replication for a multicast scenario. If the only input I got back was to look at GAS or to just use GAS, then there would be no point in me asking any questions in the first place. Thankfully the discussion moved on from this and I got some good insight in the end.
Thats an intersting idea, thanks for sharing. I have read into rep frequency, and it is one of the things I will need to work on next. I'll will save this for then.
Isn't being on fire state though?
π€«
Hahahah, exactly "stateful" can be tricky
A better example for a multicast might be a muzzle flash or explosion
To be fair as well - being on fire is only a state if it actually has an actual gameplay effect. It could be entirely cosmetic.
anyone know much about root motion replication ? i can see there is some code references to "networked root motion montage", is that stuff worth using ?
i want some customizable behaviour with the root motion e.g allow some turning during root motion etc, does going down that code path support that ? i cant seem to find any docso n it
Not really. as I further clarified in my follow up to Adriel. I only did the shushing emoji for comical effect. There are plenty of games where being on fire is just cosmetic alone.
What is "stateful" is determined by the rules of your game.
The only root motion I've messed with is doing it locally and then doing an RPC to let everyone else know to do it as well. It's worked well enough so far. But I don't do much networked root motion admittingly. Maybe look into motion warping to see how you could incorporate it in your usecase. Don't know how well that works networked. I'd imagine it would follow the same principals though.
yeah thats basically what im doing rn, server rpc into locally predicted client playing, i also pass in the rot/loc just to ensure its synced
problem is the AI is capable of rotating very slightly during the "windup" of the attack and looks like the cmc refuses to show it to the observer during the montage but i can see on the server hes turning
so was basically wondering if i am missing something or if i am going to have to enjoy a nice venture into the cmc to override some weirdo behaviour
yea motion warping is a possibility aswell but i think we'd go for it more in a polish phase, rn im just setting up a new enemy for some basic playtesting
MW is actually pretty darn easy to setup. Like, 5-ish minutes to be honest.
hmm, i am abit suspicious how easy this looks
looks too good to be true
will try now
You know this really got me thinking, thank you for posting this.
I think an explosion like a grenade is an excellent example for this problem.
An explosion--grenade whether stateful or not should be seen by all players, even if it was late. If you were to die, or to take massive damage, you would want to know what it was from, even if it was 0.25s late. Lets not debate this exact point, because its not the issue.
The issue is that we have an event that occurs fairly often that needs to be reliably multicasted. Normally you would think "replicated variables are stateful. Events (RPCs) are not"--I agree with this. But Mutlicast Reliable RPCs are expensive.
So it seems the solution for cheap, reliable multicast events are replicated variables. I'd much rather just call an RPC because it's more straightforward, but it seems like variable replication is a better solution for this.
Unless there is some other technique or something that I have missed--and this is where my real question lies. Though from what I have read, it seems that there isn't an obvious superior solution.
What do you think, Adriel?
Your choices are as follows:
-
Use variable replication and do the explosion as a stateful thing. Then when the explosion is done, replicate that it is done as well. Otherwise, clients who walk into relevancy range will get to experience that explosion, due to them receiving the updated value. Even if the explosion has long since finished.
-
Use reliable multicast RPC - which has the pitfalls of being reliable (when it comes to the bandwidth) but clients walking back into relevancy won't get the explosion
-
Use unreliable multicast RPC - avoid the clogging of the network like reliable does, but run the risk of the client not receiving the packets.
Thank you, excellent rundown.
There are some work-arounds for clients who walk out of relevancy range here if you are curious:
https://jambax.co.uk/better-burst-counters/
I'm very glad it looks like I'm not going to unknowingly make a huge blunder going forward...at least on this singular issue π .
And thanks to all who have dealt with me!
Second option, for a grenade, would relevancy range really be an issue beyond theory?
If you can take damage from it, surely you're well within relevancy range?
Depends etirely on game and settings ofc..
Does anyone know if gamelift has auto scaling feature ?
Like when demand goes up it can start more servers and create instances automatically ?
Hello π
Does anybody have great resources regarding projectile lag compensation and client prediction (no linetrace actual object spawning) ?
Thanks in advance
Unreal Tournament source code is a good resource
Just keep in mind that their fake projectile implementation was never fully completed. It's been too long since I looked at it to remember why
Ok thanks π There's not talk/literature on the topic ? Diving into UT source could be a next step, but I first want to get a more holitic idea on the different solutions people have explored. I can't find valuable resources for now π¦
Nothing I'm aware of. It's messy and there's no one-size-fits-all solution
Ok thanks
Using actors makes it harder since they're expensive to spawn and move around
And tbh, it's rarely worth the hassle. UT's implementation quite tightly couples it's weapons, projectiles and characters together which is pretty grim.
Stephen tutorial cover lag compensation and client prediction
Excuse me people, Console commands stay until the game closes or it resets if I, like, join a session/change controller/Spawn new character? I'm thinking in putting all player settings console commands like "voice.MicInputGain" in the gameinstance Init event
It is very relevant when highlighting the variable replication stuff.
True that.
It's important to note about the difference in relevancy behavior when walking back into the relevancy range of a variable that was replicated like 3 minutes ago and an RPC that happened 3 minutes ago.
Would it ever make sense to do both?
Replicated vars is prob updated at the owning actors replication rate(?) while the rpc is 'asap'(?) so there could be quite the gap there if I understand this correctly? Which i may not lol
It's less so about when the stuff happens and more about the behavior of the client seeing the explosion when they're not in relevancy range and then walk into it.
If the explosion happened one minute ago and you use an OnRep, then when a client walks into range, the explosion will happen again on their game - even if it happened a minute ago.
RPC doesn't do that because it is more for fire n' forget
hey guys i need some tips
i have a widget commponent on each player character that displays their name (all that stuff works) im wondering how i best would do a "hide/show" function that locally shows or hides all player name etc,
how would u do it ?
i mean this works,,, not pretty but
only want to change is locally so
Lyra has an "Indicator" system for registering and displaying name plates. You may want the widgets themselves to somehow register with the player controller in some way (like an event dispatcher) that can toggle their visibility on and off.
well
this works as intended its just that i dont like the "get all actors of class"
however this function will rarely be used so it wornt harm that much tbh
Assuming you don't have 100s of player characters being displayed, get all actors of class shouldn't cause any problems.
yeah max is 5 so
still getting all actors of class "still getts all actors right" +
i mean first it checks all actors for the actors with class
No. It's a special hash map.
It's bad if say you used "Actor" as the class since everything is an actor.
oh, but someone told me it still picks all classes and picks out the specific class
wich makes sense
but maybe he was missinformed ?
well nevermind that
ive got another issue tho
as you can se when im casting my spell on the "client" it acts as if its the player 0Β΄s action
im using a Commponent with a referense
how would i set the refence in the commponent to reffer to idnno "the owner of the commponent" something ?
There's more than one Get Owner node. You want the one that has "Actor Component" as target.
Just a heads up, using any of the Get Player X nodes that have that index won't work well in games that have a listen server host, and should generally be avoided for online multiplayer anyway.
Additionally, that Begin Play will fire on both clients and server if it is a replicated component so the server and all clients would be doing that same logic.
oh thats the one ! thanks
yeah i know that,
thats why i "understood" why it wasent working
so instead of begin play should i make custom event that runs on owning client only when setting ?
is that better practice ?
Well it depends on what you're trying to accomplish. You're setting a replicated variable which could mean that you want it to run on the server so that the value gets replicated.
If you want everyone to have the same reference, you could just let it be as it is, so when it begins play it grabs the owner and sets the value itself without having to replicate anything.
hm okey
well ill keep that in mind
another thing whats the condition for a actor to be "Valid"
in this case in checking if "actor is valid"
is he always valid untill destroyed or are there any ways to manipulate validness ?
Valid is if the variable contains an actual reference to an actor and not nullptr. On clients actors can go in and out of relevancy, and when they are no longer relevant they can be destroyed on the client, so that reference can be invalid on clients if that actor doesn't currently exist on the client.
If you've set that variable on the server, then the server should always have a valid reference until such time as that actor is destroyed or you've intentionally set it as empty.
As it's a replicated variable, then that reference can become valid again once the associated actor comes back in to relevancy as well, no additonal setting up that reference required
hm okey, can i manipulat it somehow ? i mean instead of casting and checking "if dead" can i when the unit dies set Validity to false* when its still in exsistance ?
You can only change whether or not the "Taunt Actor" variable has an actor currently stored in it or not to change its validity or destroy the actor.
So if you want the "Taunt Actor" to be emptied when the "Taunt Actor" dies, whatever is holding this Taunt Actor variable would need to know when the actor stored in that value does die.
Could be handled VIA event dispatcher that this would bind and unbind to when the Taunt Actor needs to change.
okok
last thing
Datura
im having this weird bugg
ill just show u what ive got an explain in a video
so i have this spell "defend" when casting it should show the Vfx on all clients
the vfx is a VFX commponent thats attached to the parent class
that i Set visibility in a rpc when casted to
but it dosent show on all,
it "works" all the stats etcetc its just the visual part thats not working
any ideas ?
component is replicated*
What kind of RPCs are these?
the first event is runn on the server those 2 are the RPC (hiding/Showing) the commponent
Does activating this ability give the actor component to the target actor at run time, or is this component always existing on the actor?
Like, this maybe could avoid RPCs entirely if it's a replicated component that is added at run time by the server which causes the visuals to then appear.
When you want the effect to expire, you'd remove the component on the server, taking its visual aspects away with it on all clients as well.
I want to use listen server mode for my game. I have all the functionality setup like movement etc and I wanted to know how do I export it as .exes for me and my friend across the web to test out the game so I can see if multiplayer works?
Do i need to make host/join buttons and program the functions for that or can I just use the debug consoles and use the "open" command
ah
okay
@sinful tree its permanentΓΆy there
Yeah sure but it should be working this way right
ΓΓ
From what information you've shown and based on the behavior being presented, it should be working for both.
You may want to even change this so it's driven by an OnRep since it's something stateful that is changing rather than using a multicast.
Like you have that "Protected" bool. That could be an OnRep. Based on whether its true or not, then that shield chould be made visible or not.
But then that loops back to possibly using the Actor Component itself as the thing that is holding the state, namely if they have the actor component currently, then that means they are under the protection effect. Remove the component, they're no longer under the effect.
i mean sure it could be optimized for sure but i want everything to work before
It's not just about optimization, it's about how the logic works.
Multicasting is usually used for visual effects, but not something that is usually persistent that could be seen at a later point.
aye i get that and i can for sure change that, but i wanna understand why this isent working .O
And that's part of the problem - multicasts can be ignored by the engine unless they're marked reliable of course, where a replicated variable or a replicated component being added will always eventually arrive
hm the protect location is however the parent for the ""visual effect"
but it sohuld be propagate to children so shouldent matter
Propagate to Children only means propagate to anything that has this component as a parent.
yeah
"Protect Location" is an actor, is it not?
Im working on this since longer time now but how do i correctly replicate an actors rotation to all clients?
Can i just use SetActorRotation() ?
i only use that to "rotate"
what do u normally use as component to use as a referense ?
i normally use arrow but is there something that u use instead ?
I'd change that out for maybe a scene component. No sense in using a more complicated component if it's not actually being used (could have a larger memory footprint).
yeah for sure it was just a placeholdder
As for the problem, I'd say put some break points or print strings in like in the multicasts and see what they're getting as the target and if they're printing on the client
hm ok
scene commponent 2d ?
scene capture commponent
those are the options ./ ?
Oh it's just called "Scene" in 5.2
oh
im using 5.3 since a few days ago also, big regret but it is what it is
hm i think i solved it by replacing the VFX parent
now it kinda just works .,.
π€·π»ββοΈ
quick question. When I create a session is the "Public Connections" including the host so If i set max 8 players would it be 8 including host or excluding host.
Like if i want to do it just me and my friend would i set public connection to 2 or 1
I believe that should work, so long as you're setting it on the server and it is a replicated actor.
it doesnt really work well
i tried creating a Replicated Variable with ReplicatedUsing but the OnRep_NewActorRotation doesnt fire at all
UPROPERTY(ReplicatedUsing = OnRep_NewActorRotation)
FRotator NewActorRotation
UFUNCTION()
void OnRep_NewActorRotation();```
okay i see, but is there something i can do to achive a similar result?
the setter function should be on server right
If you want a variable to replicate when setting it, then you need to set it on the server.
If your setter function is to set that variable, and you want it to call the OnRep on the server as well, then you'd call the OnRep function in the setter function.
So i do this?
void ATestActor::Turn(float Value)
{
NewActorRotation = GetActorRotation() + FRotator(0.f, GetActorRotation().Yaw + Value, 0.f);
OnRep_NewActorRotation();
}
void ATestActor::OnRep_NewActorRotation()
{
SetActorRotation(NewActoRotation);
}
are multiple client -> server rpcs always received on the server in the same order they were sent from the client? Say if the first rpc the client sent failed due to network conditions and had to be resent, would the second rpc that the client sent get processed first due to the first one failing? Or do rpcs carry some data with them letting the server know this is rpc "2"/x and the server waits for that first rpc before doing anything?
If the RPCs are sent as Reliable, the order is guaranteed. Otherwise, no guarantee.
Ok sweet, thats what i was looking for. thank you
now something really weird happened.
The setter function runs on server and calls the OnRep function too.
Inside the OnRep function i used SetActorRotation() but now the rotation does replicate to everyone except the client who tried to rotate.
Even to other clients, just not the one who executed the function
Correct
curious if there is any difference in either of the options presented in this image? when calling the player state
no
gang
Inteface to get char ref is suspicious π€π«£
why????
Because it doesnt make to much sense when you can just cast
but what's the issue with it?
i just have it setup already, and would rather do that than cast
but i may not even need the interface tbh, could probably just call player state right off the actor object ref
"Issue" is that you abuse a tool not made for specifics like that
Is it an actual issue aside from the theory ? Nah it will work just fine
this is the full function
a cast seems like overkill
i genueinily dont think it makes a difference
What do you mean by overkill
Casts are type checkers
Interfaces are made for unknown /sparse set of unrelated types with some common functionality
And a cast to character if you have an actor reference would effectively cost nothing if all you need from it is the playerstate.
Cast to pawn even
i avoid casting for the reason of cost, but im not sure if an interface is more costly
im all ears fr
π¬
Not seen from those links: They're under a category labelled "Myths"
ahhh interesting
Oh good π
I was worried too XD
i mean, this does kinda seem like it doesnt matter in this case
but
i do enjoy this learning
Thing is if you're casting to a specific type to do something with it, you need that class to be loaded anyway so it's kind of a non-issue.
Casting an object to many unrelated types is where things get dumb, but that's just 'bad' design.
If I remember right, I think Authaer did some testing on the time used for using an interface vs the time used for casting at some point and posted the results in #blueprint
I don't fault you MAiWORLD - there is just a lot of bad info out there about interface vs cast.
Without looking.. I'd expect them to be pretty much the same, maybe a reflected interface cast would be a little slower since you're not just traversing the class hierarchy, you're looing at properties of the class too.
Just take NVidia approach, improve nothing and add upscaling
I don't have the :kek: emoji π
Instant trillion-dollar evaluation right there
for the record, the logic works fine, but i am genuinely interested in finding how i can really retain this info for future things
i use interfaces to replace casting for almost everything
not everything
but a lot of things
Nah - you need to integrate AI for your Machine Learning in the Metaverse. That's three corporate words. Pretty much about to be the next Elon Musk. I'll remember you though James.
The use-case for an interface is purely when you want classes that don't share a common base to provide the same logic (or at least, the 'interface' for said logic).
ok i need to read this a few times
That's their sole purpose
I'd say "same API". Not same logic really. Same logic would fit more in line with a component. (But that is nitpicky)
ok
so
if we use my example as an example
what would you guys do instead that you think would be "better"
Just cast to character and get the playerstate
this is it again for ref
Character is a built in class, so you don't have to worry about loading of assets and things like that
Unless Epic done goofed
like "cast to character" and not my actual BP_character? just the base classs?
Correct
I always cast to the lowest required class. So you could cast to Pawn as well. Because Pawn has playerstate.
A good example for when you probably want an interface is an interaction system
Where you can interact with doors, Houses. Npcs, trees and whatnot
very dope info, i appreciate all of this
when considering multiplayer does any of this info change?
Not really
(this is the multiplayer channel after all lol) and i am making the game mulitplayer of course
I was team interface until we spoke about it. Now I am team component π
You can get the benefits of both with team component
Has anyone who has worked with fast arrays thought of a way to serialize dynamic properties into a single struct member?
I think byte arrays is probably the best solution, but I think it would still be problematic.
basically, I need to store dynamic properties, their values, and metadata on actors. So If a property were to be changed, added, or removed on an actor, PostReplicatedChange would return the exact property and not all the actor's properties.
I guess the regular way to do this would be to have serialized structs for every type of property and if they included the GUID of the owning actor, I would be able to make the change. This seems weird though to have a new serializer for every type.
Is there a reason why my CMC wouldn't be replicating the Flying movement mode properly to simulated proxies? My listen server enters flight mode and animations for the locomotion that rely on the CMC.IsFlying variable do not play for the simulated proxy, and it falls to the ground but remains in air on the server.
I guess I was under the impression that movement modes were automatically replicated out to clients, is this not the case?
Hmm, it appears I was doing my movement mode check based solely off of the movement safe variable, which isn't set to true for the simulated proxy.
Is it possible to build for and run dedicated server on Android (phone, tablet) ? Clients (other phones) would be expected to be near by (within the same wifi network) to connect.
Just sounds like LAN only sessions really.
someone said dedicated server isn't possible on Android, that's why I am asking π
Ive not developed for Mobile, so I honestly cannot answer that.
It's probably possible, but seems illogical to use an android device as a dedicated server. Lower processing power + RAM tied with typically lower quality wireless internet connections especially if using a cellular provider's network, and if you're talking about running on a phone then you also have battery life to worry about, and all this adds up to android devices not typically being a good fit for running a dedicated server, especially if the intent is for the person using the android to also be connecting to said server to play or do whatever your app is supposed to allow them to do while connected to the server.
Based on what little development (outside of Unreal) that I've done for Androids, the programming paradigm for Android doesn't really support background applications the same way a linux or windows server would - like usually applications need to be up front and center to have the highest priority, and anything that isn't up front could potentially be terminated at any time by the OS if it determines it needs the resources. Though things may have changed since then, it still seems an odd thing to want to do.
Just on this - I've never realised this or heard of this before.
So all the various things (including Epic talks themselves) make reference to casting in BP can be expensive because it loads all the references because the casted BP version is the one pulling in all of its references.
But are you saying that if you cast to the c++ version, although we are casting in BP - the cast itself wont pull in references - because it is only a c++ class?
:mind blown:
Correct. And even casting to a BP that doesn't have a bajillion amount of hard references is fine.
Casting to your BP_Player is even fine in a lot of scenarios, because BP_Player is already going to be loaded anyway.
If you know that the BP is already going to be loaded at a given time, cast away.
Galaxy S22 and alike are quite powerful for 2-4 people coop, I think. LAN (WiFi 5Ghz or WiFi6+) is plenty performant for networking.
I guess I have no choice but forget dedicated server on Android :/ Maybe I could do listen server, but just render some 2D UI and have game running without actually rendering world. Seems like overly complicated endeavor :/
When thinking about lag compensation, is the server clock synchronized enough to say, trim a timer a little bit based on when it was started on the server - and when the client received the command to start it?
This specifically: GameStateBase::GetServerWorldTimeSeconds
It's ok but not great - https://vorixo.github.io/devtricks/non-destructive-synced-net-clock/ implements a better network clock.
I recently implemented the network clock mentioned by siliex, it works pretty well.
How would you cast to a C++ class? ( Iβm full blueprints and would not know where to find this or which is the C++ class)
Or would that be the βcast to pawnβ. Or βcast to characterβ ect?
I.e. the base classes ?
Lol if this is a joke, Iβm missing it
Yes.
That is actually super dope to know. Legitimately this convo today has helped me immensely and will absolutely change how i approach certain logic
@hollow eagle @raw sorrel this looks perfect, love that it has data to back it up too. Less worry for me
Don't worry, just a little pet peeve over the spelling of etc. π
Lmfaoooo ahhh I do be spelling things wrong sometimes
It's like in the whole of the UK, if you're under 30 you can't spell etc.
Lmaooo Iβm 29 so that be me
is there a way to set the visibility of a 3d widget per player?
Think in terms of rules
The widget is visible..... When?
Be very specific
but for each player individually
That doesn't look network aware at all
it isn't
This is multiplayer, you need to be very specific. Every replicated actor exists in every machine.
true
The actual rule should be that the widget is visible if the overlapping actor is the local players character. Not just A character.
What you have is just checking if it is A character.
how to implement that?
However you want.
Is locally controlled, compare vs get player pawn 0, however else.
This isn't multiplayer specific though, you'd have the same problem if an AI is overlapped this thing.
so get player pawn 0 is always the local one?
so for setting the visibility itself i should make that bp class unreplicated, ...right?
If think IsLocalPlayerController is the most robust thing to do this check
Nah just don't replicate the visibility. Idk if it's replicated by default or not.
it's replicated by default i think (unless i checked something somewhere accidentally)
either way i have no idea how to do that
to change the replication rules of the visbility i mean
Scratch that, GetLocalRole is what you want
If you change it on the server does it change everywhere?
prob
Test
how can running some code only on the client be so complicated 
This is multiplayer
WHICH client?
Your current code is running on every client
but how to make it not run on the server?
Every machine sees the widget when a character gets close right?
yep
What do you actually care about here? Do you want to see the widget when YOUR character gets close or when ANY character does?
This is why multiplayer is hard as fuck.
when the pawn 0 (local char) gets close
all i need to know is how to make it not run on the server now
No
Listen server wants to see the widget if their character gets close
Use the role thing I mentioned
Ok ive got an issue, i just made a minimap wich works with Mp and all but when i try to change the "Orthi Width" on my Scene Capture Component 2D it dosent work, if i RPC the change then it works but it affects all clients Ortho... . ???
Are you using a render target asset by chance?
yeah
There's ya problem
why?
You've got presumably many scene captures all rendering into the same render target every frame, and you're in editor, so they all share the same asset. One of them will win.
oh
You'll need each instance to create a render target at runtime, then set that as the property of a material instance.
You're not creating an RT at runtime though, you're using a content browser asset
All those scene captures will be drawing to the same render target. One of them will be the one that 'wins'
yeah i get what your saying
and all your materials are using the same render target
so i need to create their own ones
yip
hm, any simple way to do it or need to watch a tutorial or
There's literally a create render target 2D BP node
Create the RT and use that as the render target, then create a material instance for the UI widget and set the texture parameter to that render target
or isent that enough
aha
hm how do i create a material based on the created render target in bp
The widget should use the material as the brush not the texture
yeah
it dose
but i need to create a material from the RT
to assign it to the WB
You don't create a material from the RT. You create a material instance of whatever material the minimap uses, and set the parameter to the RT
aye
well-.-'
so in my widget im using a image wich is a "material instance" based on the RT
i need to change that to the newly created RT
right
and im not sure how to do that since i had to create a material instance from the RT in the content brower and assign that one
Yeah, You need to tell the widget to use that dynamic material instance
nice!
ty for the help
just one issue, ive set the scene capture commponent 2D to ignore Skeletal meshes
but its still begin shown have u encountered this :/ ?
@chrome bay
negative, can't help there
ok
isn't this for your Minimap cature ?
yeah
If it's for a minimap I'd have as much of that off as possible
you should parse like only 2 objects maybe 3
oh
you only want to show like WorldStatic, AActors that you flag as Environment/WorldStatic WorldDynamic
you won't want to drag decals and fog and everything else
draw*
well
I have only used the Capture Render for PaperDoll inventory screens and added in tags to view not used the ignore tags
well since im doing a "tactile turn-based game" i kinda wanna have all the fancyness
not for your minimap
well kinda :/
you don't want to show blood stains and explosion marks i.e. Decal
aye ofc
basicly what im showing now is all that i wanna show (except the skeltatl meshes)..
Fog won't render the same from a birdseye view as it would from player camera
so that's another flag you want to ignore
and atmoshpere, and particle sprites
and what dose A-A show really ?
I wonder if that's Temporal Anti Aliasing TAA or just a filter for your camera
and translucency
if you have glass on a building, and you want it shown from birds eye, instead of a opaque block that players won't know what they are at first
you may need translucency
ah ok i can remove that hen
so ive removed most of them now
but the shadows are still ther :/ ?
hmm
I spawn around 17 of these actors and they have insanely high impact on the networking because of the replicated movement
what steps can I take to reduce this?
reduce their net frequency and/or stop them moving as much
how low should I go for the net frequency? By default it was 100, I set it to 3 and it feels about the same
these are the settings I have
they kinda do need to move as much but if there is no other way I might have to reduce it or something because its the biggest offender on network performance by a large margin
3 seems too low tbh, surprised if it looks good at that rate
Depends though I guess
How long of a period of time is this?
https://forums.unrealengine.com/t/can-i-disable-shadows-on-a-scene-capture-component/404486/2
this is all i can find on how to hide Shadows in the Scene 2d Commponent
Hi Evil_Fischi Not directly in the scene capture 2D component, but you have some options available inside the Scene Capture 2D actor, below in the Scene Capture tab, you can hit the arrow to display more options, here you can enable/disable lots of features like bloom, translucency, decals, fog, etc that you do not need capture, I afraid this ...
my project is soley BP, i cant create a c++ class then right ?
i believe its around 4 minutes
it does not look very good just acceptable
@whole grove yeah the whole thing right ?
like its a big deal since the project is quite big already
but its still a huge impact on the network
oh
hm alright,
but im guessing this is the way then or no one know how to hide shadows :/& ?
32Kb for 4 minutes of constant movement is fine honestly, could easily ramp that up to 30Hz or something
32Kb over 4 minutes is nothing
that is true
its just significantly higher than other stuff
so it spooked me
hahaha
yeah but probably because nothing else is changing as often. Movement is often the biggest chunk of networking cost
is this a fog of war implementation with scene capture component? was hesitant on doing that because of how expensive it is and performance
ohh it doesn't, my bad, was skimming through the convo
aye
"Dedicated Server" and "Wifi" don't mix well. While today's wireless connectivity speeds may be good, it's still not as reliable as a hardwired connection and again I'd still question why would someone be considering using a smart phone, especially one that's only a year old, as a dedicated server? An old phone that you've replaced could make sense to use as a server, but investing that kind of money to have a device that is meant to keep you connected and able to compute while you're out and about, but you're wanting to leave it at home so others can play a game on it? It just seems like such an odd use case for the form factor, power usage and hardware capabilities.
The CPUs in phones are pretty impressive, but they still don't compare to desktop computer hardware. What may be possible with a 7 year old 4-core 65W 3GHz desktop CPU may not be possible on an 8-core 5W 3GHz mobile CPU from last year. There's no real way of doing an apples to apples comparison because how the hardware and software works for phones is vastly different than desktop CPUs, so the 3GHz clock is mostly meaningless, as is the core count.
A listen server could make sense on an Android as then the person hosting would likely be playing on it too, but then you're consuming what processing power is available to help host the network while also playing so performance may suffer. That said, I'm still in the camp that it would be technically possible to host a dedicated server on an Android, but I don't understand why anyone would want to, other than perhaps as a learning experience to see if it is possible. If it was something that was going to be released to the public, it wouldn't make sense and I don't think you'd find many people wanting to sacrifice their phone to be used as a dedicated server, even sporadically, except for tech enthusiast type people.
How do i send rpc on specific client? For example i want to send some non-uobject data which must be sent manually and could not be replicated with property. New client loaded, how do i do hot-join sync? I need to server, when new client connected, replicate data to that client.
I saw someone who wanted to host multiplayer fps games on a phone. I'm like, sure, that'll work if they're at home on their WiFi, but if they're traveling and go out of coverage, everyone just disconnects. That's not a good model.
Yeah I mentioned that before - you could have people end up hosting dedicated servers on their phones who are then connected to their cellular provider and wondering why its lagging so much or there is frequent disconnects or packet loss :/
Indeed.
You can only send RPCs to a specific client by sending that RPC to an actor that is owned by that client using a client RPC.
Another solution would be to redesign your data so that it does live on a replicated actor, like gamestate.
If it's being sent to clients anyway...
People who use standalone VR most likely have a powerful phone already. Or tablet. There is no problem having dedicated server for PC, but A. people might now have PC, B. people might not be around PC when playing VR (outdoors, parks, etc.).
and surely if the game runs on Quest 2, there is no reason why it wouldn't run as server for 2-4 players coop on a phone of equal specs.
hell, people run listen server on Quest 2 directly for 2-3 players coop
That's less of an argument for using your phone as the dedicated server as wouldn't they want to be using their phone for playing?
can you please help me understand how would they play a VR game on a flat screen of the phone?!
You can use cell phones for VR.
You plug your phone into boxes that have the lenses and stuff.
"People who use standalone VR most likely have a powerful phone already. Or tablet. "
the set up is Quest2+ hardware to play a game and a LAN server needed to be hosted over WiFi so people with VR hardware play coop
they don't have PC around
People who want to host dedicated servers are likely not the type of people who would think that they would want to use their phone as the server.
statistical data
Most people who own phones don't even understand the concepts of servers.
and they don't need to - run the app, specify game's rules, put on HMD and join game's world
That then is a listen server.
days where you have to fiddle with cmd like arguments and bat files are gone
it's a UI to run the server. The game world shouldn't be rendered on the phone.
Sorry I'm confusing myself here... When you say run the app, I'm thinking launching the app in VR.
I'm not trying to be difficult, i'm really not, it's an interesting concept to me too. I'm just concerned that for the vast majority of people they still won't understand what it is you're attempting to accomplish and they absolutely will attempt to run such a dedicated server on less than ideal hardware over mediocre wifi connections.
since it's not a straight forward setup, I am just not going to mess with it..
Most people may end up starting up the server, completely forget about it running, and then boom their battery life is gone in half an hour/hour.