#multiplayer
1 messages ยท Page 546 of 1
but that is ok (i mean shooter game does it)
So why would an explosion warrent RPCs to all clients when it has a short lifetime and can easily be set to false if not being destroyed?
I believe shootergame uses a bool for FX too on projectiles but I can't remember
dunno
but i think of OnRep's as states, Multicast as one off things
Explosion is a one off thing that happens, it being exploded is a state
That indeed makes sense
But I believe the cost of a multicast RPC is greater than an onrep bool
In terms of bandwidth
Looking for sources now
i mean
But if you had say 50 explosions going off at once
That's potentially 100s of RPCs
At once
Ooo how
its all done client side
Projectile is spawned, and shot
then the projectile is destroyed (server side), the clients call destroy
which plays the effects locally
i don't pool them tho
Makes sense, nice solution
and they are dirt cheap to instantiate
but a projectile is cheap
Yeah looking at shootergame they use bExploded
There's definitely a reason though I swear I read that Multicast RPCs are several times more expensive than just replicating a bool
And especially for cosmetic stuff they'd be more efficient
Well looking at recent discussions here on Discord it seems it doesn't really matter and yes you should prioritize state for OnRep and Multicast for one shots
I just wonder if there's a comparison on the cost if that OnRep bool bExploded does essentially exactly the same visual thing as a multicast RPC to all clients
it does, also when you enter net relevant range
explosives long gone go boom, looted chests play opening animations, dead enemies rise so you can watch them die
to avoid a multicast you need a timestamp and network synced clock, ontop of that boolean
not really important to topic but FWIW last time I measured it for myself, creating a projectile actor cost around 500 microseconds to spawn, 200 to destroy... pooling it reduced it to something like 60 microseconds to spawn and 50 to destroy
relevant if you have MG42s in your game or something ๐
When I call GetGameState on my PlayerState, it returns invalid. Am I doing it wrong?
you calling it to early?
I'm calling it after the player is added to the game
to store their avatar in the game state
server side or client side
Client
too early
if its null, then GameState might not have replicated
by the time you access it
hoo boy it was a wombo-combo - it was too soon AND it looks like map variables don't replicate
so I'll probably have to make it a custom struct
@winged badger so you'd recommend Multicast for any kind of oneshot events?
Just going off ShooterGame / UT for the examples which I know are getting long at the tooth
But I'm sure there is a reason they chose to use OnRep instead of Multicast in those situations
But maybe my perception of the cost of an RPC vs replicating properties is not as much as I thought
multicasts have their purpose
so in the case of a simple example, a gunshot muzzle flash and fire sound
I should rewrite the onrep int that increments per shot and instead use a multicast RPC for each shot?
(
APlayerState * PlayerState
)``` Where does it have to be implemented? in the Old or in the New State ?
@winged badger
It is called in the old PS and the new PS is passed in
Ty ๐ Zlo mentioned it yesterday and i need it now ๐
it's very very useful!
void AMyPS::CopyProperties(APlayerState* PlayerState)
{
Super::CopyProperties(PlayerState);
AMyPS* PS = Cast<AMyPS>(PlayerState);
if (PS)
{
PS->PlayerLevel = PlayerLevel;
PS->EquippedSkin = EquippedSkin;
}
}
if client knows its firing
That's how I use it
it can figure out how to do a flash and sound on its own
no point in multicasting or replicating anything then
and you replicate the gameplay critical information
and infer the effects from there
Right so to replicate that critical information (say with an on rep int being incremented for each shot or an unreliable multicast that doesn't pass anything but just says "hey im firing") what would you choose?
An on rep int "feels" more lightweight but I have noticed it's bad for fast firing weapons when you don't have a high enough net update rate
depending on the type of the game
i replicate firing key down, attack target, firing mode, and where PC weapon trace is
let the clients figure out everything else themselves
Right that makes sense
In my game it's a bit more important that they know exactly where the bullet landed
and i don't care if one client sees a mis other a hit
And how many shots were fired
Yeah in that case you can be lenient
So you use onrep for those events right?
i don't, full simulation
those are onreps
yeah
I'm doing a similar thing but at the per shot level without multicasts
Considering moving that to use multicast instead
Since you'd guarantee every shot makes it through for the cosmetic side of things
But so far haven't needed to use Multicast at all in the game so I'm wary of rewriting things
while you said that OnRep has an overhead earlier, surely it is still less bandwidth than an RPC?
its not
its that without timing
effects can get ducked if relevancy changes
OnREps don't come with a timestamp you can access
but say you don't need timestamps, say for a bullet impact
I'm using an FVector_NetQuantize on rep as opposed to a fresh Multicast RPC with that vector sent
And it works great
the other players will see the current impact of the weapon at that location when it reps
Sure they might miss a few if it's a really fast firing weapon
It just feels nicer to know that there aren't constant RPCs going off and instead a nice single updating thing that will play FX if it has changed
That said if I move to Multicasts for each impact then you can see absolutely every shot and there wouldn't be timing issues
However I wonder if that comes with a greater cost or if I can just go ahead and not worry about it
Possibly the reason they don't use Multicasts in ShooterGame and UT is just because Multicasts weren't used as much as a new feature back then
I'll look in to simulating too with just a simple bIsFiring OnRep bool and have clients sim absolutely everything
The only issue I see with that is that most of my weapons are semi auto
So clients can click very fast and fire multiple shots
But other clients would only see one shot
how do you get the owner of a specific player? I'm trying to target someone other than the server
I can't find any documentation on the Replication Condition dropdown
Most are fairly self explanatory
None means it will replicate to all
Skip Owner means it will replicate to all but the player that owns the actor
etc.
I was hoping there would be examples of each use.
I'm having some problems with My inventory system at the moment. Everything that ANY player picks up seems to go to the Server inventory.
I'm storing the inventories in playerstate
ok
each player state is unique to each player
you just need to make sure its replicated to owner
that's what I thought, and it seemed logical for me to store the inventory there
or none (will replicate to everyone)
ah.. that's the bit I'm not getting.. how to replicate to owner?
Owner Only..
I'm storing it like this in the PlayerState
looks confusing lol
haha well I couldn't think of a more elegant way to check for each type of treasure
yeah i would not have done it like that
This is inside the Determine Treasure Picked up
ah no.. so you can pickup many different types of treasure
but why do they need to be stored in seperate arrays?
yeah but its also more headache to maintain
what I want to do is display how much of each treasure a player has picked up
and also the sum total of the treasure value
ah, that would be better if I could do it in one array and be able to filter it later when displaying on each player's hud
that's the idea
but that's not my problem right now. This clunky system works for now
ooh.. Enum
good point
i mean i don't fully understand your system
or what your game is about
what is "treasure"
just a normal actor
children of a main Treasure Master class
hmm. I'm not familiar with enums
here let me show you
so you reckon that would be a better system?
Ah, unique treasure count gives me how many different unique types of treasure I have in my map. At the moment I have 5 different types (1p, 2p, 5p, 10p, 100p)
yeah. and when the treasure overlaps with the player collision it stores the treasure then destroys it
so your system is kinda weird
for such case
you know what treasure you overlapped
and what type it was
yeah
so why all that stuff above?
the unique treasure name
player should get the treasure he overlapped with
and that treasure knows its value
that's all because I have different arrays for each treasure type (which you've just informed me that I don't need)
so we can get rid of all of that
the treasure tag was to allow me to quickly find which treasure was being overlapped
I'm a noob at this and was fully aware that as I was making this spaghetti code that there was probably a far more elegant way of doing it
in c++ this would have been a lot cleaner ๐
I just need to be able to pickup different types of treasure (that each have a value attached) and for the server to store it all for each individual player.
haha most likely but I'm an artist who doesn't know c++ from his elbow
oops
hold on
so this will increment your existing items everytime the same item is added, or will make a new entry for a new type of pickup
your overlap just calls StoreItem and passes in the treasures type enum
.. and this is on the PlayerState?
yes
ok, let me rebuild this and absorb what you just did
is PlayerCollecteTreasure a struct or something?
kinda thing
yes
you can't replicate a Map
else that would have been even easier
ok.. so you just did in 10 mins what has taken me many many nights of head banging on desk to get wrong ๐
maybe I should just stick to artwork
well like i said i am not sure of your game or your setup
but this is the way i would approach it
I have confidence in my game design. I just have no idea how to implement it
this is going to be a marathon
thank you very much for the pointer though.
For some reason I cannot move after ServerTravel (seamless) any ideas?
The Target GM works fine when launching directly into it however I'm stuck in the air when traveling to it
The Target GM is an empty class which inherits from AGameMode, I commented everything out so it's literally empty
@meager spade sorry to bother you again, what variable type is Player Treasure?
nevermind, the clue was in the picture. PlayerCollected struct
though I can't get mine to look like yours
aha
Addition: I tested now a lot and i have not a single clue how to solve this usse
I dont even have an outliner since i cnat test traveling in PIE only in Standalone..
Can someone help me with replicating this crouching mechanic?
When I change the capsule half height to a crouching position Im also trying to change the Z axis of the character mesh so that he doesn't clip into the ground
Aparently my blueprints are only working client side
So you can see yourself crouching properly
But other players clip into the ground
ok this is a huge bug
I fixed it by disabling Network Smoothing in the Character Movement Component
Works with non-seamless-travel but ofc all my data is gone
when using seamless-travel I'm stuck and can't move
OH MY F*** GOD, the Server crashed in the background and neither the debugger nor the editor told me about it ...
= Cannot move
I'm so done lol
I am following a tutorial and on one screen he has
and on the other...
I can only figure out how to play as both clients or both servers, how do I do what he did?
I think there's a bug in the window names, the 2nd client will say it's server when it's not 
thanks for letting me know
the pictures above were from ue4 v4.17
(so the course is very old)
I thought I had a solution for the issue above, but don't.
Do any of you have a solution for this issue?
Any way to use Steam OSS when testing in editor?
Right clicking and launching doesn't work for me for some reason
Time to fix it
Does it need the steam_appid.txt file when using the launch?
Fix what
Getting steam OSS working when right clicking uproject and selecting launch
Does shift + tab show the Steam overlay
No and I have a debug log that says it can't get the steam oss
Packaged build works fine
Works fine here, so I don't know what to suggest.
Yeah
Any ETA or info when Unreal Engine has Epic Online Services integration? It seems that only non-engine SDK is available now
No ETA, try the communtiy plugin or wait for 4.26 to see if that brings it
Oh. I missed the community one. Where would I find it?
It's on the forums somewhere
Thanks @bitter oriole
I think there's a bug in the window names, the 2nd client will say it's server when it's not
@hoary lark Can Confirm
from which class should i manage player spawning for an online game?
gamestate or gamemode
and why?
any way of passing raw serialized data in an RPC?
There's no easy way, but you can wrap a TSharedPtr<> to the data with a USTRUCT(), and create the data at each end
Oh, what do you mean create the data at each end?
Have a look at FGameplayEffectContextHandle
Basically inherently there is no way to send arbitrary binary data via RPC
But you can get around it by doing something like FGameplayEffectContextHandle, which is a wrapper struct that overrides NetSerialize() to create the data you need.
I'll look at FGameplayEffectContextHandle
Thanks!
btw
What are your thoughts about just a TArray of uint8's?
Oh, I guess thats not quite the same
I've done that before but it's not ideal
And some things can't be sent that way, like object pointers etc.
does anybody know of some documentation somewhere that will give some input on how to authenticate steam users for a dedicated server?
it seems that player count and a lot of other things will not work for steam "GameServer"s unless users are authenticated, which is not done for you by the online subsystem steam like it is for the lobby sessions
you should do the discord search here @median elbow that topic does occasionally pop up
If you have small enough levels is it fine to mark all characters and other important items as Always Relevant? Is relevancy more important in games like Fortnite that have much larger maps with lots of things that shouldn't replicate at distance?
To prevent potentially having to show or hide certain actors on the client depending on distance
actually @winged badger its funny you just said that, i usually do that, and i actually did do that here too, i just wasn't sure exactly what to search for, although teh search has proven very useful in the past, i was planning on searching more but thought i'd just ask about it quick while i was doing some other things
i think either vlad or cedric posted a full set of screens with BP example
it was a while ago
awesome, i'll check for that, thanks
i'm not even 100% sure what to check for because if i make the search too specific i don't get anything, but if i do something like "steam dedicated server" i get a bunch of stuff thats just setting it up which i already have
anyway i'll keep searching, but if anybody does happen to know of documentation about this off the top of their head, that would be helpful
i do know that the dedicated server is a little more tricky, because the client is not connected to the server at the time the online subsystem would do the check
so you have to basically have the client connect to the server, THEN if the authentication fails kick them
but there's got to be another way, with beacons or something. i'd hate to have to write my own networking code just for this, it seems like something that plenty of people should already have come across and found an elegant solution for
i'd go with something like "steam auth"
Hi everyone. I created a simple create and join session mechanism . it is working fine on one level . But doesn't work on another one. Game mode setting are same for both. but the map( where it doesn't work) is insanely huge. Please help. Thanks in advance
you were right @winged badger , vlad and cedric were talking about it earlier
i think i got all the information i really need. too bad ue doesn't already ahve something for this, so gotta do it manually, but it seems simple enough
Quick question regarding C++ and Steam includes: I'm including these two:
#include "steam/isteammatchmaking.h"
#include "steam/matchmakingtypes.h"
and I get an ARRAY_COUNT macro problem, cause it's redefined in there.
What was the proper way to include steam related things, like the two headers above?
I could add this #define ARRAY_COUNT( array ) (sizeof(ArrayCountHelper(array)) - 1) after the includes, to get the standard behavior back.
But that doesn't remove the warnings.
Having an issue where in normal network conditions and in 99% of cases all of my enemies get unpooled correctly with an OnRep bool but when I set the network emulation to "Bad" where there's 5% packet loss, some enemies never become unpooled and visible on the client even though on the server they are shooting projectiles
@grizzled stirrup how do you do this? I googled ue4 network simulation setting and got to this https://docs.unrealengine.com/en-US/API/Runtime/Engine/Engine/FPacketSimulationSettings/index.html and https://forums.unrealengine.com/unreal-engine/feedback-for-epic/89660-network-latency-simulation-settings-no-longer-work , but no explained tutorial or guide on which are the possibilities and rules to follow...
Holds the packet simulation settings in one place
Tell us how to improve Unreal Engine 4!
@floral crow It is new to 4.25 you can find it in Editor Preferences by searching "net"
Very useful as before you had to enter different console commands for the same result
Hmm My team won't update to 4.25 until late June as we are close to a deadline and Lead doesn't want to risk it. How can I achieve the Net simulation (even if it takes a lot of commands)
I'm tasked to find a fix as many network related bugs/crashes and it's 1000 times more complicated if I've no proper way to repro bad conditions
It's only a risk if you don't back up the project.
You can directly call the console commands which is all this feature is doing behind the scenes
PktLag=0
PktLagVariance=0
PktLoss=0
PktOrder=0
PktDup=0
if you type in the console net pktlag = 100
You'll get 100 ms ping (can be called on just the server or just the client or both which would be 200ms ping effectively, make sure to debug the ping output to verify)
Also for reference, packet loss is the thing that causes the most obvious issues in many cases, the "Average" network setting in 4.25 sets that to 1% and the "Bad" network setting in 4.25 sets it to 5%
Cool. thanks @grizzled stirrup these cl commands will totally do it
One more question: How can I send console commands to the server in a PIE session?
Currenlty I only know how to send them to clients (easy as opening the console in their window) but Idk if it's possible to open a console for the server (as there's no dedicated server window)
Strange. I get crashes when calling SteamAPI_Init() and similar in 4.22. in PIE. (I know Steam isn't supported in PIE, but it shouldn'T crash either).
Pretty sure I didn't have that issue before, but maybe I never used the SteamAPI on 4.22 and they fixed something later on.
blocking all of the code off with #if PLATFORM_WINDOWS && !WITH_EDITOR
Not sure if I'm missing something or if that was needed in 4.22
Hi Guys The Dedicated server is not showing in steam server browser .. just showing in LAN tab how..
and 2nd thing the client says -->
[2020.05.31-17.48.55:309][ 85]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = OutdatedClient, ErrorString = The match you are trying to join is running an incompatible version of the game. Please try upgrading your game version., Driver = PendingNetDriver IpNetDriver_0
[2020.05.31-17.48.55:310][ 85]LogNet: Warning: Network Failure: PendingNetDriver[OutdatedClient]: The match you are trying to join is running an incompatible version of the game. Please try upgrading your game version.
Please if someone can explain to me the issue and how to fix it thanks โค๏ธ
@floral crow You can do it in the level blueprint with the "Execute Console Command" node
On event begin play
That will run on both client and server
There's probably a much nicer way using config files but this works for debugging
I see. But there's no way to open a runtime console for the dedicated server?
to improve or worsen net conditions arbitrarily at runtime? And send other useful commands as well...
you can always implement your own console window โ
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1427946-dedicated-server-and-console-commands-exec-cvars Is this still relevant? (Feb 2018)
A common method is to send the commands via the deferred command list.
Code:
GEngine->DeferredCommands.Add(TEXT("SomeCommand"));
Not sure what you mean by "RPC, you are already on the server?If you want to execute a command from a client on the dedicated server you need to send an RPC with the command.
Can a dedicated server execute console commands at runtime (CVars and Exec UFUNCTIONs)? If so, how simple is that?
Im asking this before setting up a
you can always implement your own console window โ
@fleet raven But I'd be missing on command autocompletion which is really helpful, mostly to discover new commands which are almost completely missing from the docs
could implement auto completion too
@meager spade it seems like MovementMode is replicated
not sure exaclty how but there are 2 things in CMC
bNetworkMovementModeChanged
GetReplicatedMovementMode()
hey guys, I'm looking for some guidance..
been reading around the network scheme, and what would you think is the correct approach for supporting over 1 thousand users in UE4 dedicated servers?
should I go with my own TCP Server, Level Streaming (multiple dedicated servers) or how?
you can also use Agones
Can someone help me? i'm trying to get into multiplayer, but when I go to play and set my players to 2 and then press play I get the second viewport, but instead of it spawning another character, it is just a camera that I can fly around. How would I fix this?
need to have your pawn set in the game mode
and that game mode assigned to that level
https://streamable.com/ewqp88 I'm guessing I'm doing something wrong again. I'm trying to follow a tutorial and his characters dont really seem to be moving in unison. lol any idea what's going on here
In my player controller, the beginplay is running on both the owning client as well as the dedicated server. i know this is supposed to happen, but what kind of check can i do in blueprints to only run on the client in beginplay?
i tried hasauthority but realized that will always be false for the client. I could check if its the dedicated server, but then when its a listen server then it will run
is there like, "IsOwner" blueprint or something?
i could have beginplay call an RPC that only runs on the owning client, and so far i think thats the best way i've found, but it seems like there'd be a blueprint or something i can just check without doing an RPC
i could do this in c++ too if theres no blueprint for this
Does someone know this bug? There are two huds (from clien and server) being displayed on top of each other. (It is only a problem when there are multiple players in the game)
The HUD events play local and dont get replicated.
My running animation is playing faster in clients than in server... I'm really getiing nuts with it... anybody has any idea why does it happen?
I mean in autonomous proxies... because in listen server and in simulated proxies, it plays perfectly
I'm overriding the CMC to avoid server corrections... I checked that and it doesn't seem to be a problem, because maxwalkspeed looks fine.... but anyway I'll double check it, any other idea will also be appreciated
anyone ever ran on a game on aws vpc's?
im wondering if in essence, it works just like LAN
Hey, I'm trying to write a notification system so that all in-game logic starts running only after GameMode considers that we're ready. I was thinking on a Multicast Delegate present on the GameState to be called by GameMode.
//MyGameState.h
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnGameLoopStart);
...
UPROPERTY(BlueprintAssignable) FOnGameLoopStart OnGameLoopStart;
UFUNCTION(NetMulticast, Reliable) void Multicast_OnGameLoopStart();
What I don't like about this approach is that late-joining clients will never get the event call
That made me think that maybe a replicated property bGameLoopHasStarted with an OnRep method would be better. That way the state GameLoopHasStarted can be accessed infinitely instead of being a one-off.
My question is: The first time the value is set on the client does it also call OnRep_GameLoopHasStarted so a player joining late will properly trigger the initialization?
What if I want the server to also get notified, can it be done without writing a setter in C++? I understand that in Blueprints RepNotify runs on server as well, but that's not true in C++.
Any suggestions on how to implement this type of behavior?
back in UE 4.17 you could run client and server at the same time (watched a tutorial on this)
now it has changed where it looks like you can only run as one or the other.
Is there a way to do this like the old days?
If you leave that option unchecked, it explains just what I said. (ue 4.17)
does sending a large amount of data through an RPC necessarily mean a proportionally large packet? or does the engine take the liberty of splitting up chunks and putting them back together on the other side etc
Asking because in the real world large packets are more likely to get dropped in routing intersections
back in UE 4.17 you could run client and server at the same time (watched a tutorial on this)
now it has changed where it looks like you can only run as one or the other.
Is there a way to do this like the old days?
@swift kelp Why do you need that? Does your game use a dedicated server or a listen-server
in the looman tutorial, he uses debug code (output only visible to the server due to server specific code) and normal client code. He shows the different action output on the two different screens. I can't follow along now (or at least no on some of his topics) if I can't run the editor the way it used to be able to be run.
Anyone have links to good articles on understanding the network profiler tool? Trying to debug why things are so choppy with just a few units firing at each other
Noob question: I want to be able to play my game online (over the internet) with my co-workers across mobile (Android) and PC. We are currently using the Null session implementation which works over LAN PC to PC but I am struggling to get that working over the internet using something like Hamachi. I am about to go deep and debug that but I am wondering if there might be a simpler path. Can anyone advise?
So far going this route I am encountering issues such as the Null session impl relies on UDP broadcast traffic which I am not sure works on Hamachi. I also know that this feature isn't fully supported on every Android Wifi interface. I don't see a way to tell the Null impl to broadcast on a specific interface so I manually added a route forcing 255.255.255.255 over the Hamachi link, this will be a tricky workaround to scale to the team if it turns out to be a solution. I started looking at what it would take to just make my own session impl which I think I can do but that led to me to ask here if there is something that I can use already to do that.
I thought about steam for example but I don't think it works w/ Android. Also I don't think we want to sign our game up for steam yet and deal with any licesnsing implications there
@cosmic trail what kind of choppyness are you seeing?
@warm goblet movement choppiness, lots of jumping around when there are about 5 units + their projectiles on the screen. And really just using basic character movement...maybe it's debug build mode?...just seems odd, frame rate doesn't drop, mostly around 38-40fps
The network profiler will be good at showing you what kind of information you are sending over the network and how much
The default setting that you have problably seen is that actors replicate at 100fps
which in your case will mean every frame, sync every actor
This can easily lead to a lot of data being sent even for simple stuff
The docs recommend tuning that down to like 10fps for important actors and 2-5 fps for less important ones
Also if you haven't checked "replicate movement" your actors will only get periodic location updates which can cause it to look choppy
Hmm yeah. 6KB/sec is that a lot? I didn't think it was that much, not sure why it would start stuttering... it's as if it's skipping replication once the number of moving units being replicated goes to 5-6. It's fine with just a couple units on the screen and no projectiles..and the network profiling says that projectiles aren't really replicating as much as actor movement overall...And I turned priority high for the thing that was stuttering most, and it seemed to fix it..but I don't see why it should start cutting off replication with just 5-6 units updating movement. It should be like 100 units is what I expect before it starts throttling some...also this is on a local server...
I'm sure you are aware but replication channels (i.e. your connection w/ the server) have a target capacity
And replication prioritizes messages so that you don't go over that capacity
That capacity isn't the same as your link capacity (like its not going to be 100mbps or anything like that)
I don't know how to configure it but that sounds like what is happening here
replication messages are being dropped to maintain the channel capacity target
Hi everyone. I created a simple create and join session mechanism . it is working fine on one level . But doesn't work on another one. Game mode setting are same for both. but the map( where it doesn't work) is insanely huge. Please help. Thanks in advance
any reason why I may be getting that error?
C:\AID\UE4\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe D:\APD\UE4\Lessons\GDTV\Multiplayer\PuzzlePlatforms\PuzzelPlatforms.uproject -server -log PORT=7777
and
C:\AID\UE4\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe D:\APD\UE4\Lessons\GDTV\Multiplayer\PuzzlePlatforms\PuzzelPlatforms.uproject 0.0.0.0 -game -log PORT=7777
see anything I am doing wrong?
is there a good way to implement an ACK on an unreliable RPC? should i just reply with another RPC?
im trying to replicate an input buffer from client to server. but i dont want to use "reliable UDP" on every single input. instead i want to resend ALL unacknowledged contents of the buffer
e.g. if my client sent inputs 1, send it to server, then queues up 2, 3. if my ACK comes back on 1 i will send 2,3. otherwise send 1,2,3 on next send frame
alternatively i could have a replicated property for the "ACKed" frame in the input buffer (like a uint8 or something) and listen for rep notify on that
i need to do this every tick (or at least every tick i have unsent inputs)
Hey guys... I have a HUD where I"m trying to display my multiple players state. However when I step through the Game State Player Array, my Pawn Private variable is "out of scope". This HUD update is being called from GameModeBase HandleStartingNewPlayer.
@barren patrol Its common to include some information like that in a state object that is replicated back to the client
so, more like the second option? ๐
Yea
cool, thanks!
One pattern I've done is save which move (input) caused the current state
so when the new state comes down via replication, you can replay inputs that you have buffered on the client since the one that is come down on top of that state
I'm seeing actors with bOnlyRelevantToOwner get replicated to a demo replay (recorded on server, not client). Is that a bug? Shouldn't they not go into demo replays?
Anyone know how to set NativePlatformService?
Tick is using the item before you created it
thx you
@swift kelp I have same issue and server is not showing in steam server internet tab
are you sure the port is forwarded in your pc ?
in your router i mean
from memory, server isn't visible to the machine thats hosting it
steam API limitation, not sure they ever went around fixing that
Greetings.
Noob question.
If i want to make user activated function RPC that needs to be run on client and server, do i need 4 methods to be added?
Action_MyFunc() //on key press
MyFunc() //call for Server_MyFunc_Implementation and MyFunc_Implementation
Server_MyFunc_Implementation() //server also calls for MyFunc_Implementation, not included validationm optional
MyFunc_Implementation() //actual stuff happens here```
or i can skip the action one and run myFunc on key press?
https://i.imgur.com/i6JNpJJ.png why this spawns only one client i dont get it
this is on gamemode
@shrewd tinsel how many you expect?
You can do it with two functions easily
@chrome bay me?
yeah
@chrome bay please tell ๐
{
if (!HasAuthority())
{
Server_DoSomething();
}
else
{
// Code
}
}
void Server_DoSomething_Implementation()
{
DoSomething();
}```
No reason to call other functions
If you want the body to run server and client side just remove the else
where the part that runs on client and server?
If you want to run on both remove the else and put it there
Then it just becomes this:
{
if (!HasAuthority())
{
Server_DoSomething();
}
// Code
}
void Server_DoSomething_Implementation()
{
DoSomething();
}```
It doesn't, because DoSomething() calls Server_DoSomething() if you're a client.
if you bind key to DoSomething it want be called on server
but
// Code
wont be
it will
how so?
Why is "Play sound at location" plays 3 times when i have 4 players in game? is there any fix to this? i tried spawning it only on the server but it plays only on the server
because Server_DoSomething_Implementation() is calling DoSomething()
No, because of !HasAuthority() check
but
// Code
is not ELSE
Think about it:
Client calls DoSomething()
Client calls Server_DoSomething()
Client runs // Code
Server receives Server_DoSomething(), calls DoSomething()
Server runs // Code
A listen server has authority because it's the Server, so it won't call Server_DoSomething();
If it did you'd end up in an infinite loop anyway
for a server spawned replicating actor, GetObjectName() or GetPathName() may return different value for each client. am I right ?
so how do I print their unique name (NetGUI maybe) in BP ?
NetGUID is different for every client
oh u r right its generating different for each client ๐ฆ
{
if (!HasAuthority())
{
Server_DoSomething();
}
// Code <- that part is not part of the check
}```
You want some code to run on client and server yes?
So that's exactly what you want.
It's just the client telling the server to run the same function
yes...but when it runs on Listen server it tuns twice
No it won't
well, it does
so how do I print the unique id of a replicating actor ๐ฆ
It just won't. The Server isn't running input for the clients, and it's the authority
So it won't call the function twice
I've got this exact setup in multiple places all over our game
Listen server runs inputs from clients...what are you talking about?
No it doesn't...
It can't
How can it get the input from a clients keyboard?
Unless the client is explicitly sending it?
listen server is just player playing and hosting
Yes
I give up
try it yourself and see
It's running its own input
So it will call DoSomething() once, for itself.
It will not call Server_DoSomething()
If it did, you would end up in an infinite loop of the functions calling each other
The weapons call StartFire(), if a client calls StartFire, then internally it calls Server_StartFire(), which just calls StartFire()
So it's basically like telling the Server an input key was pressed, sort of.
And it simulating the same thing
i did that and for some reason it just triggered event twice for my listen server, i did something wrong there
Yeah that's probably something else going on
@chrome bay sorry to poke again, do you know if AnimInstances exist/run on server?
they do, dedicated server might not bother simulating bones tho
and if you're trying to send a UAnimInstance* over the RPC, think again, its not replicated
nope, i just checking
if (!MainAnimInstance)
and i was not sure if it exist on say dedicated server
yeah they do exist for sure, it's just as Zlo says they may not be doing anything
depends on the mesh settings
okay, i won't relate on their events then
i need some however, not sure how will i handle it ;_;
If you mean anim notifies then yeah you can't really rely on them anyway
Or at least, they won't be synchronised between clients/server etc.
yep...i've ported (partially) AdvancedLocomotionSystem to replicate, but i have some issues, like Mantle uses notify to teleport the capsule when it ends
moved some variables to character movement component so it can be predicted and compressed
but it was not the best place to start learning cpp and networking
Should be things like key pressed actions send as reliable?
before i implement bWantsToDoSomeStuff in CMC
@chrome bay yep, it seems i know why i had so many functions now...
i could trigger the event by the player itself, and by replicating a state, which should not trigger server replication again
oh...i just check if it's simulated proxy
*EDIT fixed (Handle Starting new player / delete on post login is how you do it...)how do you handle clients entering a new map using seamless server travel
without it, you'd just call event post login and call it a day, but with it, i dont know what to call on gamemode to handle those players having travelled/spawn a new pawn
Can someone send me the Config for Steam sometime working but just LAN one time showing me
LogSockets: Warning: Tried to bind address with protocol Steam to a socket with protocol IPv4
im using this config
Hey, is there a simple way to check whether or not we have an internet connection?
Hi all, I have an strange issue in my autonomous proxy client, but not in listen server.... the run animation sometimes accelerates and play faster in clients... any hint on what it could be related with?
CMC updating the skeleton twice
@weary mortar are you doing some funky stuff
like forcing a non autonomous to autonomou?
autonomous
@winged badger @meager spade thanks for the hint! I really appreciate it!
you could try
GetMesh()->bOnlyAllowAutonomousTickPose = true;
see if that fixes it
I think I've found it... In my AnimBp I am setting "Root Motion Mode" to Root Motion from Everything
I think that it can be the issue.... I changed it to fix a weird animation long time ago from the market....
yeah... now I can understand why it is terrible ๐
so u suggest to use always montages instead animations?
yes, In my game I avoid using root motion
when networking
ok, I will tattoo that to don't forget it... It drove me nuts for an entire week!!
๐
thanks for the hand, guys!! ๐
we had that issue before
so your not the only one ๐
then again we do crazy stuff
in our game ๐
hahahaha glad to hear that it was not an easy thing to find
GetMesh()->bOnlyAllowAutonomousTickPose = true; < this here drove me nuts
ufff now I can breathe again... ๐
its set in only one place, APawn::Possess()
and yeah, 2 days to track that bug down :/
lol
๐ yeah that sounds like a really pain!!
anyway thanks for always being there to help and hear our lamentations ๐
Got a really weird problem, I have packaged my game and when i host a game on my pc, use servertravel and get all player controllers on a new game mode it doesnt work. But when i do the same thing on my laptop it works.
Does vehicle movement component have any equivalent to character movement ignore correction / client side movement authority? In c++ or blueprint?
Guys...if anyone can help me...
What the better way to setup a player name in multiplayer game using the ue4 framework
playerstate
???
I wanna to use the player state from player state class...I expose the SetPlayerName as an ufunciion but don't work
any tip???
@ivory lintel check
AGameModeBase::ChangeName
nice tks
Hey, how can a wait for the PlayerState to replicate inside my UMG widget ?
I have the PlayerController, but it can happen that the PlayerState inside the PlayerController is still null
and I need to wait until its not longer null before rendering the UI
pulse witha timer
tho
we wait till OnRep_PlayerState in the controller
and fire a delegate
which then updates our widgets
so widget binds to it if the PlayerState is null
and waits
simples ๐
thats pretty much what i have
but this doesnt work for the server since the server doesnt call on_rep
server doesn't need to wait for it to replicate
Question regarding netcode of rotation or translation in Local Space vs World Space. For replication do I need to convert any Local Space transformations to World space to achieve proper replication. I see in the engine code that Add Location Rotation and Add Relative Location Call the (root) Move Component Update which get converted to World Space anyway?
I am coding A plane movement Component from scratch so I'm applying rotations and forward vector acceleration in Local space so I am curious if I need to convert those rotations and locations from local to world?
it doesn't matter, as long as you do same conversions on both sides
having said that, depending on coordinate space, local space vectors, typically having lower magnitude, might allow for better compression
When you mean same conversions on both sides? And yes you're definitely right about the lower magnitude better to compact.
The reason I ask was since I am doing a Movement Component from Scratch I see actually on UE4 Low level movement component they move the root component as UpdatedComponent->MoveComponent(World Delta, World Rotation, hitflag ...)
if you send a local space vector and client expects a local space vector
ofcource
doesn't take rocket science to transform it to world coordinates on the other side
Yea just a Matrix transformation. It seems their Add Local Rotation and Relative convert it for you to world space
and pass that transform to MoveComponent anyway
When I get to that step
I'll let you know
I will be coding Client prediction from scratch on top of my movement component just more or less curious about how UE4 does it since they are AAA company and they obviously have alot more developers pushing code to it
then look at their github for the new one
since CMC is hardcoded monolithic monstrosity that should never have existed
Yea
I dug through the current one
its very messy
the replication code and Movement code should be seperate
currently they are in one class
however.. their movement code
is not bad
just the way they did net code was a bit sloppy
until you try something non standard, like having client side movement with AIController
not sloppy as in bad sloppy as in just how they put the classes together
or anything really where the controller is not APlayerController and Pawn is not ACharacter
kaboom
to make it worse, it replicates via the Character directly
yes
and PC also has parts of its logic
thats another thing
see: TickActor
that was odd
their player controller
"Is a connection"
and it has the net driver shit
which is wack
that still confuses me
you have to override the roles manually, if you do this, or CMC will start doing shit like ticking your skeleton twice per frame
I never dug into the net driver just as far as when the server needs to do net corrections
it's done on the PC
it seems
So I was told by some people that they are modularizing the net replication
for movement
one dude is currently working on it
it's a "plugin" but I am curious how exactly you Use it if you make your own movement component.
server doesn't need to wait for it to replicate
@winged badger so basically I have to make an if statement if the PlayerState is already set otherwise bind to the delegate?
that is pretty standard
CMC is a dinosaur. Thankfully it looks like they plan to replace it at some point.
No ETA though, and I doubt CMC will ever be removed entirely as too many games depend on it.
Wouldn't be surprised if UE5 still has it at launch.
404
Need to be logged in to Github and have your account linked
aight ty @winged badger
I can't even begin to explain the nonsense I had to get through to make my space project work with CMC
networking that stuff wasn't easy, but I found some hacky workarounds
hello guys, forgive me but I'm getting crazy.. I'm quite new to UE4, and I'm trying to make a simple LOCAL multiplayer minigolf like game in Unreal through blueprints. So, in my GameMode I set up a function to "getspawnpoints" according to playerstart class, and then another function to spawn players with their own playercontroller index according to the array created in the "getspawnpoints" function.
So now all the players are up and running at the same time, but I would like to implement a turn system so that I can enable player0 to act first, then player1, then player2, and so on. So I was thinking about creating custom events for turn begin, and turn end, but I'm stuck at this point. Can you redirect me to a comprehensible guide to do this, or can you tell me how to achieve this? I can provide GameMode BP if needed. Thanks a lot
@sullen umbra in the GameState you have an array for PlayerStates
you could make an variable within the GameState which holds the index of the current player
So you can always access the PS by using GameState->Players[INDEX_OF_PLAYER]
and as soon the turn ends you just count up the index until reaching the end of the Players array, then set the variable to 0 again for the first player and repeat from there
gonna try now, but this still looks like hieroglyphs to me ๐ญ
@sullen umbra This series of tutorials will help you get setup with this https://www.youtube.com/watch?v=JF3KFWF8hUs
UE4 / Unreal Engine 4 Multiplayer Playlist:
In this collection of videos, we will cover setting up a project for both local and networked multiplayer projects.
This Video:
In this video, we set up our project and get an understanding of what we will need to begin spawning our...
works perfectly for splitscreen local co-op
doesn't have to be splitscreen obvs
@stoic acorn yes I followed up that tutorial, but the problem here is to set up a turn system to tell which player should act
actually my gamemode is the same as that tutorial
so it would probably be set up in the same way as a turn based game. I bet there are a ton of tutorials like that
I don't know.. I can only find rpg based games which are way more complex than the thing I'm trying to achieve.. that should be super simple in theory, but in practice I get lost
gamemode decides which players turn it is
then it just informs the players of that
a client RPC to the client controller is appropriate here
do not multicast from gamemode ๐
Can anyone help explain how to create a character selection at the start of the game like in ARK, Hurtwold and other types of multiplayer games?
@worldly raft You can set up a blueprint for your character selection "booth" with a camera with a skeletal mesh component for the current character. Then create a set of character buttons in UMG which replaces the mesh with that character's mesh when clicked.
@spark fossil thanks for the advice ๐๐ any good documentation or tutorials that show steps to create this?
@worldly raft Np. I don't I'm afraid, but I have I did it that way in my game and it seems to work fine.
The blueprint actor is floating in the air but is set to not be visible to any other cameras.
@worldly raft @spark fossil What I have done is creating a new Level (Hero Select Level), and do everything there. I spawned an Actor which holds a SkeletalMesh, as soon the player clicks on a button to select a character an RPC is send t othe server, the server then selects the character and send an RPC back to the client who then updates the SkeletelMesh of my previous Spawned actor to the new one
When the Selection is done I use seamless travel to persist the data to the new level and start from there
But this technique makes only sense when you dont have to swap in Mid-Game
@worldly raft Thanks, but all credit there goes to the marketplace asset creators ๐ Nope, all different skeletons.
My fix to the PIE window net mode bug in 4.25 made it into 4.25.1. Just letting people know who were having issues with it https://github.com/EpicGames/UnrealEngine/pull/6963
@jolly siren still waiting for server travel in PIE -_-
@lunar root Sounds good. I've taken a similar approach with the RPC calls when switching hero or skin, but just kept it in the same map so no travel. That was maybe just laziness though on my part.
haha ouch
It's supposed to be a oneliner, yeah.. no
I traveled to the new map and couldnt move the entire time
and was nearly crying
and randomly i realized, wait the server isnt running in the task manager
basically the server crashed after traveling, and since i have to test in standalone because the editor doesnt support server travel i didnt realize
painful ๐ฆ
I give up, thanks anyway ๐ญ
@sullen umbra Okay dude listen
I feel your pain though. I just spent 3 days fixing bugs that weren't there in PIE
You set a GameMode per Map
this GameMode initializes a GameState and PlayerStates
those are replicated to the clients, but can only be changed on the server side
Mean the client can read this information and process it, but not change it
Since you have an Array (a list) of PlayerStates you can just say, okay its the turn of the player with position 0 in the PlayerStates array
when he is done you can just increase the so called index to 1
When player 1 is done increase it to 2 etc
and when you reach the limit of the array (lets say 5) you just resetz the counter to 0 again
also super useful: http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
@spark fossil Didnt know about this, might have to look into it too, i feel like i know replication but sometimes i just sturggle with things like UMG etc
because it needs to wait for the PlayerState etc
Same, but this document comes in handy even just to look something up
Still use it all the time
Yeah, dont do this
I guess, i heared @meager spade talking about it and just looked it up
I've seen people discussing CMC. Pain exist...
I hope there will be some brave man who will make new plugin with component that can be plugged in to any pawn
Isnt this the NetworkPredictionPlugin?
idk anything bout it just heared it often when talking about CMC
yep
Isn't finished yet. no eta
Also don't expect it to be plug-and-play, will still be a lot of core work to do, and it's unlikely to be something you can use in BP.
to replace CMC it should be universal for cpp and bp
and cmc does more than just replication
It won't be, and it probably won't replace CMC
CMC will probably still exist alongside
AI navigation is handled by CMC
Does someone know this bug? There are two widgets being displayed on top of each other and one version is inactive. It is only a problem when there are multiple players in the game, like if the other player would create a second widget for you. But as you see the HUD events plays local and dont get replicated.
@scarlet cypress Try doing a check to make sure that the Actor is locally owned
What BP is that in the screenshot?
The PlayerCharacter
Thanks! This fixed it! I still dont understand why this bug occurred tho..
@scarlet cypress Glad it worked ๐ It's because this will be ran for every player character in the level, so you'll get a hud widget for each one.
Okay, thats kind of wierd tho because it runs 1 time on each player but i gets 2 widgets for both...
but if it runs once for each player character, and you have 2 player characters in your level at the time you'll get 2 widgets on the player's screen right?
So you could either check that the playercharacter is locally controlled, as you did, or move the widget spawning code into the HUD or something.
how do you actually kick someone from a steam lobby
Good Morning. Anyone in the mood today to help a fellow hobby dev? In specific, I am trying to control two pawns at once (a first person and 3rd person pawn). I have it working single player but everything gets messed up once I try to introduce multiplayer (and not just because of replication, something else is going on).
@thick sand How are you controlling the second pawn? Via commands to an AI I guess?
@spark fossil Right now, I posses the thirdperson pawn with an AIController spawned by the first person. I then just control the pawn vie the firstperson pawn.
@thick sand Not sure if this is your issue, but the ai controlled pawn will always be server owned
so you would need to issue any commands via an rpc on the player controlled character or player controller or something else that the local player "owns"
The ai controlled pawn would be a simulated proxy for the client, so they can't really do anything with it directly
@spark fossil That makes sense. Let me see if I can run a few tests.
@spark fossil Successful initial tests. Thanks! So I am calling a server RPC in the FPPawn which then calls the function on the thirdperson char
@thick sand Good stuff. Yeah that sounds right.
I tried various ways to get the client to spawn an AI as an Autonomous Proxy instead of Simulated Proxy, but couldn't figure out any non horrible way of doing it.
So it seems like you just have to relay the commands
gotcha
thanks again. The first person pawn is actually going to be a VR pawn. Let's see what challenges I run into next ๐
np - gl!
ty vm
@spark fossil One weird thing I am experiencing is that everything seems to work fine when running a multiplayer test (both dedicated and non dedicated checked) but when I try hosting the game on one comp and joining on another (via steam) the client somewhat jitters in place rather then moving. Any thoughts?
@thick sand Is it the AI character or the player controlled one?
AI. The other one is just a static camera as of now
ah ok
So, you're taking an input from the player, calling a Server RPC on the Player character, which tells the AI character to move?
VR Pawn takes the input, calls a RPC (server event) on itself which then calls an event on the AI pawn. That event I have attached to an authority switch. The authorized exec calls the Multicast version while the remote exec calls a server RPC . The multicast event is what adds the movement input to the pawn
afaik all of the AI pawn's movement etc. should be done on the server, and have it replicate via its movement component.
It will be a simulated proxy on the client so they won't be able to move it, but also I don't think the navmesh exists on the client (I could be wrong but I'm fairly sure on that)
As long as the Ai pawn is replicated and has a movement component, it should update itself on the client when you move it on the server
ok, so therefore the movement should be done on the server rather then a multicast?
maybe its getting dbl input and conflicting??
its also a bit weird that this is not present when testing as a "dedicated server"
it could be that, but either way I would move it on the server and just let it replicate. If you use a behahavior tree instead too, it will have to be server only for that stuff.
There seems to be a lot of issues that are not picked up when playing in editor. EQS queries on the client seem to run fine until you deploy and test it on 2 different machines :/
ok, thanks. Let me try
@spark fossil I appreciate the help and hope its not a bother. I changed it to VRPawn (Server RPC) -> ThirdPersonPawn (run on server) -> add movement input. Unfortunately, its still jittery.... I've gotten to this point before and decided to start over since I wasn't sure what was going on.. ugh
third person char
@mellow dome It's no bother at all. Hm strange. Is it moving but jittery movement or is it just staying still and jittering a bit?
First person (VR Pawn)
Its a bit hard to tell but it looks like its moving but not getting anywhere and just jittering
But it was moving when playing with 2 PIE windows?
I've never tried moving an ai like that tbh, without a navmesh
I thought you could only do that with a playercontroller
I tried using a player controller and ran into issues as well. Everything seems to work fine in 2 PIE windows
when I "launch game" and then join the MP session, the client def tries to move but jitters
hm weird
You could use a navmesh and move it like a typical AI but it would be a bit of work to set up and I'm not sure how responsive it would be to the direct control
How do I get the number of people spectating a player
yeah, thanks for the help. It always seems like the projects I want to work on are slight fringe cases and that combined a lack of knowledge and it makes for a dangerous combination
@foggy idol You can use GameMode -> Get Num Spectators
@thick sand I know the feeling ๐
I want to get the value for a specific player
I go into spectator mode by setting view target
I want to find out how many people are currently viewing
I don't mind if c++ is involved
i'm curious about the Get ServerWorldTime node - what happens when the server is left running for a long time? i just found that my map has been running for hours instead of ending after 10 minutes, i assume the value got too high or something. is there any way to reset it to 0?
So maybe do
if(IsLocallyControlled() || CurrentViewers.Contains(GetLocalFirstPlayerController()))
@thin stratus
Is current viewers an accessible array or do I have to make it and set it on my own
And how would i implement this
Hello Guys, have anyone already created a video chat using UE for a multiplayer game app?
Im replicated montages with root motion and getting up wonky results. I have a run on server custom event running a multicast, which as a repnotify triggering the montage. https://gyazo.com/ceb4111533516388ac7735b5cc105ea0
@spark fossil It seems my pawn moves but really slowly. I would think its because of lag but it works fine when just controlling a single pawn. Maybe the extra pawn is too much? ugh, idk
Maybe you have too many RPC's in the character
@thick sand did you try to turn on "orient rotation to movement" in character?, also try to disable particle and try again. solution :https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/71123-multiplayer-3rd-person-and-terrible-stuttering
Build powerful visual scripts without code.
How do i test to see if the sound is playing for everyone on the server? On 1 computer
Check on each client
How do i check if the bullet firing sound is playing in another client if i have to click to fire in the current client tho?
@thick sand Hm weird. Guessing that's just where it's trying to move at one and then being brought back by the authority.
@quartz anvil I just tried both on and off (was on) and still does a stutter step.
@spark fossil Thanks. That's kind of what I'm thinking as well but can't quite sort it out atm. Comparing it to a reg ThirdPerson pawn setup, it has 4 x as many RPC calls per sec (2k - 8k) .
@thick sand I don't think it would be too many RPC calls tbh. I've never tried moving an AI pawn with input rather than a BT/Navmesh, but I'm guessing there's some issue there. GL, hope you crack it.
I'm using SetActorRotation on the server, it is not reflected on the client tho
The client on the left calls the server RPC that updates the rotation and it isn't reflected, the client number 2 on the right does update the rotation
Hello everyone, I'm new to Unreal Engine development. I was hoping someone could provide me with some insight on to how a custom client side tcp connection of an online UE4 client might look like (specifically on an MMORPG). I know how to construct the TCPSocket and connection, my question is more so how to effectively process communications. As far as I know I have two options...
- Run a Network Layer on a separate thread and allow the game to queue commands to submit data to a server. Similarly, allow the Network layer to queue commands on the game thread to process packets/data that is sent to us from the server.
- Run the Network Layer on the same thread as the game and depend on Ticks() for processing data that the server sends to us. I'm not sure if the Tick system occurs often enough where this would be a good idea.
If I were to not run the network layer on a separate thread AND I was constantly listening for data from the server instead of only checking during Ticks... Wouldn't this cause the game to have lots of lag due to constantly processing something on the same thread?... or is this a trivial task for the game engine?
@twin storm I doubt that I can help you there because this advanced stuff you are talking about, but maybe take a look at ReplicationGraph, it depends on ReplicationDriver and allows you to customize the replication logic
hello! i've here some blueprints for a door that i am attempting to replicate
the server can open and close it fine
it's also replicated fine (client sees it open and close in sync perfectly)
however
the client cannot interact with the door - ie cannot open or close it
does anyone have any pointers?
also dooropenclient node is set to reliable run on server
you can't send an RPC thru an actor you don't own
exception being multicasts from server
all you get is "no owning connection..." warning in your output log with this
i see, thank you
what would be an alternative solution? i'm new to UE4
sending an RPC with a door reference as input through your PlayerController, PlayerState, Pawn or other actor you do own as a client
ahhh ok so you reckon i should handle the input through the player controller?
Anybody know why my Map data gets swallowed? Before calling the function the map has information, but when I add a breakpoint there's nothing in the Map value
Seems to disappear during the information transfer from client->server
Oh...
but why tho
I was bummed when I found out about that. You can kinda cheat it by making an array of structs where each struct is a key value pair, but itโs obviously not as good as having a map.
@acoustic inlet ue4 doesnt replicate maps ...
guys, what is the correct way to spawn a player in multiplayer game?
do i do it on gamemode? or on pawn?
or on player controller?
spawn actor from class > possess?
in blueprints
Gamemode
game mode runs on the server
Last I recall you can use the game mode to get the PC's which are connections and possess w/e thing you're spawning that takes a player controller
The Gamemode is what usually handles pawn spawning yeah, but it depends on the game.
Same for splitscreen or online really
I wonder how games that are competitive handle spawning
if its done server side
like I assume if you have high ping you might have a delay on your spawn versus someone who has lower ping
and thus create potentially a disadvantage
Unless you server and client time stamp
and compare them and then interp it or something
Well the pawns will always be spawned server-side. If you have additional latency to the Server and it takes you longer to receive the pawn there's not much that can be done about that.
yeah
But that will affect the whole game too, not just pawn spawning/possession.
yeah, it's quite hard to build the systems to workaround/support that
Can be done, just usually very game-specific
Then everything will run in the cloud, and it'd be streamed
Would be great
Everything would be a single player game.
Hello, guys. I'm working on card multiplayer game. Can i ask some questions about logic and Game Framework(GameState, GameMode)?
Asking questions is strictly forbidden here ๐
i take this risk )
In my card game i need show to players different cards location. Gamemode has refs to all cards. Which classes must handle the logic of card distribution
You should think about gameplay framework actors (pawn, game mode, player controller, game state, player state) in terms of where they are
gamestate/playerstate are basically just shared data, changed on server and replicated to everyone
game mode is server only
player controller is server + owning client
You could very well put your logic distribution in any of these classes, but you have to think about who should be responsible
If it's the server, then game mode would make the most sense
Yes, in the current prototype of the logic, the game mode is responsible for the distribution of cards, but i need to make each player see the process differently: their cards face down, and the cards of the other players face up. I am replicating the cards themselves, but I am not replicating their movement because I need to display them differently for each player
Seems like the right thing to do
You don't need to be replicating more than an identifier for each card anyway
on first iteration of card distribution each player see different card movement(different locations) now i can't understand how i can change location of object for each player differently
You could simply set the owner of each card actor as the player controller owning the card, and then in your animation code, check whether the owner is non-null, and a local player controller
If both things are true then the animation is for the owning player, if not, for a remote player
Thank so much)
why can't an actor be replicated to other players?
Actors can always be replicated to other players, but game mode in particular is not
By design
I created cards in the game mode and they are visible to all players. Then I try to call an event on a card with a game mode, but it only works on the host
Sounds like the card actor is not replicated
even if it is visible to other players after creation? responsible for this is "net load on client" and "replication" is checked
Maybe there are replication conditions about which I do not know?
you cant access GameMode
from any client
even for the cards
GameMode forces itself away
your cards should be in some other Manager you make yourself
which all players can access
you can make your own
and place in the level
just based on AActor
but GameState can be accessed by any player
so might be better place
separate actor does avoid clutter
If I understand correctly, i just need to create objects in the scene and then get a link to them in GameMode. And when will I call the events of these objects, will replication work?
as long as client doesn't access the game mode
LevelBlueprint good place?
for?
just make a Actor
Always relevant
replicated
place in level
and use that for your cards
GameMode can get that actor via GetAllActorsd
Hello! I have a question about event tick for a race car controls and multiplayer! The controls are triggered in virtual reality so I have to use event tick to always check if an actor is overlapping or not.
when it comes to multiplayer, I want to make it so the server stays around 120 tics. I know that I will have to account for someone not running the game at 120 FPS. How would I go about making the server account for that player lagging/low fps, but still properly replicate their pawn movement to other players? Do I basically need to make it somewhat predict what the player will do or just store the players values from last tic and use those until the server receives updated values from the player?
players might extrapolate other players' movement locally, but you don't do it on the Server
You won't get client packets at a steady 120Hz rate anyway, even if they're running at 120FPS or higher.
Where would you suggest I look in terms of making the movement stable?
I'm good at self teaching, I just need a pointer in the direction I need to go
If you're using physics vehicles you've entered a world of hurt is all I can say
Still possible though I assume?
Negative
I mean, you can use them in multiplayer sure, but smoothing / interp is extremely difficult and usually game-specific
Thankfully since it's physics you don't need to do smoothing, all clients will be running the physics scene between updates anyway at whatever their framerate is
I could leave the physics calculating up to the client, varify through some prediction, and just replicate the pawn position and animations to other players maybe?
Server-Auth is basically not possible though, so what you tend to do is just fire an unreliable RPC to the Server each tick which contains the players current input and their latest physics state.
I could not train an AI to auth?
nope
You can add server-side checks for blatant cheating ofc
How advanced you go with that is up to you
Blatant cheating is my main concern
yeah I'd just protect against that, even if it's quite rudimentary
But generally with physics and networking you just have to lean towards trusting the client a lot more than you do with kinematic movement (aka characters)
ya, the physics I feel like I can smoke out through scripting
like when you see other players, you will only be seeing their pawn. Your client will have no awareness of their hovering or thrust power
Thank you!
It's a complex topic in all honesty, comes up here quite often - no one-size-fits-all solution though unfortunately!
Sadly not, thankfully I know it is a challenge
does not seem hard from what I am reading, just tedious and some complex thought
Getting 8 players stable will be fun lmao but doable
I've been doing the client-auth, server-verify approach for a while, it's quite simple to set that up. It doesn't look great on remote clients but is playable for my use case
That is what I'm looking at. I know I will have to check the client to make sure players are not running this tool that lets you teleport your HMD location
by literally hacking you play space. Will be the only real way players can get ahead. The server will just varify the values of their cars thrusters and hover calculations
I know for only 8 players, the event tick should be decent since it is used in a couple other 10+ player vr games to calculate movement with relative stability.
I've not done VR but I can also imagine that client-auth is the only way to go there, because it would be pretty jarring to be snapping constantly from corrections.
That is why I feel training a simple AI to watch values would be useful. Not really constantly correcting, but looking for areas that need correction without putting load on the clients. Say if I was to train it to look for a car rapidly changing values(a spin out or flip would generate these), I could have the AI flag that and set them back on the track. Or if they lagged and their values do not line up with where they should be by some margin, the AI could correct.
Kind looking for values that fall off the bell curve model
Hi all. Wanted to see if anyone was able to integrate a grpc plugin into ie4 4.25?
Question from a new game dev here, when I do a Multiplayer game where exactly should I start? With the menu? Hero Selection? Game Mechanics? I feel really lost to the honest since everything goes hand und hand
And I don't rly have a clean way to go
Ok didn't read it but I guess it's to read it now
I would start with your game mechanics. Make a base of everything. Base character. Base weapon. Base picked up item
That will explain the flow
Aight ty
you should build your game mechanics accounting for what is in there
Also, limit use of event tick if you can help it lmao
on the characte/pawn
hey everyone. Got a question. I am working on an inventory and equipment system. The inventory system replicates correctly. The issue I have is on the equipping items. To equip items my system spawns the actor in (spawn actor by class). To get the spawn actor to work I have had to set every component to replicate. Then on a repnotify, I use attach to component to attach the actor to the correct component of the character. This is where the issue comes up. It appears the actor's transform is being edited so that it appears slightly rotated and far up and to the right of the character. Everything I read only says that attach to component has replication issue when the components of the actor being attached are replicated, but they have to be replicated for it to spawn. Any ideas/suggestions?
Is it not possible to bind an event dispatcher on a client from within an actor? I'm trying to bind an event dispatcher in my character blueprint when entering an actor's collision volume, and it works as it should on server, but it doesn't work at all on client. If I run the intended function directly on overlap it works, but not if I bind the event dispatcher on overlap and then call the function.
I am not too knowledgeable yet, but I was thinking the same thing while playing Pavlov. They have an issue with replicating objects held by other players.
I was thinking that you could basically not replicate the item equiped, but send a single from the server to all other clients to equip your replicated pawn with that item
I have not had an issue with a repnotify before, the difference between now and before is I was not spawning the actor I was just moving it from the world to the character
Can anyone tell me why when I use DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam the function that runs via AddDynamic() does not register breakpoints in visual studio? (It does run because its logging msgs to console)
Nevermind, switching solution config to "DebugGame Editor" instead of "DevelopGame Editor" fixed it
The client on the left calls a server RPC that changes the client's pawn rotation but the rotation doesn't change, the client #2 on the right does see the rotation of client 1 pawn change
Im just using SetActorRotation so idk why it doesn't work
hi, does anyone know a good tutorial on how to make ALSv4 replicatable?
How can i do this?
I've got a system where a host start a server and players can join put i want this kind of lobby
But*
Sessions
When i create a session the host doesn't join it unless i open a new level tho?
Sessions and levels are unrelated
So do i have to make the host join the session when i create it?
I'm using advanced sessions plugin
Being the host is also unrelated
Someone creates a session, people join it
Usually this is linked to levels and multiplayer, but it's fairly independent
But when i create a session and check how many players are in the session it shows me 0
You just need to display the players in the session before they join the same server
That's a multiplayer concept
It's unrelated to sessions
Sessions, are just a way for people to share data before joining a server
A lobby would have players in the session, and outside the server
So in the photo i just sent, they are not in the same server but in the same session?
No idea, just telling you how I would implement it in UE4
OK thanks I'll try and miss with it
anyone maybe has an idea why my TArray<FMyStruct> isn't replicating properly? While its .Num() is correct, the FMyStructs inside it contain default data (as if it was initialized by my default constructor) rather than the correct data, when sending from server to client
Does anyone know if there are tutorials yet for the epic services p2p? I see its in beta and I want to try it out but It would be nice if there was a tutorial or sample project more than the chat program.