#multiplayer
1 messages · Page 616 of 1
Generally you want to predict as little as you can get away with, i.e. only things that can affect the feel/input of the game for the local user. Anything else should be left up to replication.
what are the ports that need to be forwarded to be able to let users from an external network to connect to a server?
I tried 7777 in both UDP and TCP but it seems to not be enough
nevermind it's working
CanYouSeeMe isn't getting any answer I assume but game clients get it
Hello bro @bitter oriole I used DefaultSubsystem = Steam same cant find servers and also i wrote DefaultSubsystem = Playfab it shows me error Module [ Playfab ] Failed
so idk there must be a something for crossplatfrom sessions
Isn’t hitting and knocking back an enemy a perfect example of needing prediction?
You have to use Playfab on all devices obviously
i will keep trying 😦
Look
Strop trying Steam
Steam can never work with mobile matchmaking ever @odd iron so forget about it
Read the Playfab doc and get the Playfab OSS working
Start with two playfab PCs, and once that work, move on to PC + mobile
Yes i've tried one time with Steam
i have a suspicious About register Game its need the ip of the Session hoster so i think because im writing the localhost its wont show on other devices
Also i tried to look for EOS plugin its nearly 1k$ now xD
@odd iron For me, Steam would not work until I installed the Steam client on my dedicated server
Steam is off topic here
It can never work for @odd iron 's purpose
Forget about Steam entirely
Yes it is
I'm randomizing my character's skeletal mesh components on the server, does anyone know how I can replicate the changes to clients?
The only thing that I can think of is having separate replicated variables for each skeletal mesh. Replicating the skeletal mesh component's doesn't seem to sync the skeletal mesh changes
Which is fine, I just feel like there should definitely be an option in the engine to replicate skeletal mesh changes
i havent reach this level yet xD
@bitter oriole So is EOS supporting the thing i need ?
using C++ 😦
You need to focus
Are you using Playfab or EOS now ?
@lucid vault There is no option to replicate skeletal meshes.
any decent tutorials on state sync/properly replicate/smooth pawn movement?
I did KrakyKarts like an year ago on GameDev.tv but having an hard time putting it back together
I just got it again and it's behaving very weirdly
perhaps because it's 3 years old and some of the stuff has changed?
Possibly yeah
Also the tutorial isn't perfect, IIRC it doesn't account for framerate differences between client and server
Sure, I just mostly know of that one
Any way to get the player ip address?
Is there a way (without having a dedicated server) that when someone host a game lobby, if he alt tabs, the lobby doesn't lag for the rest of the players?
through the player controller you can get their UNetConnection which should allow you to get that
and then GetRemoteAddr on the UNetConnection
Is there a way (without having a dedicated server) that when someone host a game lobby, if he alt tabs, the lobby doesn't lag for the rest of the players?
A lobby level should not rely on the host for anything, tbh
For gameplay, no, there is no way
Hello, how are you all doing?
I got a question, for some weird reason every time I try and make a session it breaks here:
And I set public connections to be greater than 2
Where is Debug, in the dir of the proj?
I got DebugGame
Also here is the code
Wow, am I bewitched, Now it works
Since yesterday like 6 pm, it didnt work, tried on new projects same crash
Thanks though
Is it possible to use steamnetdriver and ipnetdriver at the same time?
I'm thinking of a setup where we would have dedicated servers for our ranked/main gamemode and connecting to that would happen with ipnetdrivers. And then we would have user hosted casual lobbies using steamnetdriver
Or would it just be wisest to store the lobbies to some external database and use that database to transfer the lobby/connection info to other clients?
Is there a way to force a property to replicate? (I do manipulate TArray values without modifying the TArray itself & the RepNotify gets called pretty late)
You can use steam for dedicated servers.
you can change the source code to allow connections to regular servers
its not very hard to do, its in the gamemode base class
unreal basicly does a check to see if your uniquenetID is of the same type of the server
so if you skip that you can connect to whatever
Hmm, it is still crashing somehow, when I have no internet connection it seems, could it be becouse I am in offline mode?
@bitter oriole Is this what you meant, dunno where that folder is?
have you tried commenting all the array related stuff and trying again?
Hmm, isn't that important stuff tho?
i meant in your code
This is unreals code
This is my code
you only have that? nothing else?
Yes
well thats strange
It keeps messing me arround
Ikr
It works while I am connected to the internet
but if not it crashes
visual studio should have an option for you to go back in the code
well if it works while you are connected
then it is probably working as intended
try checking the code of that create session node
my best guess is that steam is not being initialized and it is trying to do something with steam inside of an array somewhere
Im sure its meant to work without internet, how do I acess that, not sure I can get that
u can right click the node
isnt that from the advanced sessions plugin?
Nope, base unreal
Okay, thanks I will do that
i mean, if its the base template
theres nothing much you can do besides trying to fix the bug yourself
you can try to do the same in previous versions
and see if the crash still exists
if it doesnt it is 100% a bug
it is probably something that just sliped, because people now a days are not connected to the internet... ever.
Sadly I dont have previous engine builds...
Okay, i'll try to override that next week. Would be awesome to be able to still join simply by ip but also create sessions with listen servers
Does it work for you offline?
it should be doable i think
ive never tried sessions tho but i have steam on and i connect through IP so that 100% works
i dont use sessions
Okay thanks
Could you share your prelogin function override code?
gimme a sec
Is this more reliable, is there a tutorial somewhere?
I got ip joining to listen server working, but it required opening the 7777 port and I would not like for clients to need to do that
theres no tut as far as i know, took me like a week to figure this out
i did leave some info on the playfab forums
you always need that, steam does nat punching for you so thats why you dont need it when doing it through steam, still trying to find the class
{
// Login unique id must match server expected unique id type OR No unique id could mean game doesn't use them
const bool bUniqueIdCheckOk = (!UniqueId.IsValid() || (UniqueId.GetType() == UOnlineEngineInterface::Get()->GetDefaultOnlineSubsystemName()));
if (bUniqueIdCheckOk)
{
ErrorMessage = GameSession->ApproveLogin(Options);
}
else
{
ErrorMessage = GameSession->ApproveLogin(Options);
//ErrorMessage = TEXT("incompatible_unique_net_id");
}
FGameModeEvents::GameModePreLoginEvent.Broadcast(this, UniqueId, ErrorMessage);
}```
i basicly call the same thing in both paths
and i changed the uniquenetid somewhere
to an empty one
oh ye
in your games game mode
when u call super on the prelogin
Super::PreLogin(Options, Address, FUniqueNetIdRepl(), ErrorMessage);
FUniqueNetIdRepl()
that will just put an empty ID wherever
the server will probably keep it around
Okay
Well that will get things started. Thanks mate
need help : #blueprint message
controllers don't exist on clients, except for the local player's controller
ai controllers will therefore only exist on the server
so how i can get blackboard on client side
because i want to set blackboard value on client, so behavior tree run on client
when i try to get ai controller on client, it retutn null
design things so that you don't... you shouldn't be running ai on the client
so what is the solution for that
the solution for what
how i can set value as black board on client side
You don't... AI should only exist on the server
if you have to interact with something in the AI, you do it through the local player's controller (or something else that's owned by the client) which can RPC things to the server
is it correct? but in blackboard the value is still false
:triangular_flag_on_post: g33k360#5490 received strike 1. As a result, they were muted for 10 minutes.
Hi y'all, has anyone managed to get the Advanced Locomotion System working in multiplayer? https://youtu.be/ru1--3wP-F8?t=83
Well, as the saying goes, "If you love something, set it free"...So I did. Please enjoy the biggest update yet :)
Store Page - https://www.unrealengine.com/marketplace/advanced-locomotion-system-v1
Discord - https://discord.gg/wYYMHFu
search github for it someone made it already
Can timers not be set for clients in a multicast function? Let's say I have a multicast function on an actor owned by the server, it executes on all clients, and then I run GetWorldTimerManager().SetTimer() in that function. The function set to execute in that timer will only execute in the server. Is that normal?
that does not seem right
Multicast is ran on all clients
if that actor is not replicated, then that could be the issue?
Yeah the multicast definitely runs, I have it print to the screen. It's the function I bind to the timer in that multicast function that isn't being run on the clients.
well i set timers on clients just fine from a RPC
so maybe you need to show your code
nvm for some reason it started working now 🤦♂️ I swear to god lmao
Hey guys, I'm trying to setup a basic login by creating and finding sessions. I remember I got it working in the past but now it can't find any sessions locally. I tried to join using my local IP and worked fine. Is anything else I need to setup before?
I'm using 4.25 btw
Is there a smart way to set this up on multiplayer sot hat it cannot be easily modified on the client side:
I'm using custom render depths to render team players behind walls. But it would be unfortunate if players just modify this on the client side.
It looks like it has no replication by default either.
The goal I had in mind was to enable it in the OnPossessed method for each individual player, and loop through all Characters of my type on the map and check to see if it's on the same team as me, if it is, enable this boolean. However, OnPossessed is only called on the client side, so I would need to use a Client RPC obviously.
So I should just give up?
How can I implement this in a safer way
^
Checks to see if this actor is relevant for a specific network connection
Information about Actor relevancy and priority
You'll need to get really fancy with actor relevance to prevent any kind of hacks like that mattering clientside. That article and that function will be your best friends in your mission (unless you want to write a rep graph).
yeah i already know about this, but there's no way to make something relevant once its been not relevant
Once you return false on IsNetRelevantFor() that function is never called again
Lol
It's always not relevant moving forward
Maybe one of you know. I packaged my server for a build with Oculus OSS. When I run my build on my local machine it works, I get
LogOnline: Display: Oculus: FOnlineSubsystemOculus::InitWithWindowsPlatform() LogOnline: OSS: TryLoadSubsystemAndSetDefault: Loaded subsystem for module [Oculus]
When I run the build on my windows server I get
LogOnline: Display: Oculus: FOnlineSubsystemOculus::InitWithWindowsPlatform() LogOnline: Warning: Oculus: Failed to initialize the Oculus Platform SDK! Failure code: -5
And it's literally the same build. Aren't all dependencies packaged into the pak?
Then something else is wrong. IsNetRelevantFor() is called roughly once a second, and it is called for every actor vs. every connection regardless of whether it was relevant or not previous check.
Strange
Failure -5 is "ovrPlatformInitialize_UnableToVerify." Really hopin there's someone with Oculus OSS experience who knows lmao
Anyone here has used Seamles travel? Im getting duplicated pawns when I arrive.
Like your player controlled pawn is being duplicated?
Yeah, when I Travel to a map Using Server Travel There are 3 pawns in the new level
You’re registering the pawn as a persistent actor before seamless travel?
Via APlayerController::GetSeamlessTravelActorList
Well, no
The thing is it wasn't spawned yet
I have a map where the controllers spawn like a lobby, when all the players are there then I make the Seamles Travel
They arrive to a Map that has a GameMode that sets the Controller Pawn Class based on the number of players each team has.
What I found is that apparently they spawn, they are Restarted in the controller when the new pawn class is set, and then hey unpossess their pawn and found a new one.
Because in the lobby level they have another pawn actor that I don't want to bring to the other map.
The only half solution I found was to check after the Map loaded if there were Pawns without controller and deleting them. Not ideal for sure.
So I think in GameMode, you can override the pawn that gets spawned by default
Other than the override property I mean
There’s a step where after a controller connects, it gets a pawn to possess. I want to say “find player start”
It could be your pawn change is happening after the default behavior and the left over pawns are the default pawns
It's likely, but weird. Because I'm calling RestarPlayer on the PlayerController, and that shouldn't spawn another Pawn. If I comment that line no two pawns are spawn, but again the whole thing just breaks apart.
RestartPlayer probably does spawn a new pawn
Btw, how do you register a pawn as persistent? Maybe that'll solve the issue, who knows.
On C++ I mean.
Also there’s a transition map the player hits before getting to the final map, so if you’re restarting it you’re probably getting a pawn spawned from the transition map and the new map, giving you three pawns
In c++ you should be able to override GetSeamlessTravelActorList
Or whatever the native code it’s running
Gotcha.
Also, just realized. My lobby map is the same Transition map. The transition map should be an empty one?
Your lobby is set to your transition map?
Yeah, sounds like a bad idea now that I say it out loud.
Yeah idk what happens there
If you’re doing that you might as well do a persistent travel instead
Gotcha. I'm gonna try those things tomorrow and see. Worst case scenario I have that only half fix.
Thanks for the help man, really appreciate it.
Hi! I have a question regarding port forwarding, and i would love if someone could bring me some light about it. The thing is that i have managed to create a dedicated server game and publish it to steam (using Steam online subsystem), but in order to be host, you have to forward ports 27016/27015. The question is, is there anyway to bypass this process? I cant remember the last time i had to do it for a real game, how do they manage to implement it? Am i missing something?
oh sorry! i meant dedicated server
the thing is that my dedicated server instance doesnt appear on the internet unless one of those ports is open
Hello everyone,
I was wondering if anyone knows something about SteamSockets
It's stated that SteamSockets works only for Listen servers, so if i wanna set up a dedicated server i would have to use the normal SteamNet
Anyone knows if there's any problems if my client uses SteamSockets but the Dedicated server uses SteamNet?
Thanks in advance!
Yeah dedicated server is completely different @covert gorge and yes you'll need to open ports
"real games" never release dedis though
The point of dedicated is to host it in a datacenter
oh ok, thank you so much for your help
it makes sense
🤔
Steam allows for releasing your dedicated servers binaries for folks to host their own, right?
Context : " cant remember the last time i had to do it for a real game, how do they manage to implement it?"
My answer is that most commercial games don't have dedicated servers to run yourself
Valid 😄
my bad 😄
And yes, Steam does allow you to release stuff, no one's preventing it really
you are the best!
So I'm reading through http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf and I see being mentioned that Widgets (UMG) are only locally available for a client. But what about widgets that are actually placed inside the world?
Many source games do tho like TF2 or GMod
Yes, I'm very aware
I've hosted some of them before
I was just sharing context on why OP didn't have to open ports recently
TF2 would require opening ports for example
Hello guys
So steam using a socket netdriver to make their servers public right ?
In OnlineSubsystemSteam condition
I don't understand your question.
I mean steam using Ipnetdriver to make the game's server public for other players right ?
So if we are using custom onlinesubsystem cant we just use ipnetdriver to make the servers public

You are confusing fundamentally distinct elements
Your "servers" (assuming dedicated servers running in a datacenter somewhere) are public by nature, really most of the Internet is public
Am i wrong understand their work xD
I presume you are still asking about sessions
Yea same subject
Not at all really
Ah well
Sessions are entirely unrelated to the servers or the net driver, they are a fundamentally different concept
So i misunderstand the way it works
The problem is there arent alot of discussion about that or tutorial so im bothering other people by asking and searching xD
You should explain your issue
You know it same i cant find the session ive created on Pc on Android
Tried to use different onlinesubsystem
So why are you still asking about Steam ? I explained that Steam sessions cannot possibly ever work on Android
No im not asking about steam
I mean steam using Ipnetdriver to make the game's server public for other players right ?
You can't use the Steam net driver on Android
Steam does not exist on Android, and the net driver is entirely unrelated to sessions anyway
Yea i thought its something related to UE4 not to steam
Ok
Anyway i was installing the EOS i will try with EOS maybe works
The Session registiration
So i can retrive the server info on other devices easily
Why isn't this working?
i am getting "Error accessed none trying to read property PlayerState" error
which one gives you error accessed none trying to read property?
is it valid?
it seems that no it is not
When are you calling this method?
event begin play
Probably player state did not replicate yet
Do this on tick rather than begin play, or when the player state replicates for a the first time
ohh
ok so how do I check if it replicated
?
cause i don't want to call it on the event tick
there's a little bit of delay actually
if you try to get it on beginplay it will return false because it was invalid
buut if you use "M" button for example to perform the action after begin play it will work
you can try to make a button to set the player name
like so
That would work for testing yeah, but ideally it should work automatically when the player state is valid. You don't want a user to press the 'M' button for everything to work 😛
@eternal citrus Try seeing if the player state has a replication event in the player controller
override OnRep_PlayerState in the Player Controller
Or ClientInitialize in the Player State
Don't think any is exposed to Blueprint
in my custom player state?
Yeah
I was searching for a BP variant, but I also can't really find anything.
The BeginPlay event for the player state should also work client-side
That much is BP enabled
ClientInitialize is Net Load on Client right?
no I use bps
Then
Try the PlayerState beginplay when client
Well, when the owning player is locally controlled, specifically
That should give you a decent "player state is ready" event
how expensive would it be if I call it on every tick?
also
is there a way I can check how many ms does a function cost?
Blueprint Tick is somewhat expensive so I wouldn't recommend it
C++ ticks are much much cheaper
And yes, it's called the profiler
CPU profiler specifically
stat startfile, stat stopfile commands
And the tool itself is in session frontend window of the editor
can u send a screenshot please?
you can use timer and simply stop it when no longer needed
i think i tried it but It didn't work
but it is possible i did something wrong
wait I will try again
thanks
Wrong link, this one is the correct one : https://docs.unrealengine.com/en-US/TestingAndOptimization/PerformanceAndProfiling/Profiler/index.html
An overview on the Profiler Tool used to monitor game performance.
That's after you've captured gameplay with the stat commands
Preferably outside editor
thanks again
Has anyone gotten server-side generated VATs working with Vivox?
I don't understand whether I need to generate the VATs in my c++ code with authority, or on a separate server through a custom API (in php for instance). The docs doesn't seem to make this clear to me
You wouldn't want the secret for signing VATs to get leaked, so the secret needs to be outside of client game code.
There are two ways of doing this in my mind:
-
You would store the secret in a file on the dedicated server, and you would access that secret file through UE4 filesystem with authority checks. You would then generate tokens and replicate them in each player controller
-
You would have a separate API in say, PHP, that would contain your secret and generate tokens. Although, this would require some way to authenticate with the API, versus the Unreal solution which you can use the PlayerController to authenticate with
When making an API call to the PHP server to quest a token, I don't quite understand how you would authenticate if using Steam for your game (ie no username and password login system for your game). How would you let the server know that you are who you say you are?
Method one seems easier. But, I can't find any docs on it at all
My server machine is unable to start the Oculus OSS, has anyone had success with deploying to a dedicated vm that could lend a hand?
My local machine has no problems with deploying the same package
Hello. Quick question for those who know. If I add an element to a replicated array on the server, and that element already exists, will that trigger the OnRep function on the clients?
Cheers.
Could probably test that pretty quickly with a string array and a delay loop
HA! The oculus app has to be installed on the windows server. It wont work mind you (oculus app can't reach oculus service), but it needs to be installed at minimum in order for ovr calls and the Oculus OSS to run on your unrelated server.exe
Hey guys, why after upgrade to 4.26 I have my dedicated server runs everytime I PIE ?
I have a linetrace for shooting but the client's shots are offset and I cannot figure out why.
The server's is correct, the offset is consistent wherever the client aims
The line trace is done on the server
And it makes 2 line traces when I tell it to do only 1
If you select run as client it will always run a dedicated server
Is there a way to prevent it from running? I have my own instance of dedicated server running, so its just a waste of resources and boot time
run offline and connect to the server with console command "open 127.0.0.1" or whatever matchmaking/connect logic you have running. If you run it offline and you have server logic setup in gamemode, the client at that point will believe it is a "server" just as an fyi. You can also run the game in a standalone mode
In standalone mode it runs dedicated server anyway.
PS: I got you wrong. When I switched network to standalone - it seems to be what I want
If you stand still for something like 3 seconds, while not moving / looking somewhere else and then start to shoot and then wait until you see the result before moving / looking somewhere else again, do you then get the correct trace? (So no weird offset)
Hey guys, I want to have a reference of my ui that I am creating in player controller but I don't know how, any help?
Also I want to reference it in my player character to update health and stuff like that
@meager spade what would be correct way to prevent dedicated server to run with Play As Client mode on?
You can't
Not that incan remember. I know you can make the ded server external
In editor ofc
That means I have to wait until dedicated spins up every time I hit PIE?
on 4.25 I had my dedicated server running until I manually restart it, so my boot time was a matter of 1-2 seconds, not I wait at least 7-10 more seconds for built in dedicated server to boot up
I'll probably stick to standalone for development, as it works fine for me(I connect manually to my dedicated server)
Is there any way to join a multiplayer session without a hard cut?
I mean a hard cut in the visuals. Like say you had a spaceship game, could you zoom out to some sort of view like a Faraway view of the planet, do the join, and then zoom back into your new location?
Connecting to a server requires a hard travel so a loading screen needs to fix that
So assuming the last camera location, the loading screen, and the first camera location that you see after joining all show the same thing, it would be fairly seamless
Static but seamless
That likely won't work well, the camera setup when you join will be very difficult to get to work without any cut
A good old loading screen is safe
when I run my packaged server build it gets stuck (no error or crash) at:
LogGameMode: Display: Match State Changed from EnteringMap to WaitingToStart
When I run as a test server from PIE or something, it does not get stuck:
LogGameMode: Display: Match State Changed from EnteringMap to WaitingToStart LogGameState: Match State Changed from EnteringMap to WaitingToStart
Obviously something is getting stuck in the game state communication from the game mode. Anyone have any ideas?
I have a CustomGameMode based on GameMode, even though I'm using GameState, is it unhappy that I have to passthrough a CustomGameMode to see the parent GameMode? I know you cant mix GameMode and GameStateBase and vice versa, is it something similar?
How would I access the location of the other player in a 2 players multiplayer game? I'm currently using tags and iterating through the list of actors, but I was wondering if there was a better way
you have to ask the server for location of pawns, what you're trying to do with location information kinda dictates how you do that.
or rather, the most efficient way to
@rigid zinc once you've got a reference to the other pawn you can save it so you don't have to keep getting it again.
So in the Controller I would add the other player's controller as reference variable in the begin play, but would it keep the location updated at each frame during play?
Or should I do a location variable and keep it updated with rep notifies / events through listeners?
If Player2 replicates movement for Player1, then do what Adriel says and store a reference to Player2 somewhere and use that to access its location directly
Sounds good, does it make sense for that reference to live in the player controller, or is this something that should be in the Player / Game State?
Btw when you say player location, you refer to its pawn right? Then, the reference you want to store is the Pawn's reference.
Depends on where you want to use it. Store as close to its user as possible. If PlayerController uses the other player location then store it there
Awesome, thank you for the help!
May I validate an idea with you folks that are way smarter than myself? 😅
I'm rebuilding my inventory system and I need the server to be able to randomize various stats on an item. Items vary from weapons and armor, to consumables and placeables.
I'm trying to use composition to build my objects since their stats differ (bows have damage, armor has defense, not damage, etc.) so structures don't work for what I want to do. Not only because the stats differ, but because the data is static. I was only using item ID's on the server to minimize network traffic and manually passing the structures to client to do table lookups for whatever scenario (inventory thumbnails, meshes, etc.)
I've settled, or so I currently think, to use UObjects since they offer the flexibility I need to randomize, inherit, build custom structures, etc. However, they're not replicated. Looking through the 12 pages of "Replicated UObject" search on discord and the various conversations (and no success in getting it working myself), does anyone have a similar system setup that has been used in production? Is there a better solution that I'm completely overlooking?
Avoiding actor components because after spawning 200,000 of them, I went from a capped 120fps to 60 (no tick). I know 200,000 is a ridiculous amount, but that's not the point. Preferably I'd like to use replicated ubjects but am curious to know what some of you seasoned devs think.
Appreciate your time.
i would not even use Replicated UObjects
in my pet project, i replicate a struct of FKaosItemEntry via FastArray, and create a UObject locally
this has a GUID which i use and can be used from anywhere to get the item in question.
the UObjects are only created on server and owning clients
I have a listen server, and I'm trying to have two players (one is the server/client and one is the remote client). I noticed that when I press play, there is a delay before the client appears in the game. I would like to disable movement for the pawn while there is only one character and enable it for everyone when both players are in the game.
I tried the following code without success:
Basically after possessing the pawn, the controller checks if there are 2 players. If so, it calls the InitTeammateEvent (Which runs on server)
The server then multicast to everyone with the InitTeammateRPC and should (if I understand multicast right) run that function for all clients, and re-enable movement
But in practice, the print string appears once and only the second client gets its input re-enabled
How can I enable it for both players with a event sent from the second player?
this
I feel like you want to make your own little replication & database system that is tailored to your use case. Specifically, this system would:
- Keep a database of all item stats (so objects can reference the stats with a simple easy handle)
- Transmit this database or portions of it as required
If you have that many unique items 😄
A "database" in this case can be as simple as an array (a fast array if you may)
i have randomly generated weapon stats
but i just pass a seed along in the fastarray (only replicated once)
and client runs the same logic, ends up with the same result
but that is very game specific
Yeah, that's a good way to go about it
If your stats are procedural/can be predicted from just a seed
If your items have a natural variation in their parameters and aren't simply randomized, then consider this: https://en.wikipedia.org/wiki/Box–Muller_transform
You can use gaussian distributed random values to give a more natural variation, so you specify the average and the spread instead of min and max
Err, there's probably this already in UE4 somewhere 😄
an example would be a bow, I'd like the bow to do 5 damage for example and then have some sort of affix on it that gives it an additional X1-X2 for each stat (attack speed, accuracy, damage, etc.)
Gameplay Ability System 😄
I just got stuck on the structs part - ideally no replicated objects would be nice but couldn't figure out how to make the pawn rebuild exactly what the server has
well that is what i use, i mutate the Attributes
so what do you store your items as at the end of the day? like what does your array list consist of? ID's and seeds?
though, mine is kinda mutated by weapon level (for damage), but additional modifiers can be applied (like increased headshot damage, increased accuracy)
all items in my game have a Definition Primary Data Asset
then i pull the stuff from datatables/curve tables
so a bow is a bow, but that bow might have a tag, say Mutation.Accuracy.Positive
then i pull the accuracty mutator
and are you able to give that accuracy mutator a range? like can apply +5 - +10% accuracy?
FYI, my system is not fully fleshed out yet, its still very early WIP
is it playable? 😂
yes but not publicly
so i have an AttributeSet called WeaponSet, that the player has
when the weapon is increased, it will apply a +5 or +10 accuracy increase to this attribute set
that value is determined by the seed that generated the weapon
my weapons are fully random (ie, you can't select stuff)
you can re-roll it, but you can't say i want 10 percent this, 5 percent that
yeah, that's exactly what I was going for (minus the re-roll)
my definition for that weapon holds the curve table row for the mutators
i simply roll random with a generated seed
but as its WIP, that might change in future, but one thing i did not want to do, was replicate UObjects
just to cut down on traffic or?
and server load
ah
with a FastArraySerializer
if i add/modify/remove an item, i explicitly tell the FAS, and it only sends that one piece of information
and it has client callbacks for Added/Modified/Removed
sounds like I need to learn waht FAS is
gonna check it out, thanks man.. I appreciate the feedback
makes me feel better now that I've spent 2 days tryna replicate uobjects - it wasn't feeling right either but I didn't know what else to do
thing is for simplicity, replicating UObjects is ok
we do it in work game, but we don't have a lot of items
and its only 8 players
and none of them are random
do you think the load would be too much for ubojects that are only replicate to owning clients? it would be specifically inventory only
well.. that's a lie.. I guess when the item is dropped it would have to retain it's stats so the UObject would still exist
not really, but you need to define they are replicated to owning client (ie via an actor that is only relevant to owner)
or it could be passed to an actor I guess
see that is where the beauty of my fast array system
I drop an item, and spawn a Pickup actor (replicated)
this literally holds a tiny struct (FKaosItemEntry)
new player picks it up, creates the exact same item
inside that itementry, do you store the seed you had originally generated?
yes
so this random seed is simply picking a spot on a random curve for your "bows"?
its a CurveTable, mapped 1-10
and it does a RandRange(1-10)
using the seed on that curve table
you could just do it using a min max
ie min of 0 (you don't get that stat), max of say +40
and just roll a random
or use weights, ie more chance to get that stat or not
my first roll is always a weight table roll, this determines what modifiers the weapon is getting
then it rolls the actual percentage for each modifier
ah yes, that's the idea
i also do the same with attachments for random guns (like what sight it will get, if it has aiming laser, etc)
so I guess I gotta check out FAS and GAS - is GAS necessary or can FAS and Data Assets get the job done?
GAS is good if your making a multiplayer game, want to do predicted stuff, want to adjust player/weapon stats at runtime, etc. Not required at all. Just a really nice system to save you a lot of work
alright, I guess I gotta face my fear of the UE under-the-hood magic eventually lol
My little side project has a stupid way of replicating items
It actually pretty much implements the "UObject based replication" haha
In that game, an item is always an actor and always exists in the world. So all data can be synced through that point
But don't do that
yeah, trying to avoid spawning / getting the server to ask
"should I replicate it yet?"
"should I replicate it yet?"
"should I replicate it yet?"
.. as much as possible lol
anyone facing weird bug, regarding gamepad or virtual joystick
im using virtual joystick, with multiplayer (Using default 3rd person template)
when i using WASD to move my character it work as expected for each character
but if im using virtual joystick to move, they will controll the same character
https://www.youtube.com/watch?v=AO7oaysI9Uk
thats similiar problem
Hello. I'm working on multiplayer android project. The problem is that virtual joystick of all clients send events to client #1. I saw such problems since UE4.14 even with example (template) projects. How to solve this problem?
Using replication graph, got this error in dedicated server but not in editor?
This seemed to be due to have a "Default Server Game Mode" set in project settings. I think.
Has Anyone got a crash on build while doing a ServerTravel but not in Launch Game?
Getting Something like this
[2021.02.09-03.52.10:265][984]LogWindows: Error: === Critical error: ===
[2021.02.09-03.52.10:265][984]LogWindows: Error:
[2021.02.09-03.52.10:265][984]LogWindows: Error: Fatal error!
[2021.02.09-03.52.10:265][984]LogWindows: Error:
[2021.02.09-03.52.10:265][984]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000038
[2021.02.09-03.52.10:265][984]LogWindows: Error:
[2021.02.09-03.52.10:265][984]LogWindows: Error: [Callstack] 0x00007ff77803ed35 CTFTask.exe!UnknownFunction []
[2021.02.09-03.52.10:265][984]LogWindows: Error: [Callstack] 0x00007ff77bd0eb2d CTFTask.exe!UnknownFunction []
[2021.02.09-03.52.10:265][984]LogWindows: Error: [Callstack] 0x00007ff77862c369 CTFTask.exe!UnknownFunction []
@fossil zinc this is null pointer, attach debugger and see which variable is null.
if its windows dedicated server , i m sure you can directly launch server from VS or Rider in debug mode
and then connect your client from editor
You mean like attaching the build to the visual studio using attach process?
Because I did that and got this log
[2021.02.09-04.18.29:056][565]LogGameMode: >> GameMode::HandleSeamlessTravelPlayer: PlayerController_2147482435
Exception thrown at 0x00007FF7F5F7C8AD in CTFTask-Win64-DebugGame.exe: 0xC0000005: Access violation reading location 0x0000000000000038.
Bu doesnt say an specific line, says DebugGame.pdb not loaded
I don't mean attach process, I mean in VS you can directly launch instance with debugger attached
attaching debugger to a process might not work.
in VS i think its F5
Ohhh ok. But no, If I do that or do Launch Game it works fime
The problem is on the build
Those errors are from the logs
so is your server crashing or client?
yes launch the editor in debug mode and you are done, it will hit the fatal crash point .
The thing is that I can really test it in the Editor. I'm first doing a Create and Find Sessions, jumping to a lobby level. On the lobby will make the server travel when the Client connects. If I try to do this process in the editor wont really work, as many times doesn't find sessions. So I tried it using Launch Game on the uproject and there it works.
So I can't use the Debug mode of the editor because won't really do login
I understood your point.
but you should be able to Create and FindSession in the editor and you should fix that problem rather than going the long and un-traditional way to doing things by launching game using uProject
just think for how long you will rely on testing your game by launching it via uProject and it wastes a good amount of time
Well, I read that when testing LAN was kind of the only way, because the editor will always create a server and client that were already connected.
I though was normal
How can I replicate a jump action on every player in the game? Say I have two players, and when one press on a button, both jump in the air
I tried replicating with multicast / RPC on the PlayerController but it only jumps the player who pressed on the input (and it appears in both screens, so it is replicated, but it's not what I'm looking for)
Do I need to use a repnotify or is there another way through events?
@fossil zinc If I remember correctly epic changed things in editor regarding server in version 4.24, https://docs.unrealengine.com/en-US/InteractiveExperiences/Networking/TestMultiplayer/index.html
Set up the Unreal Editor for testing multiplayer games.
there is an option to disable server in editor.
I Read it used to be, but I couldn't find it. I'm on 4.25 btw
what is your default multiplayer mode?
Play as Listen Server
it should be stand alone, because at first you are creating session and then finding session
if you are already launching as listen server, then your clients already connected to that listen server
then there is no point of creating and finding sessions
try without changing that.
Give me a seec
listen server mode -> should be used if you want to bypass your session thing locally and its wonderful for in editor quick testing.
Yeah, stand alone works without issue
cool
Also, I just tried by changing the destination of the ServerTravel to an empty map an seemed to work.
Maybe is something in there
now you should be able to debug your crash
nice
jump replication logic is already there in Character class.
Yeah, the issue is that I need the build tho.
then use the packaging option to create build.
Yeah but that's not the behavior I'm looking for
I'm using Jump as a simple example
But I want BOTH players to jump when ONE of them press the jump button
What the default jump replication does currently is when someone jump, it tells the other characters that this person jumped and show the effect visually, but it does not affect the current player who did not jump
@rigid zinc is it fair to assume that both players are linked?
Player1 is controlling Player2?
if all of the above is true, this is how I would do.
override the Jump function.
Super::Jump();
if(isControllingOtherPlayer()){
val ref = GetOtherControllingPlayerReference();
ref->Jump();
}
}```
What do you mean by linked? As in, they have a reference to each other?
Oh yeah, I was looking for a way that does not imply a direct connection to each other
Basically, playerA would send a notice to the server "Tell everyone to jump" and the server would make everyone jump
what you told is that other player will jump automatically when PlayerA jumps.
just override the jump function and check for conditions when other players should jump and then get reference of other and call jump.
what do you mean by this?
but if im using virtual joystick to move, they will controll the same character
but isn't there a way for the server to tell every client to do something? Without having reference to specific ones, just broadcasting an event (like a dispatcher)
And anything that is bound to that event would trigger the jump
oh it gives me an idea actually, my previous try with dispatchers didn't work but I think the problem was with how I called them in the controller
as far as I know there isn't any broadcast for jump, you need to implement that.
Not for the jump specifically, I'm just using Jump as an example to demonstrate the issue
i got your point.
It's more like: CharacterA send notice to server -> Server broadcast to ALL characters a message of such "Trigger behavior X" and each character would trigger that behavior for itself
do you use GAS?
ah i fixed it, damn,
look like the problem only exist on PIE
cool
i need change some config to make virtual joystick working on PIE
if you use GAS, PlayerA will apply effect to the PlayerB, and upon receiving effect PlayerB will do actions, example PlayerA will apply JumpEffect, AttackEffect , etc to playerB and when that happens PlayerB will get callback for effect applied PlayerB will jump, attack , etc based on applied affect.
and GAS is server authoritative and predicted.
I m just telling you one more way to do it.
Awesome, I'll give that a try! Thank you 😄
hey wondering if you could give me some pointers for that
do you know where i could start to implement that type of broadcasting?
You ever done anything with GAS?
create one delegate and override the jump function and broadcast to that delegate and all the observers will get notified
Why are you trying to make everyone jump?
Why not just get all characters and call jump on them lmao.
the guy gave Jump as an example, in game it could be any action which should be duplicated by other character
its kind of PlayerA is doing mind control on playerB
so whatever PlayerA does PlayerB also needs to do same
Does the text on a widget component or the textrender component added to a character require different methodology than the normal repNotify? I ask because I've struggled with getting my nameplate to correctly display on every character joining dedicated server - it only displays properly for characters that join after.
I added the female mannequin, set up the same process I used for the nameplate, and that works when joining the dedicated server. You can tell which character chose the female mannequin or the male mannequin regardless of whether they joined before or after another character -- whereas the nameplate widget OR the TextRender component do not.
I even set up a input key to tell me the character's name stored on the player state and that works ... but nameplates still retain the default text value instead of the correct value for characters on the server prior to your joining.
Depends on what you are actually doing there.
There are a few problems you can run into:
- PlayerState exists before PlayerCharacter
- PlayerCharacter exists before PlayerState
- PlayerCharacter BeginPlay is too early to perform any "GetController" or "GetPlayerState" calls, as the PlayerCharacter might not be possessed yet.
Stuff like that.
The actual RepNotify of a Name into setting it on the Widget should not be a problem
Unless you aren't handling the cases above
First: Thank you for your network compendium guide. I would be even more lost without that.
This is one of those situations where using C++ would solve this a lot better.
As you have a RepNotify for the PlayerState on the Pawn iirc. So you would know exactly in your Character when you can access the PlayerState and set the name.
No biggie, glad it helps!
So I've been playing around with vehicles, boats specifically, and I've been using the new 4.26 water plugin, now I manage to get everything working except I get this issue where the waves are not syncronized and on clients side the boat goes underwater at times due to different waves. Is there any method to syncronize the waves from the server to all players so this issue doesn't occur?
I use the same process for the nameplate widget as I am using for setting which mannequin to use.
Here's (as brief as i can be) the issue:
A) Client One sets name to "Tony" selects "Male" and joins dedicated server.
B) Client Two sets name to "the Tiger" selects "Female" and joins.
C) Client one sees nameplates and character mannequins correctly.
D) Client two sees only their own name plate correctly but sees both mannequins correctly.
I use the same process for the nameplate widget as I am using for setting which mannequin to use.
If a Client Three joined, One & Two would see them correctly, but they'd have no clue on the nameplates of 1 & 2.Here's (as brief as i can be) the issue:
The code that you use to do this would be essential to help debugging this.
I'm hopping into a meeting soon, so won't be available, but if you post your code, properly formatted and commented, then others can probably help too
I appreciated the time you've given. I will post screenshots of the blueprints.
What would be the proper way of changing a clients pawn (online, not split)?
Alright. Sorry about the incoming wall of screenshots, but here goes.
First the TextCommit for the UI_SetName Widget from log-in:
The Handle Enter Commit from said TextCommit
The Character Actor "Survival TPC" Begin Play:
The Character Actor "Survival TPC" (RPCs?) from Event Graph:
The OnRepNotify for Name to Set:
The Save to Game Instance function to store Name, Gender before joining the Dedicated Server Level Map:
The Name To Set Variable Settings on Character Actor Survival_TPC
and the Set Name function from the Survival_PlayerState that is called in PlayerState's begin play:
Finally, the PlayerState Begin Play
What client one sees:
What client Two Sees
What is the best way to make a specific actor on a level disappear on a gamemode event? Like for example if I had a gate actor that is placed in the level and when a player reaches x level the gate (collision and model) will disappear for all players and everyone can access the new area.
For some reason setting ActorHiddenInGame through a reference in the GMB doesnt work but setting the actors EnableCollision does work
cpp or blueprint??
I suppose either, but it would be more convenient in BP
instead of setting ActorHiddenInGame, try DestroyActor
hmmm, i have a gate and im working on a multiplayer so let me go test some things and get back to you
The server is always authoritative, should just work yeah. Then there's something wrong with the logic trying to destroy the actor or it's not properly set to replicate.
That is pretty bad
No doubt. I've only started learning to swim and I started by jumping into an under current, for sure.
- Don't use Delays to counter network stuff.
- You are accessing the GameInstance of each player, cause BeginPlay calls on everyone.
That means you are actively getting the values from every player and in the end the Server will probably always win due to authority. - Replicated Variables on the GameInstance make no sense. i
Why a Multiplayer if you already have a replicated variable?
actually, odds are everyone will be named the same as client with crappiest internet connection
😄
Are you sure the mesh is on the same actor?
@open wadi There are a lot of things wrong in your code, too much to go into right now.
You should maybe sit back and plan this out once more.
Think about when each player is doing what, when which class is available and what function call where.
You can use GameInstance to move the selected stuff from MainMenu over to the Game, that's fine, but you can't use BeginPlay with a Delay like that.
Use OnPossessed with a ClientRPC, followed by getting the name from the GameInstance, followed by a Server RPC to set the variable on the Server so it can replicate.
@gritty lodge if thats gates as in, plural
and you're grabbing them via GetAllActorsOfClass
that thing has no order
worse yet, its likely to grab them in different order on different machines
Thank you for your feedback.
is the TestGates blueprint set to replicate? if it is not then the mesh will stay but it wont actually be there on the server, only clients
no worries, glad it works
🥳
What would be the proper way of changing a clients pawn (online, not split)?
You have to give more information. This can be answered in a lot of ways
I have a client joining a server, that is then calling a function to change its pawn. Currently that's a Run on Server call (into "SpawnActor Pawn" into "Possess"). Now I'm not sure how to properly get the correct PlayerController. Tried as a variable, tried to let the server find it via comparison. But I'm doubting this works in the first place.
this blueprint?
😄
fixed that in a recent engine version in a PR xD
that was almost a year ago now
I don't even remember
4.22
😂
if you say so, I trust more you than myself for remembering stuff 😄
@fluid mica if the client is changing Pawns in a way that requires input from a player
then that should be done via reliable server RPC in the PlayerController
in which case the server's instance of the PlayerController that received the RPC is the one you want
Mhm, its happening all automatically, or supposed to.
so what are you trying to do then?
I'll look at that. I have a separate BP right now handling the stuff. I just noticed (via print string) the server RPC isn't being executed anywhere.
Client joins, and gets a different pawn assigned. Since its switching between ThirdPerson and MotionControllerPawn depending on Windows/Android
To refresh my memory, does the OnRep function still get called once an actor enters net relevancy range, but was outside net relevancy range when the variable was updated?
yes onrep gets called when actor enters net relevancy range yep
Cheers!
So long as it's different from the default value
yes! what James say... but, remember what they say multicast for visuals! onrep for stuff that matters for your clients! kinda ~ 😄
onrep for visuals sometimes 😄
That's a nice gotcha, noted 😄
@fluid mica you should probably send that information when logging into the game
not RPC it after the fact
via options string
ah
then check the value you stash it in during HandleStartingNewPlayer
Good point, ty
and instantiate the correct Pawn/PC for that interface
I'll try that, cheers
Question. If you want a singleplayer game and a multiplayer game that have the same logic / gameplay in one project. Would you in the case of singleplayer just start a listen server on that client and disallow any incoming requests with bAllowInvites set to false (and I assume setting it to LAN only as well with bIsLANMatch?) in FOnlineSessionSettings, or is this considered bad practice and is there a better way?
we use lobbies to setup a game, and allow users to turn theirs private/public/friends only
Sorry, I had to quickly eat. But you host an online server and then allow 1 client to use that or?
we use listen servers
Oh like that.
but wouldn't be drastically different
I was just a bit confused xD
But basically a private listen server would be the way to go in your opinion?
we use steam lobbies
so they are independent of both our listen servers as they would be of dedicated servers if we were using them
its basically a steam hosted chatroom that can share some data in string format
Ah, so that a user can easily update the 'type'? So easily switch between public, private and friends only?
@winged badger Works, that was the bump in the right direction, thanks :)
yes, and that works for joining the lobby itself
after you have a full set of players, connecting them all to a dedicated server is trivial
anyone know is that so method like on connect or on disconnect for UNetconnection connect/disconnect to the dedicated server
I want to know when pc Unetconnection is available as I want to get that
on server or client?
on server
on clients it would be available in the same frame the PC spawns, on server... i don't remember that code anymore :S
not having a cause to visit it all too often
@finite kettle wdym by UProperty data?
@winged badger Just the UProperty itself, lets say its going to be GUID or uint
Trying to figure out how to pair client-side predictively spawned actors. I checked the UnrealTournament code, but I don't like the way how they match them.
So I would like to use some kind of IDs, but dont know, if it is possible to send the ID together with SpawnActor bunch
all properties set server side before the actor is first replicated to a connection
will replicate in the same package as instructions to spawn the actor
all replicated variables will be set client side and replication notifies called
before client calls BeginPlay
awesome, thank you 🙂
when you're replicating a NetGUID
that doesn't guarantee that an object whose NetGUID it is has itself replicated at that point
typically, both PC and Pawn have a replicated poitner to PS, but PS is rarely available when they call their first batch of replication callbacks
as PS has a lower NetPriority, it usually comes later
exception to that if its a net guid to actor loaded form package, they will be net addressable and ready before anything replicates
if I use set delay node in blueprint and set to 0 to delay 1 frame before I get UNetconnection on server, it works, but do you know it is reliable ?
@winged badger ye, I saw there is a array of unresolved/unpaired NetGUIDs, which will be probably paired later
I dont wanna mess with NetGUIDs right now, dont have enough knowledge. I want to try more "noobish" way with custom IDs. Maybe then I will be able to pair them in better way.
what are you trying to do @modern swift
im not convinced you need to detect when connection is instantiated for anything
@finite kettle you're trying to spawn actors on client and server separately then pair them after the fact?
That would be the best scenario. Unfortunately, I don't understand the NetGUID mapping that much.
So I'd like to try it first by spawning client-side actor first, set some ID to it and request server to create the same actor with my custom ID. After the server-side version of the actor is replicated to the cllient, client will find the "fake" (client side) version of the actor and destroy it/interpolate to the server side version and then destroy it
if that actor's IsFullNameStableForNetworking is overriden to return true, it has bNetLoadOnClient and bNetStartupActor true, is spawned with exact same name on server and client
and then server turns on the replication
it will probably work
provided you're happy with the following flow
1 - owning client predicively spawns the actor
2 - server spawns the actor, same name, sets it to replicate
3 - simulated proxies just get the replicated version
huh, no that wouldn't work either.... not on simulated proxies
bNetStartupActor affects the last bit of the NetGUID making it static vs. dynamic
clients expect to already have an instance of the static Actor around when they get a package for it
and the owning client will spawn a new one, unless the NetGUID is static
so problem
we use the separate spawning on clients and server only before BeginPlay
and can network everything after the fact
what I am trying to do is use the UNetconnection to assign pc to a new create replication graph for specific connection(like a room)
you're probably good if you do that in GenericPlayerInit override in GameMode
its the function where engine sends first client RPC to the player (init HUD)
it happens before the Pawn is spawned
and right after PostLogin/HandleSeamlessTravelPlayer
what if I need after the pawn spawned
then do it after calling super on HandleStartingNewPlayer
which is right after pawn is spawned
and GameMode already sent client RPCs at that point
so connection is good
cool thanks
why this collision is only working when i am really close to player
like on 1/4 of sword
Do someone know ho to replicate a skeletal mesh ?
I'm using modular character customisable skin system but the skeletal is not replicating to all clients
like when i do print string with other actor name i got the player that im hitting
and i did not understand what u mean 😛
how will channel works
like in multiplayer
Out of curiosity, why is this a thing? SetRemoteRoleForBackwardsCompat
Hello, Is it possible to control which peers receive the Player movement update?
well ue4 uses a server-client framework, where the server's state is the true state. so we can control rpc methods: like client to server, or server to client, or broadcast to all. Most common rpc call is from client to server so that clients action are going into the server game state.
No. Relevancy is determined at the actor level only, not per-property
There are some primitive property controls such as Owner / SkipOwner, but that's it
Yes that's fine I guess
Each actor could just decide which are the peers interested to its own sync data
Let's say I've two rooms, in the same instance: each room contains a different group of actors. Each group of actors see each other but no the other group
So the server will replicate any properties that are set to replicate to the clients, when those properties change
Hello, Hope your all well, anyone here familiar with how the character movement component does client side prediction with server side correction, I'm trying to do anti cheat and understanding it would help a lot.
If you're not using replication graph, you can override IsNetRelevantFor() on the actor, and add your own custom conditions.
If you are using replication graph, you would need to create a per-connection node for each room
Perfect, I can check those, thanks for the hint!
Network Relevancy isn't immediate though, just bear that in mind. Takes a few seconds to kick in
for general performance/bandwidth reasons mostly
It's very complicated. You can read detailed docs here:
https://docs.unrealengine.com/en-US/InteractiveExperiences/Networking/CharacterMovementComponent/index.html
Detailed explanation of Character Movement Component
Thanks, I hope its detailed
Prediction is not really in the same vein as anti-cheat though
you move locally and tell server you wanted to move, then server moves you in the server, and if the difference is too much, it snaps your client back
you can test it how it works if you make client only sprint function, or disable wall collider on client, and you will see it wont let you do that without insane rubberbanding
if you need more technical answer, you need to dig to source code
like with all security, the point isn't to make impossible to stop or prevent, but make it hard to cheat. Like with server rpc validation, yeah they can defeat but it makes it hard since they may not have the server code.
i don't think they can stop cheats like aimbots or wallhacks pubg tried like 5 different anticheats or more lol
now its dying on steam
Ouch
Cheating is a fact of life, you only fight it through perfect server code, client-side anti-cheat, a report and banning system
Welp all you can do is try I guess
Yeah
I always harass people here to tell them not to do competitive games as an indie
Haha
It's just not going to work at that scale
Sigh, but I really want too...
Yeah we all do
Yeah sure ^ that's a great point
I'm actually doing something a lot like that where I could add competitive play because everything can happen entirely server side
But shooters etc, nope
Way easier yeah
But for shooters, yeah, I brickwalled my game just because of that
I tried with 250 ping...
Felt like Diep.Io
Haha
there's that kind of wierd cheat in games specially made with unreal
where the clients "cheaters" can manipulate bullets if youu spawn them as actors
nott but i experienced that in pubg where someone shot me and he was not even aiming at me
that's tthe cheat even if spawned by server still can be manupilated
Im sure the validation code is not good, Look at Overwatch
They pulled it off
The only hacks they get are wallhacks and aimbot
But aimbot is just
Everywhere
Wallhacks and triggerbots are two very difficult to prevent classes of cheats
You can absolutely fix shooting through walls with a proper setup
Thats fine
Wallhacks and other client-side cheats you can do nothing about
Not even worth attempting
No not wallhacks in shooting throug, but looking through walls
Wallhacks you can do some things - Valorant did
Interesting will look into it
or you can just prevent the users from playing, no playing means no one can cheat 😛
...MEME
Mostly I think the best fix is a social one - make sure people play with trusted people
That would be amazing
Like, even CS GO does that. Experienced people are never matched with new accounts
A client authroritive game, it would save soooo much server calc and alot of bandwidth
Making it more responsive and getting hit behind walls, but that would still be a thing
Ovewatch extraps movement so you run behind the wall if the ping is huge
its the war of anti-cheat companies and no life kids
basically it never ends
Getting hit behind walls is unavoidable because the alternative is that your correctly aimed shots as a client might not actually hit, which is way worse
The shooter doesn't know the other player dodged because they only dodged 50ms ago, and you don't want to deny the shot based on information the shooter couldn't have
It sucks, but it sucks less than shots that don't connect
Battlefield 4 had major issues with that when they launched because they compensated too much, players felt like they were being shot around corners. But it's always a trade-off between the shooters' POV and the victims
Destiny solves this by being very okay with kill trading (literally a medal on screen)
Pretty much "lol u got shot behind a wall"
Anyway, my advice for indie competitive shooters is to have clever matchmaking that puts people together based on how long they had the game, for example ; and a report system
ye that kinda makes you want to uninstall they even ruined among us lol
even simple games have cheaters
PC gaming in a nutshell
It's one of the few airtight arguments in favor of console gaming
I think the only true way, would be a very good AI to detect hacking
AI won't help, a triggerbot is impossible to tell from a top end player
Or at least very hard
Yeah maybe from aimbot it would be near impossible, but for other hacking ye
Aimbot can be done very well depending on the design
Very difficult to detect
Aimbot is very obvious usually
Yeah aimbots probs dont need acess to that, but Im not 100% about that one
I wonder how epic bans cheaters for using aim bot lol
based on what information or just players feedback
As in Fortnite and the likes?
yeah
You can very easily (as far as hacking goes) build a completely hardware based triggerbot that is entirely impossible to detect because it runs outside the computer. FPGA board with HDMI in from your screen, mouse plugged into USB, board acts as mouse, forwards input, except it clicks when you hover a head after a random but very short delay. Expensive, but absolutely impossible to detect.
There's no silver bullet for anti cheat
The only way to curb cheating is to make it a terrible business investment so that no professional Russian developer can make a living from it
Not sure, but I think using the community as reports and running anti cheat + making your game ban hackers/cheaters when you find them and make it cost something, and make it take alot of time to get to ranked, to discourage hacking and aimbot
you forgot about chinese teams ? i never heard of russians got arrested
Why would they be arrested ?
for develop cheats
You think the Russian gov cooperates when US based developers get cheaters on their games ?
They do not
not but i remember bluehole sued 100+ chinese for 5 million dollars or something
Need help with linetrace in multiplayer
this works on listen server
but not like it should be on client
it works when i am very close to other player
Well
but on listen server works as it should be
...
i am dump in line tracing and all so yeah 😛
yeah
i think yes 😛
oof tick linetrace
Trace on tick is fine
Would work wayy better
Don't force people into premature optimization
but it looks like an rpc on tick
Okay
it have the same issue
RPC on tick is an issue
that only works when ive been really close to other actor
Is your end component (Box?) attached statically?
Or does it move dynamically in relationship with whaterver its attached to
Real question is why would you run a Multicast to do a Line Trace then have an Authority switch right after?
nope, its attached to mesh
True...
the setup doesn't make any sense at all
oops 😦
You should run your linetrace on server then pass in the actor hit to the multicast if really needed
ok
but im not sure you need that
Just do it on the server
No need to check if has authority then
Will be authroity
also
Is your actor replicated?
Why are your RPCing the call
@uncut schooner you should see my line traces on tick. About 500 of them
yep
Should work okay I think?
Depends what you use the data for
and how you call it
@uncut schooner The RPC is Also Reliable calling another Reliable Multicast
ON TICK
THE BUFFER BE SCREAMING
lmao
Really the only thing you should be rpcing on tick is your continuous input or something derived from that. Basically your aim direction and movement direction
frustrum culling relevancy woahahahah 😂
like that?
Frustrum/LOS relevancy doesn't really work that well though - creates a lot of other problems
True
yeeah hahaha
popping and whatnot... like relevancy is somewhat even a design thing
Would be nice to avoid the movement ones though @dark edge , use info derived from charactermovementcomp
Well yeah, something somewhere has to send to every frame. And most people's cases, the character movement component is handling that.
And I think add pitch and add yaw on the controller also automatically send it to server. Don't recall right now.
@hollow oasis Still trynna lauch unreal
Yeah its stored on server, in character controller, although I doubt they correct cheating because its via add inputs
ok, it works but if i am not playing animation where sword is moving
line trace is stil in same position
Hi guys, can anyone explain to me why overlap events become less accurate or reliable the further away the client is from a listen server, i notice that when the client is in the listen server viewport the overlaps are super accurate. However when the client is far away the overlaps trigger but they don't fully trigger a server funtion, does anyone know why, ?
it seems more reliable when the character is actually moving as well, is there some sort of setting that needs tweaking here
Strange
are you using animations/skeletal mesh for the collisions?
Yes there are collision boxes attached to the character, when the animation plays the box moves with the fist
might be that the animation is not playing or is at reduced rate when not in servers view
ahh ok, is there a way to ensure they play
100%. Also means it will be framerate dependant too to some extent
Best approach is to keep gameplay decoupled from the visuals
Notice the overlaps fire, but the server function doesn't always trigger, which in turn triggers a net multicast
Smoke and Mirrors and all that
well an attack has to be driven by the animation though, where the fist is is relevant to a valid hit
there is a option somewhere, something like "always tick poses and refresh bones"
cant remember where it is or what it's called
Not necessarily. You can just define a time and a position at which to perform an overlap query
@cinder quartz is that on a montage or an individual animation, or even the anim graph?
right, well i have characters with fists, is there anything specific you'd suggest?
if you look at the video its a claw that moves with a collision box attached
i think it's on the mesh component
This is tick animation frequency option based on this component rendered or not or using montage You can change this default value in the INI file Mostly related with performance
@cinder quartz That did the trick, thank you so much, this has been beyond frustrating for me!
i thought it was replication, then overlaps issues etc!
yeah I had that problem once, where I noticed that my client was just t-posing on dedicated servers 😄
Well brilliant spot many thanks!
@hollow oasis you need to start from square one, you are in way over your head. First of all, why are you doing the traces on clients?
Choose one, either the server does the trace, or the controlling client does
you have it backwards
client do trace -> pass hit to server -> server validate hit -> server do damage
or do it all on server
but then it will feel bad to play on high ping
and when you do damage on server, make it reduce HitPoints that is replicated, then OnRep_Notify you can apply visual effects like blood on clients
it's up to you, right now, when testing, you can just accept it. if you wanna validate, you can trace on server too
shootergame has example of hit validation but it's all c++, they check things like angle etc
shivers at that multicast 😄
yeah was wondering how you gonna validate a hit , are you going to do a trace on server then compare?
that dosen't make any sense right
well, you just check on server if the hit is possible
you can be strict as you want
you can always make function "ValidateHit" that return bool, and implement it later
for guns in my game, i do this, Client produces target data (trace result), sends to server, server just does validation (Yaw Angle, simple line trace from start to end to make sure no wall or something blocked the shot client has not seen yet, etc, If all is good, server damages the target, and sends a client RPC back to shooter saying hey your hit was successful, this plays hitmarker effect for shooter. It also sends out the hit effects (i use Gameplay cues, cause of GAS) but its basically a multicast for the damage effects that everyone sees.
same exact thing can be applied to melee weapons
thanks for help
I dont think you need to worry about the validation part now, just get it work now
the whole hit/trace I mean
Don't worry about validation right now, just get the damn thing working. nobody's going to cheat at a game that doesn't even work yet
but for future reference calling for validation you would just do some sanity checks like could this character have actually hit this actor, is this character hitting like 100 times a second, etc.
Yeah it working right know :D
I think same right know :p
HI everyone. I'm trying to set some batch files for server/client connections. On my PC I already have them set, but when I execute them on the laptop they close immediately. I'm pretty sure it's not a problem about the "query", it must be an issue from the .batch files. Even if I add a pause at the end of the file, it doesn't stop. Any idea what the issue could be? Thanks!
Do i need any special settings for the observers? As in whether those functions should be run all on the server
Are you talking about using the batch file to launch the game as a server or client?
It depends on your game needs.
Its a 2 player game, any other stuff i should factor in?
Networked
It's difficult to predict anything upfront. You may try that and it should work