#multiplayer
1 messages ยท Page 574 of 1
Quick question: Is there a way to modify server joining logic for a dedicated server based game. What we have is 'World servers' which can handle X amount of players, but we want players to seamlessly travel between servers hosting the exact same map (if they want to play with friends etc) - but without a loading screen. Ideally what we're looking for is a way to say 'Update Connection to 127.0.0.1:7778' and it'll connect to that server but not unload the current map and load up the exact same map again.
It's clearly possible because Sea of Thieves does it
But it's a large engine change
Basically you want to
- freeze your server data for the player
- have server A send server B the player data
- start a login process on server B, get yourself the new player controller that you keep ready but unused
- somehow switch to the new connection & player (hard part that i don't know about)
- disconnect from A
switching shouldn't be that hard, server B prepares everything and when its ready signals A
player does login and B just spawns its pawn
harder part is forcing unreal not to unload all the level assets
That and being connected to two servers at once on a client
you don't need to be connected to both, A can inform B with everything it needs to know and tell it to expect you
once B reports ready you just hard travel to B
Okay, but hard travel to B gets you a loading screen, doesn't it ?
Alright maybe not if you have everything loaded
Just the connection time
Me and my friend are trying to find a way to both work on a project together. Do u guys know how to?
Each have strengths and weaknesses
Git has free hosting so there is that
It's also clearly the most complex
And maybe the least suited to games
Perforce is the industry standard but you'll need a server
SVN is a bit of a middle ground
Not sure if mentioned, but Perforce Server is like $5 Digital Ocean Droplet (per month), so also not the world.
What would be the best way for a client to buy buffs in game?
Using Custom events may fail sometimes or overload the server if the player spams the buy button coz he's able to buy a bunch of things at once
is there a way to cancel a client travel?
as in, the player controller does client travel to a server but wants to cancel the travel before it actually goes to the new level and connect
after you start it, no
@gritty pumice without knowing what your buff is and what it means to buy it, no idea
imagine you have you a shop where u can buy "more health" lets say
imagine you have 1k currency but each health upgrade costs idk lets say 20
basically it would mean that u can spam it until u have no gold left
but the problem of spamming is that sometimes things get out of sync or gold was spent but server didnt actually buy the upgrades and stuff like that
so i was wondering how could I handle this type of situation when you are just able to spam the buy button
By doing the purchasing on the server.
Lol.
Client should never have control over how much "gold" or whatever it has.
yes but when I use "run on server events" Else they may fail coz its unrealiable and also I have no idea if it was successful or not, Else I make it reliable and it can overload the server making it unresponsive
this type of thing should be reliable, right?
hmm
yes but when I use "run on server events" Else they may fail coz its unrealiable and also I have no idea if it was successful or not, Else I make it reliable and it can overload the server making it unresponsive
@gritty pumice You can make it unreliable, and have the server update some RepNotified properties, and then the client updates its world state based on those RepNotify calls
That way you are guaranteed eventual consistency between server and client, and you avoid Reliable RPCs
but if it's unreliable, then there is a chance that the client request will not be processed by the server
like the player clicks the BUY button but the server doesn't get that
Yeah, but then the player would just press buy again
as far as I know ( I might be wrong), there is no problem in doing reliable RPC if it's one time things
If he wants guaranteed action he must make it reliable, but he's trying to avoid that so I gave him an alternative
i see
as long as you dont follow my previous mistakes of doing reliable multicast on tick, everything should be ok =p
๐
as far as I know ( I might be wrong), there is no problem in doing reliable RPC if it's one time things
@livid holly That's right, the only problem with Reliable RPCs is that you can end up overflowing the reliable buffer, and if that happens the client is immediately disconnected from the server. Normally you'd never face this unless you're doing reliable RPCs on tick, but I you never know..
i literally make my every one-time events reliable
hmmm i didnt know overflowing the reliable buffer would cause disconnect, good to know
I mean it's still good to be mindful of your rpcs uses throughout your code bases I guess, even when not using on tick or something
Yes, because that means the server will discard something the game considers a must-know event. That will lead to an inconsistent client representation of the world and there's no recovery from that to the eyes of UE4.
I see
one question... what about player input? Like a "move forward" event, that needs to go from client to server... is that best to be reliable or unreliable?
as far as i know you should totally make it unreliable
can anyone explain why casting the owner or instigator of a spawned object to a player character does not work
it works server side
well not really
one question... what about player input? Like a "move forward" event, that needs to go from client to server... is that best to be reliable or unreliable?
@livid holly Unreliable 99% of the cases. Move forward is likely to run every tick when holding that movement direction, and Reliable on Tick is always a sin and should be punished by the engine gods
thats only if i set the designated variable that i had before in the parent on begin play or construction
thats only if i set the designated variable that i had before in the parent on begin play or construction
@soft girder That probably means the owner has not replicated yet. If you try to read it after a few seconds does it still fail? (so that we can confirm replication delay is the issue)
kk
gimme a minute
i have alot going on tick in one weapon that im trying to fix. this all started when i went from a filp flop weapon switch to the following pic
where i use the select i cant set the variable that was instance editable
i tried just taking the owner and casting for each thing in the weapon blueprint but that doesnt work either
i tried to go back to the parent class and set the variable to the owner input then enable tick but i have lost functionality
the owner is the character
the spawn actor is inside the character blueprint
before i used the select this is what i done below to avoid a bunch of casts that dont seem to be working anyways
we wanted to let the players carry more than one gun. couldnt edit the defaults in an array variable of the parent class type. each weapon is a child of weapon parent.
weapon parent takes the instance editable zero owner which is a specific player character blueprint that we call functions from inside these weapon children.
im really stumped on this one
havent had a brick wall in a minute on replication issues
i have tried replacing the zero owner variables with pure and impure casts but no dice
i thought about making a handler actor that handles these requests to change to specific weapons so i could pass in that zero owner on spawn
wait
i may have a solution for this
what if i set it immediately after spawning the weapon
inside the character and pass in self by a variable called held weapon
Hi, for my multuplayer game I create a widget on event brgin play, this is working but it's also causing an error for every client, how can I solve it?
And what's the best way to attach and remove actors to Player?I've tryed using spawn actor and destroy actor, but sometimes the script won't do what is supposed to due to "is pending kill" error
use is valid
i guess this is not a good way to find random players?
if its pending kill most of the time its being destroyed
So I'm destroying and spawning Actors too fast?
that to
can you show me a pic
hang on let me show you an example
in here you see zero owner
if some one killed zero owner while the rest of the tick was going
it would fail and say pending kill
inside the character and pass in self by a variable called held weapon
@soft girder That was a roller coaster of emotions haha. Could you solve the issue or not?
so i check and make sure it is still valid
sort of
only one gun broken now
this is what i did to fix @floral crow
So the first runs don't have a valid owner but after some time it starts being valid. That's just normal replication delay
i tried delaying everything but only worked for server
its like the clients never got the actual owner
i think that may be the problem with beam rifle as well
The way to guarantee a member set by hand is replicated as part of the first bunch is to set it at spawn time. Make the ZeroOwner a param exposed on spawn and set it there
it is
Thank you, I needed it to switch and pick weapons on a multiplayer game, for switching them I definetly need to change approach@soft girder
i cant set it tho because im selecting by index
the purple hides the exposed var
im not sure if i can plug in on the left hand of the select tho
before it was a flipflop between two different spawn nodes which took self as zero owner
its like the clients never got the actual owner
@soft girder Well, the owner pin is disconnected on the image so...
ya
i have functions inside the zero owner i need to call from the weapon children. hopefully we get them all moved owner. for some reason the owner doesnt like to be casted to a zeroplayer
well the other weapon wasnt working because i set tick to disabled on parent when trying to get all of this working XD
lol
if at anytime on tick if the owner is not valid we destroy the weapon
i should really make sometype of pickup or just a handler. we planned on only ammo pickups
thanks for letting me vent tho. they have been waiting all morning to test all the new weapons and stuff
thanks guys
โค๏ธ
How does PlayerID in the PlayerState work? What sets it's value?
how do i travel to a new level in multiplayer
its called server traveling
i havent got to that yet
ive done it before
it wasnt too bad
has anyone succesfully made a homing projectile for multiplayer
I've tried doing server travel and the server travels but all clients just get frozen forever
last time we made a homing projectile we gave up projectile and used a character blueprint
i cant get the homing to work when a client fires the rocket
your going to have to use projectile component or use vehicle cpp to write your own
kk
the only one that can successfully set the homing target right now is server
i tried setting the target variable to repnotify but no dice
yea but only movement that replicates is character.
oh
and the projectile component
last time we faked it with character movement component. we had it move to the location that you were going to be so i was a little better in some regards
so far i cant get homing compoenent set to the target the client spawns
seems like a bit much to move somthing
ya
i havent seen any google searches where some one had an issue
its always something singleplayer
I would use the projectile movement then I would use an interpolate to get the arch of the the homing missile looking right
always interpolate till it reaches the moving target
when you get the code done let me know I need it to for our game ๐
this is how I'm trying to do a basic server travel but only the server will travel and all clients input stops working
its a listen server
@vale ermine the variable i was sending into the homing rocket was null from the client. the widget was client side only so it never had valid target from the client. i removed the the scene cap 2d valid check and it works now
gotta get the interp right but im just glad it homes now
that is good to hear. So your using projectile component? and interp from missile current movement rotation to target current movement rotation
for some reason in 4.25 server travel only works in standalone mode or executable builds and not in the editor unless you destroy and recreate the server
@slim matrix server travel works everywhere...
if i play 2 windows in the editor one a server one a client when the server travers the client just freezes and never responds but if i play in standalone mode it works fine maybe a bug
iirc server travel just doesn't work in PIE
the clients won't go with, doesn't matter which version you're on
Seamless ServerTravel doesn't work at all in PIE. Not even for the Server.
Normal ServerTravel should work. But usually you want to make sure it's seamless.
how do people make login system
all tutorial i see on youtube and on google require website
can't i just do it with just the dedicated server?
seamless travel works completely fine in pie if you launch the editor with -MultiprocessOSS which has no other side effects than making seamless travel work in pie
at least from my tests
on the topic of server level travel can i have 2 players be on different levels wile still being connected to each other and being able to see each other if in the same level like for example Minecraft overworld and nether or no mans sky solar systems
so could i do a LAN that runs multiple servers depending on if a players in that level or would it have to be a dedicated server
Hello, is there a way to set visibility of other players per player?
I found the only owner can see and everyone but owner can see but I need something more "per player" thing and if I try to hide it by local code, as my pawn is replicated it banishes everywhere ๐ฆ
so let say u making an mmorpg then you will have a huge level since UE server only run a single level
anyone get gamelift working for 2.5.3?
I got it to compile the client sdk but when i start up the project before it loads it goes through the files that failed to load. When the project loads the client sdk is enabled but I know there has to be some issue because what happens when the project starts up
If i disable the client sdk no errors when loading project
Found a workarround of my "only vissible to some player" thingy.
I used some C++ to expose HiddenActors from my APlayerController
anyone know much about replication, CMC and Skeletal mesh animations? ๐
the answer is going to be no cause i know a lot about it myself ๐
but for the life of me i can't work out what is causing this specific issue
Still running into your jump issue?
no
kinda can't really post it here though, NDA ๐
basically, a client in america, his animations are like choppy
even for me the host in europe
he sees his smooth
i see my own smooth, he sees mine smooth, but i see his choppy
isn't that just how CMC has always worked?
by default, animations for remote characters on the listen server are only ticked on receiving a network update
right but its disgusting
you can disable the part where it sets up the manual tick pose if you don't need anims for gameplay purposes
reading positions of bones for things like positioning weapons or whatever
anything where it would matter if the animation is de-sync
oh our weapons fire from the player forward just the muzzle flash/projectile comes out of the gun
i don't think we do anything that relies on the bones
thats autonomous tick right?
I don't quite remember the exact location
would be under simulatedtick right? for client on host also?
// (Or Simulating Root Motion for remote clients)```
you'll also need to get rid of TickCharacterPose
if (RTS->GetRemoteRole() == ROLE_AutonomousProxy)
{
Hero->SetAutonomousProxy(true);
HeroController->SetAutonomousProxy(true);
Hero->GetMesh()->bOnlyAllowAutonomousTickPose = true;
}```
if you use root motion this will probably break it hard
yeah that would cause issues..
there's likely no way to make root motion work right then since it introduced a dependency between animation and movement which will de-sync
it is really bad, like i have never known anything like it
how does dedicated servers work around it?
cause surely that would still require clients to send updates?
dedicated server would look exactly the same if it was rendering
connected clients just interpolate everything, it doesn't matter too much if they're a bit out of sync
urgh, that sucks :/
If you have a lobby level, where you need to press a play button to transition all players to the gameplay level. And in between the transition, the server needs to determine the roles of each client.
How should this be done ?
Where do you store this data ? The server's game instance ? How do you specifically talk to the server's game instance ?
Will making this "reliable" hurts my bandwith usage? This is one-time event but the other node is ticking
Is Firebase Database good for backend in unreal engine 4? or Suggest me one..
Can someone explain whats going on here? and why i am unable to join my level thats hosted by a dedicated server?
On the other hand if I host the level as a listen server from my local pc, I join the level without any issues
anyone know why? Builds Successful then this when loading project. 4.25.3
@vale ermine as the msg suggests (and as stupid this may sound), do you have aws sdk install?
no i do not. I am trying to figure that part out.
so i am guessing there are 3 parts here server sdk client sdk and aws sdk
I thought I only needed the server and client sdk
https://aws.amazon.com/blogs/gametech/how-to-build-and-integrate-the-aws-sdk-for-c-games-on-windows/
Join us on May 20, 2020 at 9 am PT / 5 pm UTC+1 for AWS Game Tech: The Digital Download for the latest in game development. Register for free now ยป Following on from our first post โGame developerโs guide to setting up the AWS SDKโ, weโre now going to show you how to [โฆ]
is that what I should follow?
I finished with the server then I added the client and i get that message
the only other file i am seeing is the aws sdk that i have no clue how to add
looks like its adding the libs now
what was the issue
well when i tried to run the cmd command msbuild INSTALL.vcxproj I was getting errors
seems i needed msbuild INSTALL.vcxproj /p:Configuration=Release
next step will be how i added it after its done.
At this point youโll have the libraries build in to locations like this:
AWSSDK\aws-sdk-cpp-master\aws-cpp-sdk-core\Release\aws-cpp-sdk-core.lib
The include directories will look like:
AWSSDK\aws-sdk-cpp-master\aws-cpp-sdk-core\include
once i get this i am going to do it over and over till i never forget it haha. Between getting all my environment variables set for windows, hunting down sdks and reading old tutorials and fixing all source errors. It has been rough.
๐ dealing with networks is ... hard
well i can see it is timing out. is it because of null pointer?
connection was accepted
I take it msbuild runs on a single thread
ok it finished building now what should i do ๐
@zinc owl firebase? I'm going to go with "no" because it's nosql ๐
ok so aws libs are now built. how would i add them to my project so that I dont get the error that the modules are missing and the client sdk fails to load
I do not understand how to add the built aws cpp core libs to my project source. They are ready to go I just do not know how to add them.
well i can see it is timing out. is it because of null pointer?
@vale ermine you are talking about my problem?
is handling an attack reset state from a montage on a dedicated server a good approach or should it be called locally and then sent to the server?
@worthy knot Not sure of your problem, but one unrelated suggestion is to definitely up your client's limited speed. I ran into a wall of problems with the default 10k
for initial connection?
It was an unrelated suggestion. Not sure what his connection error is.
@kindred widget but every client's netspeed is 10k by default right? any way to increase it?
I am having trouble replicating things from client to server
I am trying to get a multiplayer client/server to simply spawn the items when placed
it works from client to server to client, but not back again
Is this actor client owned ?
not sure what that means ๐ its just placed in the character blueprint
Client-to-server RPC calls (methods marked as running on server) only work when called from an actor that the player controller on that client owns
For Character, that means the pawn is possessed at the time
so the actor needs to be owned by the server?
By the client.
If this is your problem, the client will see a log line in the output log window about a missing owning connection
I dont seem to have that problem
I get no errors or logs
hmm I wish there was a simpler way to explain
Is there any way to smoothly segue all my players into a new level in multiplayer game? Open Level seems to disconnect everyone
Should I use Server Travel?
That + seamless travel
@bitter oriole maybe I can show you?
What you should do is add some logs and see if that "ask server to..." function is correctly called.
the location, rotation and model name is all replicating
just the actual placement is not
So... Is the spawned actor replicated ?
I dont need it to be replicated because the function that makes it is replcating
I am passing the coordinates and then I want it to create it itself
And where in the graph is that log you added ?
This won't work on client, what should I do?
This won't work on client, what should I do?
@twin juniper if you want to hide it does the checkbox need to be off?
I have a longer function to show an hidden actor and this to hide it, basically they do the same thing, but they won't hide/show actors from client side
@worthy knot There is an edit to the project's Default Engine INI you can make pretty easily. I just set mine at 1 Mb/s
ConfiguredInternetSpeed=1000000
ConfiguredLanSpeed=1000000
[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=1000000
MaxInternetClientRate=1000000```
@kindred widget Will this eat more bandwidth? what are the pros and cons?
It will if you program it to. All this does is 'allow' you to send that much. What you send is still up to your coding.
and whats the benifit of this? less latency when playing?
The engine by default just stops all traffic beyond those numbers for a time. For example, before I set those, I was having a problem where my initial burst of data required froze the client's download for five seconds. The data went through, but it was about 50,000 bits give or take. So the engine didn't allow any further data to be received for about five seconds so that it could maintain the 10,000 per second limit. In real world scenarios, I doubt you want a full 1Mb/s, but for testing and developing, it doesn't really matter.
The limit determines when the connection is considered "saturated"
Replication Graph seems to be better at prioritising data, for whatever reason. Cue the worst test ever made:
https://www.youtube.com/watch?v=ggnSFNJaH4Y
I really need to look into Replication Graph stuff to test on one of my projects. Been learning a lot of other stuff lately, but it'd probably help a ton on that particular project.
Hello yall, I can't get Launch Character to replicate.
It looks like server and client is fighting
I don't know about the Launch, but Jump is automatically replicated. You probably only want to call that on the owning client.
You should launch on the client and server only. Nowhere else
Is it possible to do ServerTravels in BP?
it is
How?
And don't tell me to use a console command
@winged badger ServerTravel in blueprints is crashing/causing my blueprints to get corrupted
its literally use console command and enable seamless travel on departing gamemode
its not the server travel thats crashing you, its likely insufficient cleanup prior to travel
corrupting blueprints is rare if you don't have c++ in the project with hot reload enabled
so no idea how that happens, unless you're using it in editor and have some buggy code that is editing assets at runtime
Well,
I removed the pins that called the console command ServerTravel MapName and then my UE4 stopped getting stuck at 75% while starting project
So I guess that was the problem child
does this mean I have to write it in C++?
Blueprint ServerTravel just calls the C++ version, it's not corrupting anything
stuck at 75% doesn't have to be corrupted BP
either
again, easier to break it with c++ you just need to use ConstructorHelpers thats referencing an asset that has a reference back to blueprint inheriting from the class using ConstructorHelpers
and editor will never start
so while its harder to do in BP, do not discount circular loading issue
I don't think we're editing any assets at runtime
So did I miss a step? How do I add aws sdk libs to my project
@near bison who mentioned editing assets at runtime?
Any ideas why it dont replecate my destroy coin? It sets the right object reference but dont destroy it. (replicates only on server and not on client)
Hi guys, I have a question about seamless travel. When i create a session do I have to use Open Level after it or is there a way to use ServerTravel? I tried using ServerTravel but I can't connect players to the server after that, is there some setting or it can't be done?
I also tried with servertravel MapName?listen but it doesn't word
I tried calling an event on the player control that is executed on server, for the connected player it is working but afterwards I can't connect another one
are you testing in editor?
if so then seamless doesn't work
and you can't seamless with a session
iirc
ie when you create a sessioon
I'm running a host on my local machine (via commandline ue4.editor -game -log) and then when I launch another instance to join it, I get a black screen (ue4.editor -game -log)
I'm on windows 7 but the commandline doesn't show any logs
I tried using my router ip, 127.0.0.1, 0.0.0.0, localhost and ipv4 address from running ipconfig
are you testing in editor?
@meager spade I tested it in standalone and with 2 computers
So it seems that it's absolutely necessary to use openlevel
okay now the client joining map loads
however I cannot see the other player
"E:/UE_4.25/Engine/Binaries/Win64/UE4Editor.exe" "C:/Users/me/Documents/Unreal Projects/Lesson1/Lesson1.uproject" "C:/Users/me/Documents/Unreal Projects/Lesson1/Content/ThirdPersonBP/Maps/ThirdPersonExampleMap" 192.1.1.1 -game -log -windowed -resx=1028 -resy=768
also I am not seeing any log outputs here
strange I can only see the logs when I use Powershell not Git bash
how do i add aws libs to my project? I have server and client done just missing aws-cpp-core
okay I am getting connection time out
& "E:\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe" "C:\Users\me\Documents\Unreal Projects\Lesson1\Lesson1.uproject" 192.1.1.1 -game -log -windowed -resx=1028 -resy=768
what could be blocking this I turned off antivirus too
does beginplay in level blueprint start, when the server start? or when a player joins the level? in multiplayer
https://aws.amazon.com/blogs/gametech/how-to-build-and-integrate-the-aws-sdk-for-c-games-on-windows/
Join us on May 20, 2020 at 9 am PT / 5 pm UTC+1 for AWS Game Tech: The Digital Download for the latest in game development. Register for free now ยป Following on from our first post โGame developerโs guide to setting up the AWS SDKโ, weโre now going to show you how to [โฆ]
im stuck at Adding the AWS C++ SDK in to your game
when I run listen server, netstat does not show any UDP ports for 7777
I guess this means the server is not running??? whats going on
god.....wth
Replication Graph seems to be better at prioritising data, for whatever reason. Cue the worst test ever made:
https://www.youtube.com/watch?v=ggnSFNJaH4Y
@chrome bay wait how the hell does he fix this? This is exactly the issue I'm having with shooting projectiles into the air as a client and they stop spawning after a while. Is this a 4.26 will fix it update?
It's my vid from 4.24 or 4.23 or something
Oh lol nice. How did you end up fixing that issue?
Well just switching to replication graph helps, somehow. Then completely nuking network updates for the projectiles
The default update rate for actors is 100hz, which is ridiculous
Most don't even need it at 1hz
Ooooh ok
I'll have to do some research on a replication graph
Thanks for the info!
I have an OnRep function that is not getting called even though I am changing the value associated with it.
SetCurrentWeapon is being ran on server.
Any ideas why it would not be called in this situation?
@slender yarrow have you added it to lifetime replicated props?
string GameLiftLibFile = System.IO.Path.Combine(ThirdPartyPath, "aws-cpp-sdk-gamelift.lib")
would that be the location of were i should place the lib file generated when doing msbuild install for the aws sdk?
Can you show? Also try removing transient if it's there
Try removing transient and if that doesn't work I'd try repalways condition on that just to test
transient is fine
it just means it wont be serialized in BP
i use transient for my currentweapon pointer just gine
fine*
I had had issues with it before that's the only reason I wanted to try it. Everything else looks fine to me though
is the weapon replicated?
is the client also setting the same weapon pointer?
OnRep won't fire if client has the same value
no only set on server. And the value is techincally null before i set it i think
this always works for me ๐
like i said
never would have thought of that
was your weapon replicated?
no

If I delete and reinstall Advanced Sessions in a preexisting project (like the code is already in use) would that cause a major problem?
I'm having a problem replicating player movement w/ a listen server
In this setup I'm having the player controllers call Add Movement Input on their pawns
In the pawn's blueprint, after a is locally controlled check, Apply Movement Input gets called either directly if the server, or through a Run On Server RPC called Server_Apply Movement Input if remote
Inside Apply Movement Input, I print the incoming axis values as a debug check, and then use Add Input Vector with authority to apply the actual movement
When this happens, the debug check shows that only the server is trying to call Add Input Vector and the axis values are being passed correctly - however no movement happens (except when the listen-server adds input to their controller, then it is replicated correctly to the client)
Could anyone take a look at this or point me in the right direction?
This is PIE after applying right input to the listen-server (left window, "Server: 0.0, 1.0") and up input to the client (right window, "Server: 1.0, 0.0")
In this example the rightward movement of the listen-server's character was correctly replicated, but the client's input had no effect in either window
(the players are the white squares, not the vehicles)
I have a feeling this is a problem w/ ownership but I can't find the fix
(Also I had Apply Movement Input set to replicate erroneously in that screenshot, I've removed replication from it with no changes)
whats a good service to host your dedicated server for a game? and how much do they usually charge?
are you capable?
I like to think so
lmao
trying to do it on an oculus quest is a pain in the ass though
@molten jasper
you can look into Microsoft's PlayFab, Amazon (I think) GameLift, and then there's another one I forget
I am trying to make my own project
and I have been looking for someone who can do multiplayer
@agile lotus I think you can have two different subsystems if that's what you mean, and just use the one you want depending on a GetPlatform call or equivalent
I haven't tried any of this but that's how I think it'd work
is it session based?
like you have someone host a server
and people join him
similar to among us?
@twin juniper #looking-for-talent
i can but i'm very busy at the moment. but you can check out this tutorial playlist https://www.youtube.com/watch?v=abmzWUWxy1U&list=PLZlv_N0_O1gYqSlbGQVKsRg6fpxWndZqZ
In this video we take a look at the finished project and step through each of the features that will be covered in this series. We show our functional Main Menu and its options, a lobby where players can chat with one another and select their characters for the game, some serv...
I am just asking questions
@molten jasper well can you contact me again when you are less busy
it teaches you how to build a lobby and start sessions from nothing and also host it on steam
@proper ravine the issue is that I can't seem to get listen servers working on oculus quest devices
@winged badger btw in #looking-for-talent are the people there looking for people or like what?
well I have 0 experience with VR if it's specific to OCQuest that sounds like a pain in the fucking ass
IT IS lmao
@twin juniper they would be looking-for-talent yes
they are, instructions on how to use the channel are pinned there
no like I meant
they are looking to hire people
blue very sus
are the people posting the jobs up for hire or are they looking for others?
if you want people to help you, you can look in looking-for-work and contact specific people, or you can post in looking-for-talent yourself and have them contact you
afaik
you have to DM the bot
check the pins, best bet
just be aware you'll likely have to fork some cash
So anyway asking again,
Is there any reason a client can't add input when the call trace is going from (Client) Input Axis Event -> (Server) Server_Custom Event -> Add Input Vector
the numbers are getting there, but calling Add Input Vector doesn't do anything for either the client or the server
hey guys it seems like I am unable to start a listen server like this "E:/UE_4.25/Engine/Binaries/Win64/UE4Editor.exe" "C:/Users/me/Documents/Unreal Projects/Lesson1/Lesson1.uproject" "/Game/Maps/Lobby?listen" -game -log -windowed -resx=1028 -resy=768
well, depends on the skill, i imagine one can find a junior just looking for the experience
when I check the netstat for UDP connections I don't see 7777 port open
I'm looking for a way to get if certain players are dead or alive (variable). Players are currently using the same character blueprint. Thanks
That's very open ended
How do you know they're dead in the first place?
If it's just a variable that's being set elsewhere, make sure it's being set on the server. Then set that variable to replicate
Is it better to handle multiplayer/replication in C++ or blueprints?
@proper ravine So would it be possible to get the value of a variable from a certain client. So per say their are 10 players, and I want to get the value of a variable of Player 1, how would I do that?
what is player 1 in this context? what does the "client" refer to?
re client: is it the pawn? the controller? the player state?
@lost inlet Like player 1 would be one of the players in the game. And I am mean the pawn
well i think you have to be more specific than that, if it's literally any player then maybe you need something in the game state to set the "it" player
Maybe think of it like among us. There are a set amount of people playing, person is dead and it displays it on the voting ui. I'm wondering how I could get what people are dead. Maybe that helps?
getting all player pawns is fairly easy
GameState-PlayerArray->Foreach->GetPawn->Cast->bIsDead
would be the simplest way to brute force it
does a replicated variable need to be updated with in a server function? and if so does it need to be multicast after?
@winged badger Thanks, I'll try it out now.
right now I have to set my character's rotation in a multicast function called by the server
thats assuming bIsDead is replicated/network synced in some way
replicated variable just replicates
no need to MC it
well if I don't the client that adjusts the rotation and the server get it but all other clients don't
oh nevermind
it's because I shoot from my camera's rotation and that is not being updated, only the rotation
(variable)
@winged badger would have any idea how to solve this? This occurs during the transition from main menu to map load. I am using sessions. Other than the obvious message saying "Spent to much time waiting for FinishDestroy for 85 object(s)", I dont know where to start debugging. I've had a whole week of unusual crash reports appearing and i finally have a narrowed it down to this consistent error message. Any help would be appreciated
did you do something unspeakable?
multithread locks, TSharedPtr to UObject, something like that?
because it seems something is preventing your VoxelRenderingSubComponents from getting cleaned up
it can be something just casual, like overriding any of the functions that have Destroy in their name or EndPlay and not calling Super
thank you, i will have a look and get back
for the casual bit, it can be an Actor that has the component, it doesn't have to be component itself @verbal gust
as EndPlay/Destroy are routed through the Actor
This question is more meant to be in #blueprint, but does anybody know how I would get another players view? Trying to make a spectator system. Looked it up for hours and nothing has come up. ๐
GameState->PlayerArray->Foreach->GetPawn->Cast->GetView
@leaden crag
That's quoted from above to get a player object from the game state
I adjusted it to basically try and get what you want, but I'm not entirely sure what you even mean by getting the view but that should at least help you a little I would hope
Sorry I should have elaborated
I meant get the players camera, so that while spectating its a first person view of what that player see's
Ive noticed theres a "Set view target with blend" node which looks like it could work
Ill give it a read, Thank you for the help Xero!
I have a question of my own now. I know that calling an RPC on tick is going to kill the network, but say I have a hand that I wave around and need to replicate its position quite frequently to give a smooth movement effect to all other players. What's the best way to do this or should I just keep it in tick and make it unreliable?
I know I could also kick off a timer from begin play but that seems like not best practice.
I hate to keeping tagging you @winged badger but I feel like this is something you have come across before and know.
VR?
Yessir
yeah, you have to RPC it on Tick
Make it unreliable then?
Reliable RPC on Tick doesn't make any sense, if you think about it
Reliable = gets resent if it fails
Yea it complete biffs the character too. Ok.
but if you're sending in on TIck
a newer RPC will arrive on Server before Client finds out it needs to resend the old one
Just wanted to make sure I wasn't missing something. Unreliable worked but I like to be squeaky clean if I can lol. Ok that makes sense. Thanks man.
Where should I store my lobby settings? For example difficulty of game
I need to cast & get this settings from custom actors
How can I spawn different pawns for players in multiplayer. For example, 5 people get PawnA and one person plays as PawnB? Thanks
override AGameModeBase::SpawnDefaultPawnAtTransform_Implementation?
actually, AGameModeBase::GetDefaultPawnClassForController_Implementation
that event is also exposed to blueprint if that's what you're using idk
I'm using blueprints
Hey, I'm having trouble getting FloatPawnMovement to replicate. I am calling Add Input Vector behind a check for authority, but the client cannot move their player. The numbers are getting to the right spots, but any call to Add Input Vector involving the client's player does not do anything. The listen-server's character moves around fine
Replicating this is going to take quite a lot of work
It's simply not multiplayer capable at the moment
None of the movement components are MP capable except Character
So you need to write your own
That's what I was thinking, but concluded that if that were the case it would have ended up in the documentation somewhere. It's insane that it's not.
Thank you! I can write my own, just wanted to use the built-in method if it was there
Not much in the engine defaults to multiplayer support so you can assume it's not there
Usually there isn't a box for "replicate x" either but, there's a box for "replicate movement" that doesn't qualify "replicate (character) movement (component only)"
I get what you mean though
"Replicate movement" should almost never be used
lol i love it
It's pointless, it doesn't do any interpolation and will teleport client-driven objects back in time
What does it do then?
Replicates the object transform and teleport clients there
It's only useful for unmovable objects spawned at a random location on server
Despite the name it will never show actual smooth movement
At best, a fast series of teleportations
That'd be changes made to the transform on the server replicating down to the clients, right?
Honestly that'd be fine for what I'm doing right now, it'd be nice to have some smoothing but it's not actually required
The client can't even affect their pawn's transform on the server, though. The updates do nothing for either computer
I'll just rewrite the whole thing anyway though, would need to eventually
Changes made to the transform on the server will replicate, eventually, at a random rate
Maybe once per second
If the client is driving transform, then it will replicate with the transform that was valid on client in the past, one ping ago
Basically back in time
So for a multiplayer movement driven by clients, you need
- client sending "moves" to server and simulating them locally
- server simulating moves and replicating the resulting transform & velocity
- driving client rolls back to the new server state and replays stored moves more recent than the server's last replication
- other clients interpolate between replications
Thanks for the run down, I'll get started working on a custom implementation tyty
I always wanted to try writing my own movement component sometime, just out of general curiosity and practice.
This one should be pretty easy, I'm just trying to pan the camera around. Hopefully I learn a bit because I'm otherwise not super excited that I have to implement this myself
How come your camera view needs replicated?
I probably need to release that MP floating pawn movement component some day
Any ideas why it dont replecate my destroy coin? It sets the right object reference but dont destroy it. (replicates only on server and not on client)
@warm leaf Any ideas? Sorry, but i absolutly dont know what to do else I testet about 5 hours. And it should work.
I probably need to release that MP floating pawn movement component some day
something like that exists?
The one I have written does
Im pretty sure so much people would put interest on that if you put it on marketplace
Yeah, I know
But I'd need to move it out of the project, maintain it, support it etc
You can consider putting extra price for support & maintaning i guess, since no asset can be a valid rival for that ๐
Maybe even Epic supports/buy it
I'm replicating the camera just because it's kinda important to the game I'm prototyping. Each player can see everyone else's view at the same time but only controls their own
Something like "A Way Out"?
yeah actually, looking at the trailer
except it's a hybrid-rts and I'm using this method for dynamically splitting the screen
https://youtu.be/tu-Qe66AvtY?t=1814
In this 2016 GDC session, SMU Guildhall's Squirrel Eiserloh explores the math behind a variety of camera behaviors including framing techniques, types and characteristics of smoothed motion, camera shake, and dynamic split-screen.
Register for GDC: http://ubm.io/2gk5KTU
Join...
i've asked the devs of a way out for tips about that camera view replication and controller setup, they told me they will send me a DM but never did ๐
they use ue4 too, as far as i know they have edited the current components or created new for their own setup (not talking about cam-view)
Ascent Combat Framework has a replicated Camera Manager that could probably pull it off if it doesn't already support something like that out of the box
But ACF is fairly expensive
I grabbed it back when it was on sale for like $250 for a different game. It's been nice, definitely saves a lot of time
How can I force all clients & server simulate physics locally?
@peak sentinel are you having issues with physics syncing ?
i dont want them to sync actually
i wanted every client handle the simulation in their own local
so they dont replicate & send data to others
well you know what happens with physics , in client 1 the physics actor can be on the left, in client 2 it will show that the physics actor is actrually left and a bit forward or backward
yes
Yeah so how do you plan on handling that?
i have too much pawns in game also its kinda co-op so it wont* affect the gameplay
its just ragdoll when zombies are dead
same case here
but you want them to sync?
it would be much appreciated if they did haha
thats it?
didnt tested at all but just deleted randomly and it was that
then added it back lol since i dont want them to sync
oh wait
one more layer to add
just ignore the comment and set replicated node
set simulate should not be multicasted?
i guess no
i just killed 7 or 8 zombies and they were syncing, let me test it more and come back to you
wait a sec
yeah show me screenshots
this is from last screenshot
clients not replicated properly
this is with multicast
but server and multicast events not "reliable"
so it sometimes sync, sometimes not
now i will try with reliable
so with reliable & multicast client replicate & sync very well
but when server executes it, it doesnt replicate & sync
maybe you can try to remove "switch has authority"
Yeah see the position is different
im pretty sure its about switch has authority because client replicate each other well
lol no luck with switch h. a. too
hey wait
it works now
show me, but with a little upclose
their falling positions are same but when they fly they dont fall back lol
my bad sorry
ragdoll position is diff
Build powerful visual scripts without code.
have you read this?
most of the comments say it is not wise to replicate skeletal mesh physics
As far as i know even AAA titles was not replicating it, just been trying to help you but i guess you should be in knowledge of what we are trying to do is not wise ๐
Battlefield fakes ragdoll
But its kinda advanced/complex to do
fakes ragdoll? XD
You can get semi okay results by just replicating a couple of bones. Not perfect, but it's a decent tradeoff as far as replication/semi accurate. But yeah, most of the time that stuff isn't replicated. That's why games with a lot of connections conveniently use things like loot boxes(Apex Legends). It's much easier to destroy the mesh and replicate a single object's location.
If UE5 can have nanite to eliminate graphical optimization forever, it should surely be able to replicate physics actors too
I mean im just saying
@worthy knot what do you want to achieve ? sync the ragdol locations ?
I guess just using IK & supervised animations (get where you shot * falling vector etc.) then transform to dying anim instantly
thats what i observe from bf v & bf1
@tawny mason Not just ragdoll, but any kind of physics, physics forces, everything related to physics movement of actors
Nanite relies on the level of technology available to it. Replication has to rely on potentially bad network technology. Not really a fair comparison.
@kindred widget Yeah but something like nanite is a major breakthrough, something that nobody knew would be possible
Im saying the same thing can happen for syncing of physics
yeah, that is not the usual way of handling it, you normaly replicate locations and rotations, or in the case of the cmc individual moves. If you want to make sure forces are applied in a specific order, you might want to locally simulate and correct if wrong. I'm not aware of a integrated way to do that.
some "breakthrough"
have you played rocket league?
they have faked the ball physics
its not simulation enabled actually
they get the latest hit * forward vector
then apply impulse for somewhat movement
if they have enabled simulation they couldnt pay for server prices ๐
impulse is physics
i believe its just same as "launch character" code, just enabled hit simulations / bouncing etc.
in the end it is sharing same idea of battlefield, just without animations
maybe you can try same too
get where zombies shot, get where they should fall of, play animation with IK then simulate minor physics
even replicate them if you can (server bandwith & prices)
i believe mesh transform is not important, what important is capsule transform when you do this
get where zombies shot, get where they should fall of, play animation with IK then simulate minor physics
not gonna lie, it would be funny if my vehicle explodes and its door is on the left side in my screen, and I see my friend pointing to the invisible thing on the right and saying "hey bro look im standing on the car door" and ill be like "what? what door? are you drunk fam?"
๐คฃ
yeah that would be funny ๐
not FPS at all but ping & server usage
the more you fill your bandwith the more you have to pay for server prices if you are using dedicated
well amazon gives a great opportunity to scale your server usage & price but replicating physics? even if most/all(?)* AAA titles cant do that so if you can accomplish it you can really advertise your game very well
hmm I wonder how rockstar's server handles their physics sync
FiveM cant, dont know about online mode
FiveM cant even replicate idle animation properly
Maybe Online mode (official mode of rockstar) can, dont know
FiveM is community servers of GTA V
%99 of that is roleplaying servers
but rockstar has their own engine and has a different server setup i guess.. because you only have 8-12 clients in a server and its only relevant if you are close to them
no, now you have upto 30+ players
rdr2 has new technology instead of gta v so if rdr2 can replicate bones and ragdoll ue5 can too *i guess
but the ragdoll and vehicle physics are all synced in gta online
I play it almost everyday
even the vehicle parts when they break off
well no idea how rockstar handles it, but they have their senior team work 100 hours a week
๐
my name should be idontunderstandblueprintsijustpretend
thats the only way to avoid "learn cpp/blueprints first" quotes
Yeah for sure
Physics replication could work as soon as 4.26
If Chaos works well enough and actually is deterministic to a larger extent than PhysX
UE5 will be basically 4.27, so it won't change much
as soon as 4.26? fr?
That's when Chaos is coming
So you now have, supposedly, access to more reliable determinism to build your multiplayer systems
oh in that case it shouldnt be just for chaos, but for every sort of physics actor, that uses Torque or Impulse or AddForce
Chaos is a solver, so everything physics is using it now
Oh and when is 4.26 coming out?
It's a preview, so in a month or so
Two if you count the inevitable hotfix to get it working well
So Chaos is more optimized, improved and next-gen, right?
It's a lot more subtle than that
It's designed to be more optimized, so that developers can use physics at a larger scale, yes
"Improved" is debatable since it's currently broken as hell
lol
"Next-gen" is purely an opinion / marketing
Currently UE4 has terrible physics
Chaos would bring it to a good level, but it's hard to say if it's more "next gen" that what Battlefield did years ago
never interested in physics so far but... its not "that terrible" i guess?
i mean you can destruct every single mesh properly
Well, could you re-create Half-Life 2 multiplayer (2004) with UE4 ?
The answer is probably no
they are as far as i know
Project: Borealis
when even have a physics only weather system
and they claim its not even affect CPU at all
The main limitation of UE4 physics is that they are almost impossible to replicate in multiplayer
physics are better in unreal than source, wtf you talking about.
lol
at least in unreal the client collides with the server-side stuff
So try implementing a purely physics-based gun in UE4, in a deathmatch game, and see how that goes.
In this developer update, Dan Toลกkan provides an overview of the wind and air drag systems we're developing for Project Borealis.
You can find further details in the accompanying paper: https://www.projectborealis.com/wind-and-air-drag-system
Check out our team openings: htt...
the whole reason there is mega jitter in hl2 when you stand on a crate for example, in mp
is because pmove doesn't collide
so client prediction thinks it's not even there
all physics prop interaction is done with a "shadow"
that updates only on server-side
basically two movement systems combined
But at least it's working and you can shoot someone with physics objects, from a client, without needing the server to blindly replay the prop's trajectory
true, cuz the server does all of it
like when you pickup stuff with the gravity gun
or with the player pickup controller, it's all server side
But the client does it too, with the same trajectory, because it's deterministic
it's not deterministic in source at all.
So how does the client get the same trajectory when firing, before the server even received the firing event?
So you have 200ms before you see yourself firing on the client ?
Firing props with the grav gun in MP.
So you're saying when firing with the grav gun, you only see the firing a full ping later ? Because that's not how I remember it.
well considering i'm the one that fixed all the multiplayer stuff for the sdk
Consider my praise of Source rescinded, then
lol
In any case, it's still ridiculous that UE4 can't have vagueley deterministic physics
is Chaos a plugin or gonna be built-in function?
Builtin
You're not magically getting networked physics though
That'll always need a lot of project knowledge to replicate properly
i have some basics for that and i hope it will work with chaos too
i mean it plays the animation and shit, but the actual object you're carrying is followed on the server. and if your ping is high enough, it even lags.
here is server side; where it does all of the physics grabbing stuff:
https://github.com/tonysergi/source-sdk-2013/blob/master/mp/src/game/server/hl2/weapon_physcannon.cpp
and client, which just updates particle effects:
https://github.com/tonysergi/source-sdk-2013/blob/master/mp/src/game/client/hl2/c_weapon_physcannon.cpp
and yes, the naming is funny. "gravity gun" internally was the weapon with the beam, and "phys cannon" is the release "gravity gun"
Nice
a longass time ago, jay stelly was wroking on deterministic stuff, and he gave up
Nothing easy about it
there was a Halo GDC talk i think
where they described how they cheated their ragdoll
i am just watching it, they say they never use "realible" functions
Lol why would anyone wanna even cheat such a basic thing
even though its a way to get the job done lol
this is from Halo Reach
with ragdoll replication these values would be much higher i guess
Ragdolls are considered basic now ?
Yeah ragdolls are a very basic thing in games
Wait.. Reach doesnt use dedicated servers?
Thats an example of courage for a game like that
I love it when you get a GDC talk about it and somehow decide it's a basic thing
I wonder why people shelled out the four digits pass to GDC
they've been around since a long time
Does that make it easy ?
executing a ragdoll event and setting collision is easy but making it good is hard i guess
well i didnt go into the details of how ragdolls should behave and their physics properties, but the concept has been around in games for decades
"Using the built-in engine features is easy"
Ragdolls aren't basic. That's an implementation decision. Even Apex doesn't really have them.
well i am pretty sure making a gta iv ragdoll is ultra-hard
I didnt talk about making it from scratch
Anyway, I'm out of the armchair engineering, have fun.
but if you are ok with fleeing pawns over the map yeah ragdoll is easy ๐
the ragdoll feature has been common in game engines
Whether or not they're easy to implement isn't the question, it's whether you want to on your game.
lol learning new things everyday hahah
It's just like any other system, it has it's neat advantages, but it also comes at a price.
how to get multiplayer in blueprint project without investing any money
@modern ginkgo It already is.
wym
Networking. You don't need to buy anything to do multiplayer in blueprints.
Oh, just caught the conversation in Blueprints. You can release a multiplayer game with nothing but blueprints, but it's going to be a bit difficult to optimize. You're also pretty much stuck with a listenserver setup with no desire to touch C++. So as long as you don't mind slower systems and running it as a listenserver, it's fine.
Hy all, I'm calling SetAutonomousProxy(true) on server in hopes of swithcing role of the pawn on a client to autonomousproxy, but It's still SimulatedProxy on the client that owns the pawn? What am I doing wrong?
Also fields that are replicated with condition COND_ReplayOrOwner are not replicated to the client, while the owner field on client points correctly to playercontroller. This network ownership drives me insane frankly.
Hey, is there a way to store information like the Lvl of a user and general progress without custom database and server structures in the Online Subsystem which would ideally work between multiple platforms like Steam and Epic Games etc? Maybe the Online User Interface or similar could be used for things like that? https://docs.unrealengine.com/en-US/Programming/Online/OnlineUserInterface/index.html
Overview of the Online User Interface.
something i discovered by accident
if you are using fast array replication
and Item struct override operator==()
you can actually pre add items on client
and they will be correctly updated when replicating
this of course require some kind of persistent unique ids to identify items
Read the doc, find some tutorials. Multiplayer is quite a lot of work.
Matchmaking stuff is somewhat independent and depends on your platform (Steam, mobile, console etc)
Hi all, I am using Gamelift of multiplayer, I have server and client packed. For every update/patch, I am building pak file and update on client once user launch game. Anyone know how i will patch dedicated server?
Anyone used PlayFab before? I have lots of questions ๐ฆ
hey, some times unreal dedicated multiplayer does not work on same network, or split screen monitor with two instances. did anyone notice that? have any solution?
Any reason why "Run on server" RPC (BP) doesn't work when called from client?
My RPC is defined in the game mode and a third person charcater ( client ) is trying to call it
But if a character who created the game (listen server) does the same, it works
GameMode doesn't exist on a client, and even if it did it wouldn't be owned by them
TL;DR: "Run On Server" RPC's in gamemode aren't possible
Any suggestion on how to implement this?
move the RPC elsewhere, to something you can call server RPC's on.
E.g the player controller, player state or a possessed pawn
Is there a command to visualize movement components inputs received by the server?
I'm using CharacterMovementComponent::bServerAcceptClientAuthoritativePosition to smoothen some movement the client does, but apparently no packets are sent during MOVE_None or MOVE_Custom?
Hello
I'm creating four playercontrollers for a local multiplayer, but can't get them to fire input events.
Uhh, I just explained the whole thing in #blueprint so now I'm thinking where to even start.
E.g the player controller, player state or a possessed pawn
@chrome bay Thanks!
So, I'm doing a menu for the game, where you select the character.
I can see the playercontrollers spawning in outliner when I play the game.
And in the controller I have simple Input F to print string, which doesn't fire.
I create four players, and I suppose the game spawns the default pawns for them since I have that setup and default pawn class
And I have the controller setup as default controller.
But can't get this to fire. Otherwise, I can control the menu with UI input. Any help would be appreciated.
Ok, it was the UI input only
Cool, now I know that
I still can't get input from second gamepad tho
I can't get this variable to be valid when the function is called from a client, what should I do?
Is BP_Pickup replicated, and a valid object created on the server ?
It has to be created on server to be valid?because it's a variabile from an actor that I spawn from each player...
I've lost 2 days like a stupid...
@bitter oriole Thank you
It has to be replicated for this to work, and objects only replicate when server-created
Heeeeey, guys would can be the reason for fields of replicated components set to COND_OwnerOnly (fields without condition replicate alright) not replicating to owner, whereas field with the same condition on actor itself does replicate without issue.
Is storing an inventory in the player state good to replicate it?
replicating to all other players ? I think its not a good idea. just send it to owner
@steel fox its not a bad place, especially if you want the inventory to survive disconnect + reconnect
a component on it is probably better then PlayerState actor itself
@winged badger thanks
Anyone here used Playfab before? I have a few questions
it can be something just casual, like overriding any of the functions that have Destroy in their name or EndPlay and not calling Super
@winged badger so it seems like its caused on after open level when it is trying to destroy the main menu level actors. As a test, I tried spawning to the default Pawn and player controller but still the same.
if I wanted to tell all players that a skeletal mesh has changed, do I need to run a multicast function from the server?
multicast wouldn't be the best way to go about it
a replicated variable holding a skeletal mesh asset with OnRep is a better solution
multicast is affected by net relevancy, its ignored (completely missed by anyone not in relevant range)
variable replication on the other hand, is change in state and as such will catch up when it needs to
so I have my skeletalmeshcomponent, an array of weapons and an int storing which weapon is held
not so much ignored by, as not set to in the first place*
not SkeletalMeshComponent
SkeletalMesh
is what you need to replicate
a pointer to asset
so have a separate variable that is replicated for the skeletal mesh?
yes
and then just set it on the server?
and best put it in Pawn... replicating SkeletalMeshComponent can have... sideeffects
ok
ok so now the mesh does not change
if (Inventory[WeaponIndex])
{
SelectedWeapon = WeaponIndex;
WeaponMesh = Inventory[SelectedWeapon]->GunMesh->SkeletalMesh;
}```
I suppose I should replicate my selectedweapon
well that really doesn't show a lot
so my USkeletalMeshComponent's mesh is set to a replicated USkeletalMesh* that is set in a Server function
but when I change the USkeletalMesh* the mesh inside the component does not change, I can change the mesh in the actual function using SetSkeletalMesh but that only does it on the server and I was told NetMulticastwas a bad idea for this
so to clarify the USkeletalMeshComponent is set to the USkeletalMesh* in BeginPlay and the USkeletalMesh* gets changed in a server RPC
the property should be a OnRep
and in the OnRep, you call SetSkeletalMesh
@oblique inlet
Oh good thinking, Iโll do that
Thanks
And I can do the same thing with my pitch variable and not have to multicast
Can anyone that knows or has experience with multiplayer FPS, lay out to me the basic steps of shooting functionality and what should be on the client and server? Ive tried things myself and looked at manyyyy projects and how theyve done it and its only made me more confused. I am paranoid about running too many things on the server because my last attempt was a disaster once i started playing it on GameLift. Is the line trace for shooting on client or serv?
if you don't have client authority over the shots
your game will never feel responsive enough
server should just do some sanity checks to validate the shot
(one common hack is to have the enemies teleported forehead in front of your weapons' muzzle when you hit fire)
it doesn't change their position on server, but it does allow cheating client to report a killshot
that server can easily flag as false, as the hitlocation would be nowhere near the target that died in this case
Forehead in front?
yeah, it teleports you so that bullet hits you right between the eyes, point blank
no matter where the gun is actually aiming at
On the client side only?
Which player does it teleport the one firing or the target?
client side only, and target is teleported
I donโt really see how thatโs helpful
Wouldnโt you just hit them wherever you were aiming at?
What Iโm doing so far is giving client authority and then doing a double check on the server to make sure there is a straight line between the server and client
Itโs not perfect especially when it comes to shooting from cover but it stops the most blatant hacking
you should also do a check if the target and hit location are close to one another
True
ok so line trace on client. Well thats a start at least
@winged badger what do you mean the difference between c++ and blueprints isn't a small one? Is it just more performant/faster than bluepriny multiplayer (besides c++ being faster by default)
Is there documentation/tutorials for c++ multiplayer that isn't antiquated?
no, i mean BP has about 10% of network functionality
and some of it is just hacks
you can literally do zero optimizations and zero advanced stuff in BP
90% of engine's default OnRep callbacks don't get to BP
that sucks
only things you can do with BP is send a RPC, set variable to replicate and add a hacked OnRep callback to it
that is true, from what I saw of it.
in comparison
Is it a nightmare to do in C++ though? I did some C++ AI work some months ago and that was just nasty
once you get used to c++ its not too bad
we spawn a 30k Actor level procedurally, we spawn it on clients and server separately from the same seed, and make them network after the fact
we also have 2500 Actors replicating, but only 500 Actors that have replication turned on
all our Interactable Actors just find the nearest NetworkManager and replicate over it, and they aren't even evaluated for replication unless they mark themselves dirty
you can't even begin doing any of that in Blueprint
or bitpack boolean flags
I see
wow. I didn't know it was that useful for multiplayer. Can't say I'm surprised though.
How's the documentation for the C++ end?
Does this mean it doesnt work multiplayer?
i just learned 4.26 will have a replicated FloatingPawnMovement @echo snow
in BPs, is there a way to get ping or a precise comparison of time between client and server without sessions? i'd like to be able to test my code with the built in "dedicated server" option and Net PktLag
(while also implementing it in such a way that it would still work if client and server were on different systems, of course)
also what is the best way in general to get a very precise comparison of time / ping between client and server?
can anyone tell me how to see the client's version of the World Outliner when doing multiplayer PIE?
I only seem to be getting the server World Outliner and don't see an option to change it
are you playing in a separate process? it should be under view options in the outliner
I have a question regarding GameInstance.
I don't want variables in my GameInstance to be initialized on the main menu of my game.
Because, the GameInstance will have variables like numberOfRemainingPlayers etc. This information doesn't need to be stored when I'm in the menu screen
Any guidance?
Game instance just lives before your menu map is opened, so I'm not sure what you want here
ok I'll give you an example
think of a game like among us
why do I need to know the number of players, number of impostors etc on my lobby screen?
Isn't that required only in game?
If you don't think this is required in game instance, don't put them there I guess
But I do need that in the game instance, because one instance of my game is going to have players traveling across multiple levels
I have no idea what this means
ok example of Among Us again:
Among Us has a default level, and a voting level. To have game data persist across both levels, you'd want to use GameInstance
Am I making sense?
A bit, except game instance is not networked, so all of that data is 100% player-specific
Maybe you are looking for GameState, not sure tho
I think GameState fits the bill very well here, but I'm transitioning between levels ๐ฆ
Maybe I should try to incorporate the second level in the first one? idk
Maybe you can cast from GameInstance
Store the data but dont process/use it there
When you need to use/process your data cast it to any networked actor
I am just learning networking so take that with grain of salt anyway
That data is going to continuously update though. Like, I want to keep track of who's dead and who's alive across levels
How is a cast relevant here..?
Anyway
Is that data supposed to replicate from the server ?
yes, it should, ideally.
Think among us.
When you move from the voting level back to the normal level, you still want to know who's dead and who's alive
Then this data should be in GameState, and you should save its contents to game instance while traveling, on the server
The data in game instance would be ignored in clients
so the flow is:
store game state -> (when traveling to a new level) transfer all game state to game instance -> travel to new level -> unwrap game instance into new level's game state -> repeat
Yeah
Create a struct for the persistent game state, put it on both GS and GI, and it'll be trivial
thanks a ton!
ok one more follow up question:
learning the online subsystem is important regardless of what service (playfab, gamelift etc) I use right?
Because that's what is actually gonna help clients connect to sessions etc?
OSS is what helps you get friends list, search matches or join friends yeah
ok great, so I don't have to worry about what service I'm using (playfab, gamelift etc) for now, I jsut have to figure out OSS
OSS is essential
But you can do 80% of the work without needing to deal with it initially. Making your game work reliably for multiplayer is the first (big) step.
Just make sure you test stuff like travelling outside of the editor, ideally across multiple PC's, even if you just use join-via-IP.
We've already figured that out. We have 3 PCs all with the packaged version and we can connect seamlessly. Using Advanced Sessions plugin
Any one know the best way to make a multiplayer inventory system? I mean storing the contents of the inventory (UI can wait for now). I don't know if I should use BP structures and data tables or if a DataAsset is better. Also. I want persistence of the inventory contents over level changes.
I'm not asking for a tutorial right now, I just want to know what type of container for the inventory is best.
Data table/assets are read only
What you want is some Blueprint structures and a save system
@chrome quest multiple options, depending on what you're going for
Is this an instanced game that ends in 20-30 minutes? Use GameInstance to persist your inventory across levels
Is this an RPG like Divinity, where you want them to load later? Connect to a database and persist your inventory there. Have a defined schema for what your inventory will look like
The game is more like a MMO. For example, presently, in the player BP, I have an array called Player slots that tells the items in the inventory. The array variable type is presently a blueprints structure type. But I read somewhere that using a DataAsset is better. That's what I mean
Data assets are fixed
They're game content, can't be changed at runtime
If you're doing a MMO (lol) type game, then you need a database, with a database server processing requests from your dedicated servers, with the state of your BP structures.
The BP structure type I have is basically for the details of each item in the inventory; Name, type, actor class to spawn e.t.c and the array size is the number of available slots. I'm asking if I should use a bp structure or a DataAsset.
I'm not sure if I'm clear
For the details of each item, yeah, you can use a data asset
Oh, that's what I mean. Thanks. So you think it's better than a structure combined with data tables?
Depends on the game. Data tables are good when you have a lot of identically-structured objects
Data assets can have inheritance etc
Hey, Guys anyone has expierence Dealing with vivox voice services ?
Have some questions regarding the SampleProject provided by vivox for the same.
How am i suppose to run it for Dedicated Server ?
I am doing a server build, instead running editor instance for server using the command line, would that work, Becasue it seems to be crashing on startGameInstance() method
hey guys, i wondering if using delay node is a bad practice cause sometimes i need to use it so the event or variables will be replicated to the clients.
yes, it's bad. and zero guarantee.