#multiplayer
1 messages · Page 622 of 1
our host only supports linux servers though
than do a linux server
gotcha I think
u could even run in standalone to test so you dont have to package a client
that's what we're doing
can u connect?
but i have to use the UE source build to compile the linux servers, where as the others are using the standard launcher
I can connect, but they cant
and there's no way around that?
as they are than on different versions
seems arbitrary as long as we have the same files no?
can anyone help me to port forward
my isp doesn't allow port forward
i need alternative solution, so i can test my multiplayer game
Use Steam or implement your own NAT punch
can you provide me steam tutorials or documentation
or can you explain more about steam, how it should work
which is the best way
@bitter oriole
An overview of Online Subsystem Steam, including how to set up your project for distribution on Valve's Steam platform.
Go straight to "Configuring your Application's Settings"
Or "Finished Settings"
And use something like Advanced Sessions if you don't want to write C++ for your sessions system
does it support matchmaking
and if i doesn't have access to steam developers ( i don't have steam app id ), does it still works?
Yes, yes
@bitter oriole, i need your suggestion
this is the photon multiplayer blueprint sdk : https://www.unrealengine.com/marketplace/en-US/product/photon-cloud-api-by-xixgames
is this fine for implementing multiplayer games?
because i don't want to build dedicated server and complex stuff
If you don't want to bother with dedicated, why not just do a simple listen server setup on steam?
Not bothering with dedicated servers is a wise decision
there not that hard
Not bothering with Photon or non-UE4 stuff is even wiser
Just stick to simple listen servers
also ue4 replication system is very good
Use Steam for matchmaking, NAT punch, etc, and don't bother
@bitter oriole thats only for small casual games realistically
u can learn how to build a dedicated server in 10 mins
max
hey, how do you optimize your Vectors, that you send over network, continously, Can i use int16 ?
Learning how to use dedicated servers is easy, learning not to use them is harder. Dedicated servers aren't viable or useful for small indies.
for me they are
Good for you and your multi-million-dollar budget.
its not a multi-million dollar budget😅
its just playfab
is pretty cheap
and u get around 750 hours per month
free
Almost one full-time server, amazing
Anyway, not getting into debates here, I've used dedicated servers with Unreal a decade ago, I know about them - just think anyone who's not in a huge team should stick to "small casual games".
One caveat, a dedicated server can be worth it if your game design makes customer self hosting a viable option, like Garry's mod or valheim. If you don't have two commas in your bank account, don't try to make a live service
Customer self hosting of dedicated servers is not going to work in 2021 imho
depends on the game type
if its a co-op survival sandbox
than yes
it would prob work
I mean it's working for valheim and it's worked for Gary's mod for the last 10 years. If you have a game that works well for community servers, it's perfectly viable.
it really depends
Could probably include Minecraft in that mix
Yeah if it's competitive at all or if cheating is even a question, well, I hope you have money
These games are still mostly hosted by the developer
Or a third party
And if you're doing a competitive shooter as an indie, I'm sorry but you're mad
Maybe Minecraft is at this juncture but Garry's mod and valheim are just hosted by kids with AWS instances. there are companies that do it for you but it's the same model for the developer, just provide the dedicated server binary and call it a day
basically my logic is that 750 hours plus maybe some more hours that would havbe to play for is good for a small player base as u dont really need a ton of hours on playfab. Tho if ur game starts to pickup than u should prob be making money anyway from that to pay for more servers
thats why I like playfab so much
plus the 750 hours are FREE
We are going with a design that is listen server only and not touching dedi
Playfab is free for one server
If you ever need a second one, there goes the money
It's still one server in one region
And it's "750 core hours"
So I suspect that your dedicated server can't even actually run full time for a month on the free plan
Not to mention anyone buying the game in the US - if you're in the EU - or vice versa means they get 200 ping until you pay up
But hey, it's free
Until it's not 😉
I am attempting to get steam overlay to work with 4.26 following tutorials from several years ago.
I have Advanced Sessions, Advanced Steam Sessions, Online Subsystem, Online System Steam plugins enabled.
I have added the required lines to my DefaultEngine.ini file.
I am testing game as Standalone but no Steam Overlay.
Anyone willing to help me?
Edit: Also, yes, i have steam client started as well.
Hey there, Luthervian. I'll help you and anyone else that has this issue:
Launching from Editor using Play Standalone doesn't work in 4.26. Workaround is to create a .bat file that launches your game following Rama's method here:
For gameplay programmers writing C++ code.
Hey guys, I was wondering if this is a known problem: I want call my ChangeTeam method on PostLogin, but it seems like the server just ignores it.
However, if I add a small delay before the casts, it works. Should OnPostLogin assure me that I can start manipulating the PlayerState? If not, at what point can I consider it "safe" to do so?
Don't know. Is the player state even created at that point? You might check if it's invalid.
I added a breakpoint and stepped through it, it's not null but I'm unaware if needs to be "initialized" or "registered" with networking in some way
It's likely that this is done on the same execution line that it's created then. So the rpc might happen before it's resolved on the client. You should consider a rep notify instead.
Replication would serve you better with team assignment anyhow. Late joiners and disconnected players can be updated as well without another rpc
Is it generally acceptable in multiplayer to have a player action go through a Client->Server RPC then Replication in terms of visible latency?
(action to distinguish it from something people are more sensitive to, such as movement, etc.)
Depends on your strategy. You could do that, or you could just handle the initial verification client side, do your action, and RPC to the server saying you did something. Which in turn checks if you're a dirty cheater or you did something valid, and handle accordingly 😄
Fair
Is there some existing tools/utilities/architecture to make that kind of simulation easier?
It's generally in the area of "client prediction". There's no single tool you'd use for it - for a simple example akin to what you asked about initially, you would set the replicated value on the client itself and also send an RPC to the server. If the server agrees, it just ends up setting things to the same value and no more action is required.
If the server disagrees, it can set the value to something else and the client will update its own value accordingly when it receives the new value via replication.
is there somewhere a tutorial on doing a complete player character movement (crouch jump animations and all that) ? im finding multiple tutorials that work partially or not at all
As a related question, what about things where the state is a bit hard to represent with normal replication?
For instance, say you have multiple discrete states you want something to be in, with different implementations
like replicating a state machine?
To be replicated, you'd have a UObject* that would point to a state of that object (assumedly replicated as a subobject)
depends
most of the time, clients should already know what various states are available, right?
But my understanding is that you can't be guaranteed that the objects will be replicated at the same time
if there's only a certain set of states that are possible
I'm thinking of the standard State design pattern
Having a bunch of objects that implement the same interface
And some current-state field representing which is current
The issue, as I understand it, is there's possible desync between syncing object pointers, and whether or not that object has been spawned/replicated on the client
So you could be put in invalid states, where the state pointer goes to nullptr (and later recovers)
(Sorry for the wall of text)
@primal isle ACharacter already has all of that in the UCharacterMovementComponent. The crouching and jumping can just be calls in ACharacter. As far as the animation goes, you should check out the AnimStarterPack. It's free. It has a full AnimBlueprint for simple crouch and jump movement by default, and also includes a lot of basic animations besides those.
A small update on this, aparently GameMode->HasMatchStarted(); returns true on the first frame, and the validation was failing 🤦♂️ Thanks for the help tho
To ask a simpler question: What are the invariants about consistency of fields (both value and pointer/ref) during replication?
e.g. is it possible that two fields that are updated to be equal at the same time on the server are ever seen as different on the client?
And is it possible for a UObject* field to show up as nullptr on the client when it's never nullptr on the server?
By fields, do you mean properties? And UObjects don't replicate by default. Only Actors, or ActorComponents on replicating Actors.
Yes, properties
Assume that you've done the appropriate logic to make the server UObjects subobjects, etc.
If you put two properties in a struct, it will replicate at the same time. If you have two loose properties, there is a small chance that they can replicate individually.
Two properties not in a struct.
It possible. I would assume based on relevancy. I don't know how the UObject replication works, haven't needed it so I've avoided doing those steps. If it's anything like a Component, it should rely on the replicating Actor and it's relevancy. So if the actor replicating the uobject isn't relevant to the client, the uobject should be destroyed on the client and the pointer to it should be invalid.
Hmmm. I wonder about if it is relevant if there are any equivalent guarantees
Still, thanks for the help!
You can rule that out quickly by making the replicating actor AlwaysRelevant.
I'm coming from a more traditional style of programming, and I tend to depend heavily about consistency guarantees, so I'm just trying to understand which there are in the replication engine
I know that things are a bit looser when it comes to much of the UE4 model, but it's hard for me to understand what things I can rely on
I think it's best to rely on there being defaults. Treat the client as a dummy that is just told information and it has to paint the picture itself based on the most abstract data you can manage to replicate.
So, kind of as a view?
I just wish I could know if object graphs (i.e. the set of objects that are transitively pointed to by a single uobject) were replicated consistently, or at least know what guarantees I can depend on
Some things are hard to model as flat data structures
I am using the blueprints from the animstarter pack and the client doesnt replicate right
its verry wobbly
i set a disable input on begin play and the client doesnt care about that, im not sure i cant find where the problem is i looked everywhere
The replication should be fine. Are you using the Ue4ASPCharacter?
yes
Oh. Ugh. I didn't notice that about the AnimStarterPack, one sec.
i was using the normal bp first but somehow overnight my animbp got corupted and i just changed it mid project iwth the ue4asp one and thigs are not pretty now
and i cant really start the project from scratch now xD
Yeah, I assumed the Ue4ASP animgraph was better put together. The animations in the pack aren't terrible but.. that animbp.
you think its because of the anim bp?
playercharacter is what i renamed the ue4longuselessnameblueprint
If you.. Use the third person character, with the third person animbp. There are a couple of small changes to the animbp you need to make to make it work well. It has Jumping already. So all you need to do is add crouching. If you want other animations like sidestepping, you'll need to make yourself a blendspace from the animstarterpack stuff.
@primal isle If you make your AnimBP graph look like this, you can use those four variables for a lot, and all of it should work easily with replication.
well the thing is i can see the jumping, i added crouching but it seems like the server can see the client but the client cannot see the server crouching or himself crouching, this was working fine before i changed to the animpack blueprints
and the main problem is the client dont consider any of the things i setup before like the disable input at begin play
IsCrouching and IsFalling should both work for crouching and jumping with default networking and nothing more than the Jump/Crouch calls in Character.
where is that "isvalid" from? cant find the same
Just drag off of the TryGetPawnOwner and type, IsValid. There's two. One is that macro.
But with that animgraph and these controls, crouching and jumping should be replicated fine.
As long as you set up the state machine anyhow.
i did it like in your screens and i can jump but i cant crouch at all, this is how i setup the animbp transitions for going out from crouch to idle and from idle to crouch without "not"
@kindred widget
the thing is if i check the tickbox in preview in teh anim bp it crouches
i am lost rn 😆
@primal isle Ohhh. FM. Right. The CMC doesn't allow that by default. You need to check that.
what do you mean?
Open up your Character blueprint and click on your CharacterMovementComponent, and look for this.
CanCrouch isn't enabled by default.
idk if i should laugh or cry about this
nice now crouching works, but i still cant find why the client runs wobbly or doesnt respond to disable input
Where is the DisableInput ran from?
gamefile begin play
It needs to be ran on the client on that character.
this is the posses part when you enter the gamemode
and yeah my bad, the disable input is on the playercharacter bp
he gets a random color and can see it replicated right but no disalbed input
nvm, i connected the remote too from switch directly to the disable input and now he is disabled
now i just have to figure it out why the clients movement is wobbly
and i found it, the ue4asp blueprint from the animpack has orient rotation to movement checked, unchecking this fixes it
back on track now 🙏
If anyone is interested I made this easy tutorial that sums up Animation Replication for UE4.
UE4 Animation Replication Tutorial | Multiplayer - Client-Server | Blueprints | UE4.26.1
https://youtu.be/4jXUxn6D24s
In this tutorial I teach you how to replicate animations in Unreal Engine using a simple example of switching the idle animation to a thinking animation when the character is standing still.
The example blueprint code/logic that I show can be copied, and used to replicate virtually any animation.
Feel free to leave us a comment for any questio...
do you have on on how to replicate the pivot?
i managed to make it show on the sever screen when the client does it but i cant seem to make it show on the client screen when teh server does it
@primal isle Which pivot?
looking up and down
Ah. Use GetBaseAimRotation's Pitch.
AnimBP EventGraph. You use it with 1D AimOffsets usually.
i dont use an aim offset i just setup the transform modify bone in the animbp
i replaced get control rotation with get base aim rotation now it works ty
hey, Im wondering how to get the player's external ip address when he joins my server, is that possible via blueprints?
Usually the ext ip should be known in advance. If you need up addr on the fly, it is not easy. You possibly need some other service that can see your server’s real up especially when your server locates in vm or container env. If it is raw server, you should be able to query all iOS bound to internet card and check if it is ext up. Or you query other service, let them tell you real up.
what i wanna do is when the player connects to the server, itll get his IP and register the IP in the database.
I looked up on something called REST plugin, and under it another plugin to get the IP, but it doesnt seem to work since my engine version is a source build (for the server)
What "his ip" it is ? the ip of the connected player or your server ? you can get the remote IP from http header. It can be done either from your rest plugin or ue4 http client, depending on what library you're using.
@buoyant crag do you mind telling me what you will do with the ip once u registered in db?
I m super interested. Thanks for sharing.
I m very weak in animation stuff. So anything related to animation I love it.
Hey guys, i was making a simple auto login feature using VaREST, and it works in in single player but as soon as i add more than 1 client, it doesnt work
Do you mean in editor?
and shows a blueprint error about blueprint runtime error: "Blueprint Runtime Error: "Accessed None trying to read property CallFunc_ApplyURL_Result_1". Blueprint: LoadingScreen Function: Execute Ubergraph Loading Screen Graph: EventGraph Node: Branch
It is null
that branch gets activated once the request gets completed, and should change the level to Lobby, but it doesnt
the IP of the connect player, yes.
I am using the rest plugin, is the node called "http header"? thank you very much for the help, sorry for being clueless haha
I use that as sort of an ID, instead of having the player to register with user and password, it checks his IP
do you know the players IP is liable to change frequently?
@buoyant crag i think what you want is device login or guest login, and there are multiple ways to do this
you can use device machine address.. and machine addresses are unique
yes, its a risk, but unless I use a login system (user and password) I dont know if thats achieveable
device machine address? could you explain how to know what it is in windows for example? I know there's the device name which is "DESKTOP-XXXX" but im pretty sure anyone could change it
ipconfig
are you sure its unique for each device?
hmmm could you explain a bit? I dont know pretty much anything about cpp haha
this is fairly simple...
for android or ios it may return IMEI with permission is there. for windows, linux, or mac it will return machine address or device id
and they all are unique regardless of any platform
I see, could i turn it into a blueprint node?
yes why not
these are stateless static functions
i think bp should be already there for device id
Ill open up my project and see
but I have a question for you.
how will you send the device id to your dedicated server?
I want it to register on my database
so you would be registering in database on server side.
but how would you send to server.
there's a plugin called varest, pretty sure it handles that
it sends the variables to the database
ohh i see now.
what i initially thought is when player starts multiplayer match that time you would register in database
i think you will register on game launch, is it?
yeah sure
here
I want something to identify them, for example device ID or IP, and then if it finds a row for them, itll access the rest of the variables
got it, if you don't want the user to login via username or password, then silent device login is your best choice
yes
great, thank you man
welcome brother
have a good day, take care
one more suggestion. you should normalize your table.
what do you mean by that?
Name | IP | Balance | InventoryId | VehicleId | ApartmentId | Password
and separate tables for Inventory, Vehicle and Apartment
ohhh thats true thats a good idea, thanks
this way your queries will be faster
mhm
for some reason when I do that it gives me an Infinite Error, even if i use DoOnce
is there a better way to do it?
ohh man
GetDeviceID
you are recursively calling the same function
you created function Device ID
and you called that same function Device ID
ohhh haha yeah now it works thanks
Anyone here know if it's possible to do multi-player Play-In-Editor (PIE) over Unreal Multi-User Server?
why does my server have 6 instances of playerstate when I connect 2 clients?
4 of them are empty
and how are you counting them @graceful loom ?
because dedicated server with 2 clients - there are total of 6 player states
2 on each machine
in the editor with view options set to server
I assumed it would only show me objects on the dedicated server
running with a listen server and view options set to the client's world I can still see 6 player states
view options set to server I see four player pawns
for one client and one listen server
I guess each one has both, but why more player states then?
and it's not super clear what the view option is actually filtering
if I choose the client world then I only see one player pawn instead of four
@graceful loom I would stray away from relying on editor stuff for multiplayer debugging. Printing will return much better results in that regard because it can only print stuff that the machine you're running the code on has access to. So in this case, a keyboard button in the pawn with a GetAllActorsOfClass would tell you the correct amount of things that are on the machine that pressed the button. Editor stuff can get convoluted in that regard because it needs access to everything to debug everything.
Hey is there an easy way to find the hosts pawn when using a Listen Server?
I tried to use "Is Server" and check if Player Controller 0 = the controller of the pawn
This works kinda on the server, however would not work on the Clients, as "Is server" would fail 🤔
Note: I just started tinkering around with multiplayer so maybe iam missing some core concept here
Basically what I want to do is give the Host a special Indicator (like an extra mesh) to it's character that all the other clients also see (like a crown)
@tribal elk I don't think there's a default way to do that on clients. On server all you need to do is what you already did, just GetPlayerCharacter0. For clients, they cannot get any other pawn or controller than 0, because all of those checks rely on the controller being present and they only have their own controller. What you could possibly do though, is add a replicated bool to your PlayerStates, and mark one of the states as the server's Playerstate. Then you could get the hosts pawn that way through PawnPrivate through the Playerstate.
Ah ok so a replicated bool and set that for the host, yeah makes sense 🤔 kinda like the chest example in the contentexamples
Not sure I've seen that one. My thinking was just that Playerstates are easy to get through the GameState. And if you put the bool there, you don't even have to think about it later if you're constantly killing off the pawn and that state is always linked to their currently controlled pawn.
yeah I will just add a replicated bool "Is Host"
will try later, currently starting a playtest for our primary game 😄
Thanks for the tip though!
Hello, I managed to create a replicated timer by using the game state, but for some reason the client and the server are seperated by 1 second.
Does anyone know why that happens ?
Not sure without seeing it. How did you make it? Client and server have a replicated time thing that you could use if you're not. You could just send a simple float from the server of CurrentTime+TimerLength. Start the timer on the server. Then on client, when it gets that RPC or repnotify, it can either immediately fire the timer if the sent float >= CurrentTime. Else set timer for DesiredTime-CurrentTime.
Won't be perfect, but it should end up relatively in sync.
I used the elapsed time inside the game state, which is replicated by default
I create the widget by button press
The widget has a function bound to the text that gets the value from the GS. The GS is saved as a variable after casting inside the widget.
Hmm. Try something different. Just a sec.
I tried a couple times
sometimes they are synced and somtimes the value is off by 1
@weary badge This is to count the amount of time that's elapsed since the timer was started, right? Not a countdown timer?
this is the values discription.
I thought it would show the time since the game was started by the server
or did I misunderstand and it shows the time for each client when it starts up ?
Ah. My bad, I was under a slightly different timer impression. Actually all you need to do is replace your binding with...
That should be a replicated time, for when the server first started it's world.
NICE !
Thanks a lot Authaer
there is also 1 tiny question that I have been wondering about
What's that?
I mean, between just casting or saving it as a variable
is there some form of difference ?
That is a complex question. In execution, there's very little difference. The casting has a validity check in it that takes a very very small amount of processing. But it takes hundreds of thousands of these in a single moment to really hurt, nothing you should worry about. The casting itself is often the problem, but not for performance in the standard way. When you cast to something, you're saying that the backend code needs to have that object loaded to check against. So.. If you have an ability in your character that casts to a specific boss that is in level 3, and that boss casts to a throwable rock actor, and that rock actor happens to cast to soemthing else.. etc. If you load up NOTHING except just your singular character with their ability, then in the background, the Boss, The Rock, and whatever the rock casts to, also get loaded up, along with their meshes and everything into memory. And while this doesn't affect your in game performance, if your project gets too large, your application will be forced to put stuff on disk to avoid overflowing RAM, and that leads to bad compute times, etc. and it just becomes a mess.
But as far as your exact question, there's no difference really. Cause having a hard pointer to something is the same as casting to it.
Alrighty !
That was very clear, thank you !
Anyone interested? I created the Network Profiler from UE4 in WPF with better and responsive UI.
Pretty sure it will be rejected 😆
Give it a try at least
Even if it does get rejected, you might get a reason why. Improvement critique is always good.
Yes definitely. I just posted this on forums https://forums.unrealengine.com/community/work-in-progress/1868755-brand-new-network-profiler-with-better-and-responsive-ui
I'll submit a pull request after I upload it to GitHub.
Its a standalone program so not sure if they allow it on Marketplace.
@kindred widget Ok got it to work - thanks for the help 🙂
Nice!
had to call the "Show" once on begin play additionally as the rep value did not get replicated properly if no change happened I guess 🤔
and so the repnotify didn't fire
Hmm, yeah at the beginning of game in pie it might pose a problem. Theoretically in a normal game, the server would have ran beginplay and set that before a client ever connected. But then you can't promise replication order. So it might be wise to run that check on both beginplay in the Pawn and in the repnotify of the value. Then it wouldn't matter which hit first, the other would correct it.
yeah that's what i did now
or atleast run the "show / hide crown" on both, repnotify and beginplay - so by default it is off, then when the "Is Host" replicated variable updates, it will show the crown
thats how i understand it so far, as BeginPlay (Client) also is mostly not the same as OnPossessed which will happen on Server as far as i know
Beginplay is the best place, since that's going to run a lot more often between pawn respawn and relevancy. But yeah, if you ever ran into an issue where the pawn ran that first, it whouldn't show if the playerstate replicated second somehow. So the repnotify is kind of needed I suppose.
Oh currently it is a variable on the character itself, didn't mess to much with PlayerState - never had to (so far i just worked on singleplayer / local multiplayer stuff)so had to look how to use it once i get into respawning for stuff like that, also like PlayerColor probably
Is there a way to mutate PlayerState on Connect - probably there is 🤔 like have a list of colors and 3rd PlayerState picks Color[2] etc.
Probably. GameMode could likely handle that in HandleStartingNewPlayer. PlayerState seems to be valid and created and set on the controller by then. You could make a color array in the game mode and just populate the Playerstate from a Select node.
Looks beautiful, just worried how it would compare to Unreal Insights? Considering I think they're using that to replace the old network profiler already if I'm not mistaken
One of the most amazing things I've ever seen in my life
I think you still need the profiler for dedicated servers lol
Can't you attach Unreal Insights to a dedicated server process?
I'm really not trying to knock the app, it looks neat
Just wonder how the two compare and what the usecase would be relative to one another
Since you'll be making bank
#volunteer-projects if you have some doubts after all
Yeah, this tells me you have never shipped a game before
No offense
It's just the most common fear of new game devs
The truth is that no one cares about your idea - everyone's got loads of them. Convincing people to join your idea usually works through $$$
Do the learn
Repeat after me : ideas in gamedev are worthless
Execution of ideas has value
Battle Royale was an idea implemented in like 3 full games by the PUBG guy before PUBG and no one gave a shit, and then it was the world's only game genre for what felt like a decade
The idea didn't change
The execution did
You misunderstand my point : I have no opinion of whether it will flop or not
My point is that no one cares about your idea until you've made bank with it
@twin juniper Ideas are cheap, execution is expensive.
Here's the gist of it : people don't care, so you need to pay them
I mean, assuming your idea actually is awesome and it's the next Fortnite - do you think the experienced developers working with you for free will just let you, the idea guy, keep the project ?
So do a vertical slice of your game, put it on Youtube, make millions of views and you'll have a much easier time finding people than with "secret project I cannot talk about but I swear is the best in the world also I never shipped a game before"
Because the latter is frankly just every new game dev
Again, no offense
No one's gonna DM you for your idea
What's the point then in not telling, they could approach you just to steal the amazing idea
Create a prototype, present it and if it's that good then you have a bright future ahead of you
Here's step one on recruiting for a game project :
- do a prototype that sells the idea of the game, runs on the target platform and just needs lots of art and polish
- put it on the Web for everyone to see (also neatly solves idea stealing - everyone knows you now)
- profit
Pretty much what Iannis just said
I've actually done this once before myself and it did work out
Twice really
What did you make, Stranger?
A really shitty competitive shooter with lots of art students first, and then Helium Rain, a space sim
Looks gorgeous, neat!
I think you're slightly optimistic
Don't let met doubt you though, do one minigame and the lobby system and see how it goes
Good news, multiplayer support only makes each minigame 5x more work
And an art team, since art work is about 90% of a game
Game modelling is a very different job
But hey, just do it
You know a lot already, so you don't need my advice
Just do it
Download more RAM
can anyone find the flaw where my server player shoots straight but my client player shoots spread?
spread as in every ball is going a bit offset around the cursor
your camera will not be facing the same way
on the server likely
as in it doesn't pitch
When overriding virtual client RPCs in C++ should you override the _Implementation function?
AS in
UFUNCTION(Client, Reliable)
virtual void ClientDoSomething();
in the parent .h should become virtual void ClientDoSomething_Implementation() override; in the derived class?
Asking as virtual void ClientDoSomething() override; compiles, so I'm not sure which is the correct way
implementatiion
Ty!
Is it possible to get the owning player controller of a player state directly or do you need to go through GetPawn ?
Oh so GetOwner() is the controller and I can use that to cast?
yes
Perfect thanks
A question about dedicated servers.... If I have a lot of timelines firing and lerps and math happening that would normally be too much for a computer to be the server and play the game (aka a listen server)...theoretically (unless I totally misunderstand) is it right to assume that a dedicated server can increase performance on clients by offloading all the lerps and math in actors becuse they are done on the server..when only the result of that math is what the clients see
excellent, thank you I'll keep all that in mind
how would you handle notification in the player controller when a member of the playerstate is replicated?
related to that, how do I set a property on a newly spawned actor before the actor is replicated? I'm setting something that causes a material to be applied, but it happens too long after the actors appear on clients and looks messy
I pulled the property out of the player state and it replicates much faster now, but I'm still curious
kind of related, my MP player starts at 0,0,0 even though the first thing I do when they join is spawn a camera and possess it. So there's always a flicker where they start in the ground and then appear in the right place. How do I make them just not have a camera until I give them one?
auto manage active camera is off
in playercontroller beginplay I get active camera iterator and setviewtarget on the first one and the player starts at 0,0,0
it doesn't matter what I do
Hello! We're having trouble getting our game to connect over the internet to the dedicated server I'm hosting on my machine. I have the port (7777) open and am able to connect locally, but when I try by ip address nothing happens. Firewall is allowing both the server program and port through as well. Any ideas? We're currently just testing with the third person project before fully jumping ship to UE4 from Unity.
Also, once the server is started, this is what it has: "LogNet: Created socket for bind address: 0.0.0.0 on port 7777". Is that ip of 0.0.0.0 correct? Or does this need to be changed somewhere?
The network profiler is live now. You can check it out here: https://cutt.ly/ue4-net-profiler
You need to configure your router to forward port 7777 to your PC too.
pretty sure the ip address is wrong, 0.0.0.0 is the default gateway.
you should use ipv4
@silent valley Yeah I figured it out... I had everything port forwarded, but bridged the connection for my nintendo switch through my desktop, and instead of giving the switch a new IP, it took my desktops and gave my desktop a new IP. So the port was forwarded to the switch... Fixed it and connected without issue
Just bad timing wanting to download BotW again lol
i amtrying to spawn a block under the player in a multiplayer game, it only spawn under the server player charater, even if other players press to spawn the floor block thats supposed to spawn under themselfs, any idea what the issue might be? i am using blueprints.
Is the block replicated ? Do other players use a server event to spawn the block on the server ?
block is replicated yes. yes other players use on server event to spawn block.
I spawn a player pawn and possess it in the gamemode (HandleStartingNewPlayer), but clients always join with their camera at 0,0,0 before it's changed to the player start where the pawn is spawned. How can I disable the camera until they're attached to the right one?
@twin juniper Add some logs to confirm that the event does run on the server
how do i add logs?
GetPlayerCharacter0
Is 100% not what you want to use there
Because since that is executed on the Server, you are spawning them all at the Server's character.
You are inside of the Character BP already, so just get the actor location.
aahhhh thats makes a lot of sense. thank you ^^
and it works now.
how do i make the actor i spawn to appear under my player , currently it spawns at center of my player
is it rigged? you can get the foot socket location
or use GetActorBounds and subtract the Z value of the boxextents
its rigged
GetMesh()->GetBoneLocation(GroundLevelBoneName);
is what I'm using
and that's set toooooo
"ik_foot_root"
yes it worked thank you
ACharacter::BeginPlay() {
if(!HasAuthority()) {
ServerOnCharacterReady();
}
}
never runs
it calls it but the RPC doesn't run
the character replicates, its owner is set to the playercontroller when it's spawned on the server
its properties replicate
the RPC is declared UFUNCTION(Server, Reliable)
the character is spawned and its owner is set on the server
oh, despite setting an owner in SpawnActor, GetOwner returns null in beginplay
"Thus the server has to tell the client version of the actor that it now owned by the player." christ can this be more convoluted
so I need to call a client RPC and have it retrieve the local playercontroller on the client and not try to give it the playercontroller that's on the server?
i.e. owner isn't replicated?
nope, call client RPC, SetOwner(GetWorld()->GetFirstPlayerController()) runs, then in BeginPlayer GetOwner returns null
i am trying to spawn actors at where th players have their mouse. but this mouse in world thing wants player controller. if i use getplayercontroller0 i will get the issue of it only working on server. how can i make it so its getting the controller of the correct player?
99% sure if that runs on the client it will return the right playercontroller
if server does it, it works, if client does ut, nothing is happening as far as i can see, maybe it spawn it at a location i dont see
does it return anything? use isvalid
if it returns a player controller and it's on the client there is only one object that could be returned
it's not complaining about getting NONE so it can't be returning anything but the local controller
so I set the owner to the playercontroller when I spawn the character on the server; I set the owner explicitly on the server; I call a client RPC that sets the owner on the client (runs, but owner doesn't get set); I set the owner again in beginplay on the client (does get set); server RPC will never run
How do you net serialize primitive types like floats in your custom Struct?
When searching for a Guide, I only see examples for Net Serializing a TArray.
- http://www.aclockworkberry.com/custom-struct-serialization-for-networking-in-unreal-engine/
- Engines NetSerialization.h
The websites mentions:
Unreal Engine implements a generic data serialization for atomic properties of an Actor like ints, floats, objects*
But how do I use it?
lmfao okay
now I'm calling the RPC from the playercontroller itself
doesn't run
I give up, goodnight
Okay I just did Ar << MyFloatVariable;
But isn't there more to it? haha
Isn't ServerHitScanHit something very important? Why its Unreliable in UT's source code?
Speeds sake
Unreliable's are generally faster
And if you drop a reliable, all other reliables get backed up. In a twitchy shooter like UT it wants to be as responsive as possible
(Asked the same question to one of their engineers way back when)
I see, thank you Jambax
How do i make reverb for my weapons so it doesnt sound like it comes from the same pawn?
or am i doing something wrong?
@graceful loom i think it requires validation now
you didn't get any warnings when compiling that rpc without a validation function?
Ill do thanks anyways 🙂
@kindred widget Are you there ?
I managed to set up that timer on a separate project, but for some reason the setup doesn't work inside the project im working on
For the gamestate time?
yeah
What are you currently doing in your non working project?
i don't think sound cues should be replicated Trold 😮
@kindred widget
@weary badge What was the end goal with this? Is this like starting the countdown to a match start?
yes
I would just replicate a single float that is the CurrentServerTime+Countdowntime.
On repnotify, if that replicated value is more than current server time, show the widget. In the widget binding, you can countdown via replicated time - servertime = duration remaining
Can a variable in a non replicated component be replicated or must the parent also too replicate.
When I crank up the packet loss of my network emulator, and a variable is replicated in my GameState, sometimes the pawn attached to my PlayerController (GetPlayerPawn function) is SpectatorPawn and sometimes it is my Default Pawn Class from my GameMode. My GameMode is not set to start players as spectators, so I am wondering where this SpectatorPawn is coming from, because it is messing with my OnRep Notify casting logic (casting the player pawn to my specific pawn), because sometimes it will work (if the player pawn is correct) and sometimes it won't (if the player pawn is SpectatorPawn). Any ideas of how to fix this?
@clear salmon for a variable to replicate in a component both the Component and Actor the component is on have to be replicated
@tulip ferry anything not serializable will get lost during the RPC
along with pointers to non-net addressable objects
but that is usually easy to work around, for example you can't do
UFUNCTION(Server, Reliable)
void ServerPlayMontage(UAnimInstance* AnimInstance, UAnimMontage* MontageAsset)
{
AnimInstance->PlayMontage(MontageAsset):
}
as that will crash the server, without exception
you can however do
UFUNCTION(Server, Reliable)
void ServerPlayMontage(USkeletalMesh* Skeleton, UAnimMontage* MontageAsset)
{
Skeleton->GetAnimInstance()->PlayMontage(MontageAsset):
}
as the SkeletalMesh tends to be net addressable, and has a 1:1 relationship with the anim instance
nope no warnings; I'll try with validation in a bit thanks for the tip!
@graceful loom can't make assumptions in which order the Characters, Controllers and PlayerStates will replicate over to client
i'd move that to APlayerController::SetPawn override
any idea how to smooth characters out on rotating platforms? Players above like 50+ ping end up getting corrected pretty often and it's ugly
Hey guys, I need some multiplayer FPS concept advice. I am looking for your subjective opinions here...
I am creating a FPS multiplayer game and I was contemplating the shooting origin and destination.
I am trying to decide between two aiming systems, I would like the game to feel reasonably real.
- My first idea was to drive the shooting origin and direction by the actual weapon rotation and transform (shooting in the direction the weapon is actually facing) but this would mean that the hit location would be driven by the currently running animation which translates the weapon actor and I don't find this very reliable (animation sync across clients) and it would basically mean that the shooting is driven by aesthetics.
- The second option is to have two deterministic points, one in the center of the screen or some offset based on the current character state and one at the approximate location of the weapon nozzle (shooting origin).
I just need some opinions on this matter, do you think that the first (more accurate) option is reasonable or is just too much of a hassle and would feel weird and I should go for the second option?
FPSes that depend on what's happening in 3rd person always feel clunky
I feel like 1 would be fine if you're going for semi realism. It's also not that bad when you consider the animation sync. That won't matter in most networking because the client does most of the shooting and checking and server/otherclients only approximate, and server does relative cheat detection checks only when the client claims they hit something.
the first person part of our game is really just a floating camera, where the weapon is in 3P doesn't affect anything really
though we do have freeaim but that's using the location of the 1P mesh
which is a mesh at a fixed FOV too
if you do something like arma's "first person third person" system, all the animations will end up feeling stiff and it just feels clunky
Thanks for the reply. Yep, that is what I was thinking too... so solution number 1 is still in business 😄
I think it just comes down to how it feels. You'd be putting a lot on your animations. It 'could' work very well. From a more gameplay designer's standpoint. I'm more likely to rely on modifying a point around the center of the screen based on movement or other factors to simulate a moving weapon's inability to aim.
It'd be much easier to do that and make the animation point the weapon in that direction, than to solve potentially annoying animation problems.
Yep I am logically gravitating to the second solution of having some deterministic point in the "center" of the screen, driven by gameplay logic too, thanks for the input 🙂 it is much appreciated
Structs are allowed through RPCs, as long as their properties are UPROPERTY marked. Fairly certain even if one isn't, it'd just get zerofilled on the client after the struct passed.
Can UObject use server rpc?
when the host crashes, players get sent back to the main menu. But the session isn't being destroyed even though I call Destroy Session when the player hits the main menu. Any idea how to solve this? Players have to restart the client to play again
@kind ember Not by default I don't believe. AFAIK the only two objects that can RPC are Actors or ActorComponents
i see 🙂
@tulip ferry Are you using Blueprint or C++?
Ok thxs.
It should work fine. Just be certain that your struct is a USTRUCT() and that all properties in it are marked UPROPERTY(). Which in Unreal is good practice anyhow.
Hmm. Fair question. I'm uncertain about if there's a size limit for the whole RPC. I know that by default at least, most Arrays should be limited to 2048 entries.
One thing to do for a testing environment, if you have not already, is to add this to your project's DefaultEngine.ini. It's overkill, it's 1Mbit per second, but it'll make sure you don't hit that at least.
[/Script/Engine.Player]
ConfiguredInternetSpeed=1000000
ConfiguredLanSpeed=1000000
[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=1000000
MaxInternetClientRate=1000000
I think Jambax said that in 4.26 they upped it to like 100,000 or something. Before that it was 10,000.
Bits.
The 10,000 in UE4 4.25 and older was like a fifth of an old dial up connection.
thanks, what exactly do you mean to move to setpawn?
the setting ownership?
I don't really understand what's complicated about what I'm doing when all of the blueprint tutorials are so straightforward; a player connects and I spawn them a pawn and possess it and can't get RPCs to work, but that's exactly what every tutorial does and it just works
in blueprints
on server
Character doesn't have Controller on BeginPlay
on clients
it does
and blueprint networking tutorials are abhorrent
so good luck with that 😄
lol
ok so I copied the rpc into my player pawn and it works, so the problem is definitely that the spawned actor isn't getting the networked player controller as its owner
so calling possess on the server DOES replicate the owner to the client, but setting the owner for a different actor on the server, or on the client, does not establish the right ownership
what am I missing here?
I'm setting the actor's owner to the player controller in the spawnactor parameter, with character->setowner, by calling a client RPC with the player controller as a parameter where I then call setowner on the client, and on the client by getting the first player controller and setting owner to that; none of that allows the actor to use RPCs
it's set to replicate and set to always relevant in the constructor of the base class and in the derived blueprint
it does replicate with properties to all clients and I can call client RPCs on it
I even get the player controller and pass the actor to it, then call the RPC on the actor from the player controller; doesn't work. If I copy the RPC to the player controller it works
so which is it, owned or possessed?
both
though in a more accurate way, the ability to call RPCs on an actor depends on ownership
ownership is server authoritative
it literally can't get more ownership than that
that's in the game mode
the only thing I can infer from that is that beginplay runs on the client before the owner passed in the spawn parameter is replicated
the server does call all of those setters and FinishSpawn before any client runs beginplay
in beginplay GetOwner returns null
Help me out guys just want to make sure I am understanding correctly. Montages require an RPC with multicast to replicate properly. Animations on the other hand come from the AnimBP and only need to be run on the server without the Multicast. Correct?
Sort of. AnimBPs don't only run on the server, they run everywhere. They don't need to be networked because they're running the same logic everywhere, though if there's some event or some value that they change their animations based on that value should probably be networked somehow.
The reason they usually "just work" without any special replication is because you usually have the settings for an AnimBP already baked into whatever assets are relevant
A montage on the other hand is usually started in response to an event. If that event only happens on the server, or on a single client, you need some way to tell other clients/the server that said event happened so they can trigger a montage as well
so the client actor does GetOwner()->GetServerNetworkAddress and gets the correct value, then calls a server RPC and nothing happens
ok so the actor's owner is nulled between setting it and beginplay
ClientSetOwner is NOT setting the owner btw; it's just being called from the server
it successfully reports having an owner that was set during spawn by the server, but the actor that runs BeginPlay is either not the same actor as this one or gets nulled out before starting
this is beyond frustrating, I'm like 10 hours into this now
@hollow eagle Thank you, I have noticed that the animations from the AnimBP don't always replicate unless the variable I use to call them is replicated as well.
@graceful loom Are you trying to do like controlling AI pawns through RPC from the client?
@graceful loom APlayerController::SetPawn
is the best place to link stuff between your Character and the PC
Hi everyone, I'm trying to do some level travelling for the first time. I'm trying to execute the following code. I have as well my transition map set on the project settings and the bUseSeamlessTravel activated on the GameMode. What could I be missing? 😕 THanks!
the player already has a pawn
and its set during that functions exec
I'm setting the player at a spectator camera, then the gamemode is spawning actors, and I'm counting when they pop into the client world so I can move the player to see them when they're done
otherwise the client sees them pop in
the idea is not to call it
so the actors are calling back to the server to announce themselves
but to override it
these actors are unrelated to the player's pawn
in other words, inventing hot water 😄
hm?
oh you're probably asking about AI because its a character, yeah it will be AI controlled but I haven't implemented that yet. I guess if it had an AI controller that would solve this wouldn't it
The main thing is I'm trying to believe that I don't have to proxy every single RPC call in the entire game through one class like the player controller, because jesus
i have about 7-8 Actors owned by the PC, plus dozens of components that can RPC
Can somebody help me with something?
but most of reduction in RPCs in PlayerController did not come by adding more classes to spread them thin
My player states aren't accessible to the player controllers.
it was done by making a few interfaces the player interacts with the world through
and leaving it to the Actors implementing the interface to understand what the player action was meant to be
@muted perch that is impossible, except on clients on very start of the game
Can widgets access player states?
yes
sweet
GetOwningPlayer->PlayerState, pretty much
assuming you bothered to plug the owner node when constructing widgets
and that is local PlayerState then
So player controllers CAN access player states?
for others need to be a little more creative
player controller instantiates the playerstate in its PosInitializeComponents function
and keeps a reference to it during its entire lifetime
its just that PlayerState is a separate Actor
that replicates separately, via its own ActorChannel
that's weird because I tried to get the player state and I checked if it was valid, and it said it wasnt valid.
and having a default NetPrirority of 1, while Pawns and Controllers have 3
it usually arrives few frames to few seconds in on clients
depending on how much there is to replicate
so by default, at BeginPlay, for example
Pawn and PlayerController have the valid NetGUID for the PlayerState
but since PlayerState Actor hasn't replicated yet
it is not yet resolved, so its a nullptr
ahhh ok
so its best to wire that kind of logic info OnRep_PlayerState that both Pawn and Controllers have
I was trying to keep track of what team the player is on in the player state
in c++
no, in BP
that is unfortunate
I like the ease of use :/
for networking, you have zero tools to do anything but the very basics
in blueprints
they literally have less then 10% network functionality exposed
I like the challenge tho. And anything I don't have access to that I need, I'll just expose it to BP
but haven't encountered that problem yet.
in that case
override both APawn and APlayerController::OnRep_PlayerState
call Super
and shoot yourself a BlueprintImplementableEvent from there
it will make your life easier for this scenario
I got my problem sorted out, but thanks for the tip
I just grabbed the player state from the widget and set it to a bind function.
How are you setting them up?
with a 80 line function in GameMode
that just spawns everything and constructs the entire object graph
in override of HandleStartingNewPlayer
not trying to solve more then 2 objects at a time?
if you're waiting for 3+ objects to be valid and are not happy running a looping timer until everything is valid
you'll fail
you have to set up the OnReps for each pair of objects that depend on each other
That doesn't make sense
separately
There are no dependencies
The player controller works, it's pawn works, the gamemode works
The only thing that doesn't work is callbacks from actors that aren't the player pawn
we can't finish setting up a character without a PlayerState being there
for example
The player state works
what callbacks?
The gamemode spawns actors, they replicate to the client, run beginplay, and at this point they should be able to run server rpcs
not always
They're spawned with the player controller as their owner on the server, the player controller is on the client at this point and is running code already
The debug statements from them are the last things that show up in the console
Everything is set up
Beginplay is defined as "when the actor is completely initialized" in the docs
Oh?
and if you're chaining owners
it can get even worse then that
since all actors in the chain would have to had replicated already
before you can send a RPC
bool USolsticeObjectLibrary::IsLocallyControlled(AActor* ActorToQuery)
{
if (!ActorToQuery)
{
return false;
}
AActor* TopOwner;
for (TopOwner = ActorToQuery; TopOwner->GetOwner(); TopOwner = TopOwner->GetOwner())
{
}
APlayerController* Controller = Cast<APlayerController>(TopOwner);
return Controller && Controller->IsLocalPlayerController();
}
this is basically a check
that if it returns true
you can send a RPC
you don't have to be owned directly by the player controller
can be any number of owners in between
so you're saying the actors are being replicated and started before the underlying network infrastructure has registered the player controller fully?
so it may be true that its their owner, and that it's running code on the client, but that doesn't mean it's ready to network?
registering PC != registering NetConnection
ok gotcha
bizarre that it can replicate without having a connection but
I'll bite
basically
there is no reason to setup
so you need to send RPCs immediately when the game starts
from client
we do send a few, but in lobby
so the PC should call to the server, then tell these actors that they're ok to send RPCs?
and we don't care if they are a few seconds late
but the PC needs to complete an RPC before they try to?
I do have the server calling an RPC on the actors that can't call back
and that can take a few frames
so setting up to depend on first Tick RPCs
is not ideal
ok I'm trying it ontick now and it never runs
getowner() is never nonnull
and the rpc never calls
i have a PC that owns an AIController that owns a Character that owns its Weapons
and weapons can RPC just fine
but i don't try it on Tick 1
or BeginPlay
I'm trying it every tick
you probably broke something trying to fix it then
so I'm getting it to spawn the actor with the PC's pawn as the instigator, the PC as the owner, and then I'm setting the owner explicitly to the player on the server
if I don't do that then they spawn with a property not replicated and there's popin when it replicates and changes their material
this way they spawn with the right properties set already and there's no popin
no
FActorSpawnParameters HeroSpawnInfo;
HeroSpawnInfo.bDeferConstruction = true;
HeroSpawnInfo.Owner = PC;
HeroSpawnInfo.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;
const FVector SpawnLocation = SpawnTransform.GetLocation();
FRotator SpawnRotation = SpawnTransform.GetRotation().Rotator();
AHeroCharacterBase* Hero = GetWorld()->SpawnActor<AHeroCharacterBase>(CharacterData.PlayerClass, SpawnLocation, SpawnRotation, HeroSpawnInfo);```
that is also a deferred spawn
it doesn't, or it didn't have all the overloads that SpawnActor does
or wasn't templated
there was a reason i went for this approach
just not sure if its still relevant
been doing it since 4.9 i think
and then you still have to use gameplaystatics::finish or there's another finish?
Hero->FionishSpawning(AdjustedSpawnTranform);
still null owner
😦
Thanks very much for your help I don't have any other leads
I'll look more into the netguid stuff and wrap my head around how that's all getting set up
if you're still at null owner
im wondering what your test case is
as bugs in debug tools are fun thing to have
I'm just running two clients from the editor and using ue_log, what else do you mean?
hahahahahaha
this was the secret
I didn't implement the AI...but I did enable it
two days on this
❤️
thanks a lot man I appreciate the help
so does AIController ever create a net connection usable for server RPC?
why would it?
you don't know about other controllers as a client and something local to the server doesn't need a net channel at all
AIControllers are not replicated by default
if i make a local dedicated server do i need to open a port on my router for it so my friend from another country can join??
Hi there, what makes less data usage when a plaer player dies. Ragdoll or a Deathanimation?
usually yes
with hosting anything behind a nat
thx just checking
Anyone experienced with World Composition and streaming world tiles from a server? I was told perhaps this channel could provide some insight. Not actually looking for multiplayer functionality, but the ability to stream heightmaps from a server, and create terrain on the fly.
@limpid cedar I think that really depends on how you're getting the Heightmaps in the first place. Are they generated on the server?
I believe I'll be able to mirror a large portion of the Norwegian Mapping Authorities' terrain dataset. It's DEM data that I assume should be exported/stored as GeoTIFFS. The data is available through a rest api, but I'm trying to find out if we'd be able to stream it on the fly if we hosted it.
What is the resolution of the tiff files?
Not sure yet, I believe they're sorted as tiles within tiles. To be honest we'd know more if we'd go forward with trying to clone the database.
My initial thought is just that it'd be fairly easy to compress the data into arrays by compressing them to shorts. You might not even need to do that. The max TArray limit is 2048 as far as I know, but I wonder if you can get around that by making arrays of arrays. Like a 2D array of shorts. I wonder what the max RPC size limit is? My knowledge is limited to RPC and replication but there is also the tcp route, but that's an outside solution that would need it's own implementation.
Very used to images being packed with the game files.
Someone like Jambax, Kaos, or Zlo could probably help you more with the engine limits.
why you try to host yourself, just use some CDN and CDN will ensure the availability and you don't have to worry about traffic.
if you host yourself , then you need to do load balancing, etc.
if it is not about multiplayer, then use CDN for your data sets. when player opens game check what is the file version on server, if user already has that file version saved locally don't download or stream it.
LogLoad: Warning: GameMode::GameModeClassAliases are deprecated, move to GameMapsSettings Hi guys, Does anyone have any idea how to resolve this? It happened after a project upgrade using generic shooter as a base. Google hasnt given me any ideas yet
go to maps and mode settings and check there.
Ok.. not sure whats going to be there to change tho
the only thing there is class aliases and game mode map prefixes
Damn, well, filling out the aliases didnt do anything, it just stopped the erro message coming up lol.. game mode didnt stick in the url string for the level open node
can you run dedicated server out of editor? When i compile it and run by myself it works but if i use netmode "play as client" in editor (to run dedicated server), im getting Warning: OSS: No game present to join for session (GameSession)
and nothing happens
Hey guys is it possible to create a GET Request in Varest with just header and no body?
what's the difference between mp and EOS
@ancient bramble get request has no body. This is the standard.
EOS is your game backend, using which players create account, send friend request, send messages, accept invite, etc.
Whereas MP is an environment where a match is played between multiple players
so basically I need both of them
Unreal does the MP part
And you don't need EOS, you need EOS or Steam or GOG or your own service
wdym by that
you just told me I dont need EOS but i need
it
oh is it the best one
Usually you use the one provided by the platform you sell on
ok so I'm using Steam
Like on Steam you'd generally use Steam to avoid telling your players to register on EOS before they can play
ok
thx
would you recommend learning from websites or videos about how to use ue4 mp?
i¨m using this values for default on my engine.ini and as far as i know this values are pretty old that come in Unreal template for a long time now....
[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=15000
MaxInternetClientRate=150000
[/Script/Engine.Player]
ConfiguredInternetSpeed=15000
ConfiguredLanSpeed=20000
so does anybody know which would be a new standard for those?
or best method to adjust them? i´m using aws dedicated servers, and clients would be using standard internet connections
@gaunt fractal Realistically you should learn single player stuff inside and out. If you can't make a small game in single player, Multiplayer is going to be brutal. But in the end, you can get extremely far in multiplayer by just realizing the difference between an RPC and Replication, and the basics like server vs clients, abstracting your code to run on different machines, and knowing what can and cannot RPC/replicate to what.
@pseudo gull Can be whatever you want or need. The default before 4.26 was 10,000 on each of those. I think that 4.26 upped it to 100,000. For testing purposes I just leave mine at 1,000,000. A megabit per second is a little overkill. Or way overkill. But that can always be lowered easily later.
so @kindred widget what you suggest is to multiply *10 at least? thanks in advance
In 4.26 the defaults are 100,000
1,000,000 is just my development default. I'd rather be able to just do things, and then optimize them later.
Hey Jambax, that does remind. What is the max current RPC size? I read Arrays was 2048 entries, but is there a bit/byte max?
Not sure off the top of my head tbh
There is a max RPC size, and a max partial bunch size somewhere
Most likely NetDriver or somewhere similar
Thanks! I'll go digging there after this mess of arrays of vectors.
Lol. I thought I'd skim really quick. I might need to take an evening to actually read through NetDriver. That is a ton of data.
can anyone inspire me how can i connect team a to set red character color and team b to set blue character color? i tried multiple times and every time i only made the server red
@primal isle store the teams as arrays of player states...
you wanna use another select node to also set the color
thats how they are stored
They're arrays of strings
Are you going to iterate over Players to compare names in order to get a player from TeamA ?
While we're here - don't do
then its casted to playerstate bp and they go inside the string var in there
You have the player state reference right there. Call PlayerState -> GetPawn
i just fallowed a tutorial on doing the teams and im trying to assing colors, im a bit lost
But that is a string and that isn't a player state reference
Follow the tut if you want
the tut stops there
what's the tut?
and i cant find any better one on how to make the teams not shoot eachother
and how to add colors
link?
If you're confused about how players spawn, make sure to check other tag tutorials. Here's the link to my Discord server: https://discord.com/invite/ZhR2ecf
Thanks for watching!
i tried getting the player character from each team's add index but it doesnt work
Hrm. Okay, check the channel pins in this discord channel
There's some useful things to familiarize yourself with. Try making the changes I've suggested, see where you get stuck. I'll check back in, but I can't open the editor rn to give you a screenshot
but this is part of the solution
im not really sure how to do that
i just started using this a month ago and trying to learn
i was stupid enough to say ill make my final year project multiplayer
mmm
Okay so how did you spawn the select node for the string?
YOu wanna do that, but for CharacterColor
And you can get the pawn directly from the player state that you're setting Team on
GetPawn is the function name.
In multiplayer, it's a bad idea to use GetPlayerCharacter(0) or GetPlayerController(0)
from the playerstate cast i can get get pawn private
this is whats in front of that
the gamestate
this is pretty odd, but hey guess it works.
in my playerstate tehre is nothing but the team string var
this doesn't really matter whatsoever towards fixing your bug
Also further discussion on learning BP is likely more suited in #blueprint
@chrome bay I can't be certain, but I'm fairly certain that the max RPC size is a little over half of a megabit. At least in 4.26. I couldn't find the actual setting, but I did some fast testing with RPCing very large arrays of properties. All of the following array sizes send, one number up won't receive on server from a client through ServerRPC. Given that there's likely some slight overhead from the RPC itself and the array container, they're all close enough I'd assume that 65535 bytes is the max size.
int32
16,382 array size
65,528 bytes
FVector
5,460 array size
65,520 bytes
FVector2D
8,190 array size
65,520 bytes```
I'm running a test to see how many instances of our game we can fit on our dedicated servers. For some reason, it is reaching 100% cpu usage at around 13 games but I can continue adding games until 32 where it crashes from being out of memory. But even at 32 games the frame rate of our servers is still very good (58+). We are running 60hz servers. Does anyone know why this might be?
are all your servers having concurrent games?
yes
if you have full monitoring capabilities and your game is somehow very scoped within the resources of the server, might be the case that it's just convenient
but in these cases you better trust in monitoring values
We are using two different monitoring techniques. One is on AWS directly and the other is a node library. And they are both reporting the same results.
What could explain the reason that the servers don't dip further in frame rate if the cpu is already at 100% at 13 games?
where are you getting that percentage?
from aws or node?
how are you retrieving the percentage in the node app? how is it calculated, is it something the OS provides or is it calculated by the provider?
because in our case we saw degradation when we started pouring servers into our nitrado instance
maybe the CPU % you are retrieving is incorrect?
The node library we are using is https://www.npmjs.com/package/os-utils
So yes, it grabs it directly from the OS
os-utils (the node library) is saying it rises and then tops out at 100%. AWS and DO are both saying it rises and tops out at 90%
I see, interesting
It's strange though because it tops out at 13 games but we don't really see any server degradation all the way to 32 servers where then instances just start crashing because of no memory left.
yes I mean a 100% doesn't means you'll feel any degradation instantly
100% means that the CPU is busy most of the time (sys/user/kernel) time
so yeah in a way you'll find more context switches and slow downs that maybe aren't noticeable to a point that matters to you
however a 100% throttled CPU might cause issues with IO operations when required
you'd need a more granular monitor level to research these points
my recommendation is to keep the number as far to the 100% as possible
because that number doesn't for sure represent the full capabilities of your CPU
however it is what the vendor recommends to have a sane interaction with your system
As far away from 100%? There is a huge buffer between 13 and 32. So we could potentially be wasting a lot of money
as far as possible to the 100% to keep a 100% sane interaction with your system
it would just be a matter to test empirically checking monitors how much can it really handle if you want mostly save money
and you don't focus too much in the system integrity
so ensuring that your server time doesn't drop your acceptance levels
and you don't have any memory error or IO stall might suffice in your case
with hw is just about test-test-test-test hahaha
True, yeah we have been running longer tests
yeah, assuming server refresh and whatnot
Our games are only 8 minutes long
but yeah not only hardware degradation, software degradation is a thing
hahaha
UE4 is kind of funny in some aspects of it
👌 okay I assume that you do everything you need to do
I'm still not sure what you mean by this "as far as possible to the 100%"
Do you mean keep cpu usage as low as possible
okay, well yeah that would be nice but we are running these tests to try and squeeze more out of the servers
. take a look over here
and instrument your code
something you guys are probably already doing
it would just be a matter to check the timestamp delta to ensure that the reported server time is right!
Right, yeah we are doing all of that. Just wanted a sanity check on why server fps wouldn't degrade after reaching 100% and piling more instances on
Because I think our metrics and everything are correct
mhm, but yeah, you guys are more than aware of the issues that might arise when handling a system that is running at 100% CPU usage
you can tweak the knob until you find that sweet spot for your game
and always, remember to leave some leeway
I don't remember the specs of our servers, god damn it 😄 , I would share with you the data, but can't find it
How would we handle case, where clients has bad Internet, which is causing , sudden disconnects from server.
Is there any way to make it more resilient ?
Hey guys!
Help pls, already fighting with one issue for a few days. My android muliplayer app has few maps. Each map after few minutes GM calls servertravel to another one and so on (map pool is looped). It worked for a while, but now somehow game on client always crashes when travelling between certain 2 maps. It does not show any error in logs and can connect afterwise.
P.S. Maps are added to cook in ini files. I've also tried to "Async loaaad asset" on start of the map to prepare client to travel for next map, but it does not help.
I seem to be having a case where I spawn an actor, pipe a reference to that actor down through a repnotify, and then find the reference to be empty. Is this some sort of timing issue, perhaps?
Hmm, yes. That's exactly it. Putting a timer in front fixes it, though that's dirty as heck of course.
I guess the only logical thing to do would be to have the newly spawned actor call the actor that is dependant on it, when it actually finishes spawning.
what's the naming convention for a function that's only relevant on the server, but isn't intended to be an RPC? Still prefix it Server, or should that only imply RPC?
Authority maybe. I just don't prefix them at all but that's probably a bad habit
I think about it I think I actually prefixed mine as local.
does any 1 have experience with steam? im trying to open a overlay window directly in the market but i cant find any documentation for it
Hey folks, can someone help me here?
I have a pawn that has custom movement that's being smoothed out so it looks good even when updated only once a second. This is very similar to the KrazyKarts projects if you know it.
My problem is when I try to stand on top of that pawn as a character, even if I'm attached to it.
The character only seems to update position as often as the pawn is updated, which results in very visible jitter.
What can I do here? Smoothing the character with similar code as the pawn might not work properly since it already has Unreal's own CharacterMovement replication. Is there another way to go about it?
this is only running on the client associated with the playercontroller I call it on; what else do I need to do to get all clients to run it when I call from server?
I'm calling it from gamemode so the call context must be correct
it's a member of playercontroller, I'm calling it by getting any arbitrary player and that's the only player who runs it
@vocal cargo how exactly are you smoothing it? Like what is being set once a second and what is being set every frame?
maybe I'm misunderstanding; does netmulticast on an object only multicast to clients to whom an object is replicated?
so calling netmulticast on a player controller would never work
correct
well, it'd send to the client that owns that controller if it's different from the server
at least in 4.7 there was a bug related to multicast on playercontrollers, so it seems to have been possible
"Running a Multicast on a PlayerController causes bad things to happen because you're telling all clients to run a function on something that technically doesn't exist. Only the Server is aware of all PlayerControllers."
oh well there is that comment
so multicast is still an object instanced function and not a class function
makes sense to me
@dark edge doing it in a slightly modified version of this project https://github.com/UnrealMultiplayer/4_Krazy_Karts/blob/master/KrazyKarts/Source/KrazyKarts/GoKartMovementReplicator.cpp
(ref: KK_UEM) http://gdev.tv/uemgithub. Contribute to UnrealMultiplayer/4_Krazy_Karts development by creating an account on GitHub.
it works great even when updating only a couple times a second, which is great since there might be hundreds of these pawns running
Getting this to work with the regular Character just seems impossible
@vocal cargo is the movement smoothed on the server as well?
i'm failing to see how the CMC sees anything other than the smoothed movement
I don't think so?
Only the mesh and everything "below" it, is smoothed
the collision box only updates as much as the NetUpdateFrequency (3 times a second at the moment)
But even attaching the player to that mesh doesn't seem to do it
Hi, i have bug with DestructibleComponent, when i start play as client, my destructibleComp invisible, but collision worked, why?
also i can't find Fracture panel
for chaos
Hello everyone, I wonder for a top mmo game with unreal server on a dictated server how many players it can handle.
it's there a way to test maxium capacity ?
That would depend entirely on the game and what type of hardware you decide to run it on.
Ideally you would choose a baseline hardware configuration and then profile the performance of the Server with different Player counts to arrive at the optimal population for that hardware.
However this should be an ongoing endeavor as population and hardware configurations would change as the game evolves and/or you make optimizations that would affect the outcome of this process.
for a top view game, the rendering should be fine for most pc, since it render only what the cam see
A Dedicated Server does not do the same rendering as a Client. You asked specifically about Dedicated Servers.
Their requirements are entirely different.
thank you for the info, some said that with a good server it can handle over 100 players
Again, that depends entirely on the game, how well its optimized and the Hardware its running on.
If anyone throws a number at you without qualifying those points, the number is entirely worthless.
Agree, it's the client that render the graph not the server, the server purpose is only to tunnel data across the player
As an example, Fortnite has 100 Players, however it is extremely optimized (i would imagine) and it would be running on decent Hardware.
depend of the game too... like I said topview won't render poly as much third view game , yes optimisation is important.
topview game does't need LOD
Polygons aren't really the main thing to optimize in this decade
Graphics aren't the main concern with many players, really
I wish some people would use more polygons sometimes, instead of thinking they need a 16k normal maps. :/ Optimizing in the wrong direction.
Seems like people quickly forget that a 100 players also have to be supported by bandwidth. So you won't be able to do that without utilizing the replication graph anyway.
Most optimization I had to look at lately was pure code. As soon as you do "a lot" of something in UE4, it goes to sh*t.
Honestly my main concern is always "but where are the players coming from"
If you think you'll be able to matchmake more than 100 players you are being very optimistic about your sales
Totally, but the ones who think it's doable will not listen to that argument anyway :P
Literally top 0.5% of Steam kind of stuff here
I don't think I'd ever enjoy that kind of success. You become a business manager that has to handle multiple teams supporting one game rather than someone making games.
It sort of also depends what type of game. For games with longer continuous playsessions (so not really matchmaking), 100 seems plenty doable
I can see why matchmaking would be problematic (finding 100 people to go at any instant), but survival games easily pull that number as players trickle into a server over time
Now, stability on those servers is another matter entirely...
If your game doesn't have a concept of matches and you can join in any time anywhere, sure, but this is not exactly common
Right, but "common" makes a lot more sense when you include the context of the genre
It's the defacto model in survival games
In any case, even 100 players is laughably out of reach of small teams
Small as in, 2-3 people team
Anything that requires a dedicated server is out of reach for small teams.
Why?
Note, I said requires, not can use.
Because there's two requirements at the end of the day for dedicated servers. The first is cheating. The second is needing a server that can handle so much that it needs it's own application.
If you're worried about cheating, you need anticheat stuff. That requires either a lot of money, or a separate team(also more money). If you require the second, you also need a lot of money and support staff for your big ass game.
Either way, it's pointless for smaller groups to focus on that necessity unless you have a lot of capital to back it up later.
More practically, dedicated servers aren't great value for games with 5 players in each session, and if you plan on having more than 5 players online as a small indie, you've got issues
From my experience you can avoid the need of anticheat framework, if you maintain clean code and person writing code has in depth knowledge of UE4
The first is cheating.
Hasn't stopped many survival games from exploding, even when cheat protection isn't really a thing. Rust (while it does have anti-cheat) has rampant cheating. Arguably, this is more important for some games than others, but it certainly hasn't stopped the genre I care about (survival) from exploding.
The second is needing a server that can handle so much that it needs it's own application.
Cost wise? Survival communities are chock-full of cummunity servers, clearly it doesn't seem to be that expensive.
Most cheats are client side
(Really not trying to argue, but it conflicts heavily with the situation on the ground for various communities I'm part of)
Clean code doesn't help you much against wall hacks and triggers
Most of cheat occur because some loop hole was left and the person working on game feature either didn't had full idea about framework or missed some edge cases