#multiplayer
1 messages ยท Page 684 of 1
GetBaseAimRotation on the Pawn usually.
thanks!
hmm. I seem to have the server not replicating that properly. i see some movement, which is great, but it's not identical as the autonomous proxy
Depends on your setup. That's usually useful for characters. AI or first person. It's maybe less useful on some third person setups.
I have a third person character whose base animations I adjusted to use the pawn controller aim direction to do some bone deformation, but from what I see, only the pitch component of the FRotator is being applied instead of pitch + yaw
Ah. Yeah. You'll have some issues with that. GetBaseAimRotation uses the character's Capsule's Yaw to determine it's Yaw. It's already replicated through movement so there isn't a need to replicate it again so they determine it from that. Less useful if your camera looks a different direction than your Pawn. ๐
It's a virtual function though. You could add your own uint16/uint8 yaw replication and override it.
oh. great!
FRotator has some functions that make compressing Float axis to uint8 and uint16 very easy.
great. it works! thanks!!
Hi! I have some code that spawns a bunch of actors when the game starts, I set the event that spawns them to Execute on Server, but the actors it spawns dont appear on the client
I was told that Execute on Server automatically replicates it to the clients, idk if it does
No it doesnt. Execute On Server does what it says. The logic executes on the server. There is no replication to clients. That is done with Multicast for Multicast called from Server.
I tried multicast but then it didnt appear on the server
You're not giving enough information to trouble shoot your issue. There are many reasons why that could be happening
Trying things, and things "sort of working" isn't helpful.
there is stuff on both screens, but their position isnt synced
Throwing nodes at the problem doesnt help you
you need to understand the basics of what you're dealing with
sorry, let me back up
I have some code, it randomly spawns actors in a world. It is connected to a event, the event is a Multicast event. When it executes, the clients screen and the servers screen have the actors in different locations.
Well are the actors supposed to be replicated/in sync?
yes
Then you cant spawn them in a multicast
You're going to need to spend time understanding the basic Multiplayer concepts or you're going to keep running into similar issues
If you want something replicated, you can only spawn it on the server
UE's networking handles the replication aspect to all clients for you
so change it to Execute on Server?
I am very new to ue, pretty sure you can tell. sorry if this is basic stuff
Yes, which is why I'm advising you go get a grasp of the basics instead of trying to solve this one thing
If you need something that spawns at gamestart on the server
this means you dont need an "Execute on Server" event
you just need to run that logic on the server
because otherwise based on where you place it, you risk executing it multiple times
once from server and once from the owning client, replicated to server if it's executed on an owning client actor
The multiplayer solution for each solution depends on what you need to do
if you're new to UE I would -very- highly recommend starting with exploring in singleplayer
and later adding multiplayer to your learning curve
thats what I have done
the single player is complete
Are you trying to turn your existing singleplayer game into a multiplayer game?
yeah
Scrap that, start fresh ๐
the game is meant to be both
like scrap mechanic
or minecraft
I want singleplayer and multiplayer
Since you're just learning multiplayer, I would suggest making a new project where you do that
instread of trying to transform your exisitng SP game into am MP one
the single player game is super simple, it isnt much work to turn it multiplayer, I just dont know how to do it
the main game is literally picking up and placing objects
As you're learning multiplayer you're going to make mistakes
yep
it's more prudent to do so on a clean slate and then once you're comfortable with it
return to your SP game and turn it MP
But that's your choice at the end
alright
Generally speaking, anything replicated: spawn on server, modify on server, dont touch on clients
how do I make sure it spawns on the server and server only?
the actor that spawns it all is on the level
that the client and server have
You can have your GameMode::BeginPlay
gamemode only exists on the server
There's an "IsServer" check that you can do otherwise
assuming the code runs on both client and server, you'd check where you're executing
oh, that makes a ton more sense
thanks
I really appreciate it
I tried that, it says it runs successfully, but I dont see anything on the client or server
I used a print node to check and it printed
Is this the right place to ask for help with a Linux Server that was built from Unreal Engine Source?
I am having tremendous difficulty getting my server running. Please @ me if you think you can help.
Whats better EOS or Steam?
About to buy one of them, I need to set this up today.
Both is free?
Steam is literally the market leader for PC games by about 5 times the next one
So like, you are selling there no matter what
The $100 fee is for that
Using the online stuff has no additional cost
That's Redpoint's plugin, not the EOS itself
So can someone point me in the correct direction on what to do here? ๐ Ill pay for anythign I dont mind,
There isn't one correct direction
You dont have to pay for anything, those plugins just make implemented systems more accessible
Arguably Steam is 90% of your sales, if not 99%, and Steam users will hate needing more account setup after buying the game
EOS is only useful if you ship on non Steam platforms
Steam does not require any plugin
Since you're not sure which one you want to use, I need to point out that you don't have to pay for anything until you're ready to publish. You're not ready to publish if you don't have your online subsystem set up yet.
You need 10 lines of ini files from the UE4 doc for Steam - and you probably want the free advanced sessions plugin for ease of use
That's it
this is making a lot more sense
google is a bad place for information like this lol
That's just steam utilities on steroids
Handy plugin, works well, but most of the times you dont need it
If you only want to connect people to lobbies etc. just stick with advanced steam sessions
I only used the dedicated server button for almost 3 years now.
lol this is going to be fun, (sarcarm)
thank you guys ๐
I have some code that spawns in a bunch of actors randomly when the game starts, I want it to replicate to the clients. I have put it in my Gamemode class, and I know it triggers, it just doesnt show the actors for the clients. I know the code works, because it worked on a different actor.
Your spawned actors need to replicate.
Should probably be a default on the spawned actor's class.
Normal Replicates. No need for replicated movement.
that didnt work ๐ฆ
got this error that crashes my server and I'm not sure what to do about it. don't even know why the server is concerned with materials anyway
Thanks for your help earlier! I finally got it figured out. Turns out (surprise, surprise) that it was my fault and not the engine's ;). I was copying a whole set of actors from a "template" location to it's play location and it was also copying both the player pawn and the player controllers and doing weird stuff with turning off replication. Incredibly stupid and obvious in hindsight...
When replicating a skeletal mesh component, do the mesh and material variables in the component not get replicated too? I'm struggling to understand how to change the mesh and materials on the server and have them replicated to the client. The mesh and materials of the replicated component are always None when i access Skeletal Mesh and Materials in the RepNotify of the skeletal mesh component on the client. Should I not be replicating the component and just try to call a client function from the server with Skeletal Mesh and materials as parameters?
we dont replicate meshes
we do replicate what alterations the player has and set them in the OnRep
on the character actor itself
Ok thank you, so I can't/shouldn't keep track of what modular meshes a character/player has in playerstate? I would just set the meshes on the server and have the character replicate to the client?
that is design choice
Curiosity question, is there any difference between replicating a int8 and int64 in sense of CPU overhead?
Very unlikely
Guys is it possible to create a Multiplayer game completely out of Blueprints?
Yes, but blueprint is somewhat limited.
Where exactly would I need to start implementing C++ then?
Hey all, just wanted to check my understanding.
I have setup a networked jump and crouch.
The crouch is just a single bool update, so on input just run a server event that updates the bool, then also update it on local.
The ABP updates according to this.
(I still need to add the capsule shrinking accordingly.)
For the jump, since it actually performs more logic,
the flow i have is
Run Server Event -> Server Event Multicasts Jump logic.
It is running, but I want to make sure I'm building the correct knowledge.
I've attached pictures of each of these.
Is this roughly a correct flow?
Thanks!
Please review this question this is important to me.
Two questions about dedicated server hosting. Basically you can host a server on any cloud provider. Unreal doesn't care.
You make a server package from Unreal, copy the package to your cloud VM and run the executable.
At this point you can connect via IP address. Next problem is how to advertise the server to users, and how users can search for servers. This is where Online Subsystem comes in.
Sure
github does not provide server hosting
Probably fine, but sounds like you're a long way from that stage. Make a small game first! You can't rush games especially where networking is required.
Hey there, I cannot find any doc about sending a potentially large amount of data from server to clients.
Use case is to send necessary information at logging.
Unreal does not seem to support TCP out of the box and I'd like to keep things compatible with Steam anyway.
I can always split data through RPCs "by hand", but I wonder if something is already done for that use case/is a known practice?
I don't believe there's a good way to send large amounts of data like that built-in. That said, raw TCP and UDP sockets are supported, and as you mentioned you could just chunk the data and send it via RPCs. You might want to look at custom network serialization for your data - if your data is in a custom struct you can implement custom network serialization for it and it'll "just work" with an RPC. I'm not sure if/how unreal's network protocol chunks large packets but it's worth trying.
One note - if your data is a large amount of "something" in a TArray then you'll have issues without custom serialization - last I checked (which tbf was a while ago - this might have been fixed) TArray has some hard limits on how big it can be when replicated over the network.
Listen servers are an option, yeah
Some of my info is indeed outdated - there's some more info on tuning for large datasets here but RPCs still aren't ideal for it - https://forums.unrealengine.com/t/replicating-large-arrays-and-data-sets/265029
Dec 2, 2020.Knowledge The replication system in Unreal Engine was built and optimized for relatively small amounts of real-time data required to maintain the simulation state of an action game. Unfortunately, this means that the system isnโt as optimal for some other use cases, like synchronizing larger data sets or larger arrays, and we donโt ...
Thanks a lot, that's very informative.
Hi guys, does the FFastArraySerializer can't replicate MaxAvailableCount and GroupType etc ?
Does FFastArraySerializer only replicate FFastArraySerializerItem ?
Hello guys what service can i use to make Android Joining with PC same session ??
Ive tried Playfab but their servers became very expensive
Simple question : The Steam Advanced Session plugin is free, but does that mean you're forced to publish your game on steam to make it work, and pay the 30% that Steam asks for when you make a sell ? Or is it possible to use that plugin but even if you publish it on the Epic Game Store or use no game platform (like people need to go to your website to download it for instance) ?
Please ping me if any answer ๐
The plugin is just a bunch of Blueprint nodes on top of the engine's Steam support so it's less a plugin thing and more of a Steam thing, but essentially yes
No one wants to buy on EGS a game that requires Steam
I'm confused by your answer ๐ค
Which part ?
So is it possible for instance to be able to buy the game from my own website but use steam to handle the invites between players and other stuff ? Or is it mendatory to publish my game in Steam to be able to use the Steam Advanced Plugins ?
And also will it work only on Pc or for consoles too ?
It's not technically mandatory AFAIK but it's both supposed to be the case (and just not enforced by Valve) and every PC game is on Steam for obvious reasons
No, won't work on consoles or mobile
Arigth then does an other plugin exist (an advanced session plugin) to be able to use those on consoles too ?
Again, advanced sessions does not add Steam support
It's just easy Blueprint mode for existing engine features
this part I don't understand it
Unreal has builtin Steam support
What do you mean by "add Steam support"
AdvancedSessions is just five blueprint nodes that show up in Blueprint for people doing multiplayer games without C++
There's no need for it in C++
So it's not linked to Steam by any mean
because the tutorial I'm following uses that and said it's for steam
What you're really asking is whether the engine supports more matchmaking backends on PC, and it doesn't
There's a plugin that adds Epic Online Services, that does work on console, check with your console manufacturer for details
Won't be nice on Steam due to the double login though
No what I'm asking is if I'm using that plugin am I forced to publish the game on steam so it handles some part of the multiplayer like linking the players between each other or can I use that plugin even if I don't publish on steam and also if it will work with consoles
so consoles you said no
but Epic Online Services aren't blueprint yet, if I'm not mistaken ?
The plugin is very literally just the engine's generic session system exposed to Blueprint
That's it
It's not Steam related (works on NULL OSS, and should work on any online subsystem that's in the engine, plugin or built in)
If for some weird reason you don't sell your game on Steam, then no you shouldn't rely on Steam for matchmaking
I'm still confused.
What I need is this :
- Something to do the matchmaking : What I need is people being able to create a session and it shows in a list and other people could join (like Among Us for instance)
- Be able to have it working on Consoles
- Have Cross Platform (But this you explained that I need to talk with Sony and Microsoft) but do I need something specific to set up before starting doing the game or it could be done later ?
As to EOS there's a plugin, no idea what it does since I ship on PC
Something to do the matchmaking : What I need is people being able to create a session and it shows in a list and other people could join (like Among Us for instance)
Either Steam, EOS, your own service
Be able to have it working on Consoles
Either EOS, the console service, your own service
Have Cross Platform
Ask Sony and Microsoft about it
Thank you, it's clearer for me ๐
Now about EOS, is there any tutorial to follow to do that ? Because the video I'm following right now says that EOS aren't available yet as blueprints (so only C++)
Personally my advice would be to make a PC game, on Steam, with advanced sessions - it doesn't sound like you have huge game development experience and maintaining a cross platform multiplayer game is just madness
That's a well documented path that's already quite difficult enough
No I really need to be consoles too (maybe later and I don't want to redo my whole game to be adapted to consoles)
You don't really need to
yes I do
You want Blueprint only cross platform console matchmaking
Respectfully I think you underestimate how hard this is
Then at least no cross platform but being able to publish to consoles and consoles players could only play between each others
Blueprint only multiplayer, Blueprint only console, are already two very suspicious things
As in they don't really work
Anyway, let me reiterate my advice : assuming no crossplay, there is no good reason to avoid Steam on PC
the 30% cut off is a good reason to avoid Steam
It's really not because in reality, no one wants a PC game that's not on Steam
Other than freak hits that have massive appeal
Anyway, you have EOS, Steam, and each console's online system to consider
Try them out and make your choices
thank you
For what it's worth I think we had about 1000x more sales on GOG and Steam than the almost-free itch.io
And it's somewhat documented that the 12% cut EGS also fails to seriously compete
I'm more thinking of my own website to buy the game like how minecraft does
With your own update system, payment processing ?
payment processing will be handled by another service
Payment processing + VAT is like 15% already
If we're being honest about numbers here
Though obviously Steam's 30% is also after VAT, but like, it's not going to be a zero cut operation anyway
Anyway, good luck
of course but between 5 to 10% is a faircut, even more for indie devs. I could understand for big companies to be 30% but for small devs it's alot
It's also completely pointless if the platform makes 20% more in sales
So I'd argue it's literally the opposite, your indie game can do 5 sales or 5,000
Your AAA game can make 10M or 20M
Those numbers are wrong
Among us is the proof
The average indie does like 500
Lots of them do 50
I'm 100% on board with Steam's cut bordering on extortion, but you can't act like indie games have extremely random sales outcomes
If you're completely convinced that Steam can't bring you 20% more lifetime sales than your website, good for you
can you think of a reason why gameInstance can't call BPI in playerState? i load my save game then try to set some values in the playerState but the call never happens no matter how i try with interface or getting playerstate then doing something with it etc. Whether I try directly like this
or with a BPI like this
ah because Game Instance exists before other stuff ๐
What's a good design practice for updating actors randomly for server/clients, for example changing their material to a random one at the beginning of the game. Currently I am doinog a MC on beginplay from the server and trying to fix the issue where clients arent loaded in yet but overriding ready to start in gamemode. I do this for a lot of actors and I'm sure I could do some some sort of interface calls to update the actors once everyone is loaded but worried because then pretty much every actor i have i would have to add some sort of check if loaded logic on beginplay.
@hexed thunder State based things should always be replication. If you're worried about performance costs of replication then a replication graph or maybe the pushmodel stuff would help. But you cannot reliably do what replication does with RPCs without even more overhead.
No but imagine I need to move an actor, that the server has moved it to a random location, you can't replicate move actor location
Why not? You can use Replicates movement, or set a replicated property with on OnRep.
Yeah you can, but there are some things I have felt I have run into that that may not work, also how would OnRep work if Server changes variable but clients havent loaded in
The clients would received the replicated property once they've joined and that actor became relevent.
True yeah I like your idea, do you think people generally do this sort of way?
I feel like this sort of problem has been solved thousands of times, but was having a hard time finding example/solutions for this problem
Usually. Replication is harder on the server than RPCs because it has to check for replication changes. But it mostly promises consistent state between client and server regardless of when client logs in.
I wonder let's say you generally have like 2-8 properties per actor that the server is going to generate, it may be better to create a struct and just RepNotify from a struct per actor
Depends. Probably. Just don't forget to NetSerialize if you're using C++ and you're not always using all of those values. Will save quite a bit of data.
so would this not be solved with readytostartmatch either? Ideally BeginPlay for server/client actors dont start until match is ready to start then this problem is solved much better right?
That depends. If you don't let clients reconnect, then you can solve it that way, sure. But even if you wait for match start, make sure all players are ready, and then one player DCs, and reconnects, he has to load the map again and will have none of that RPCed state.
@hexed thunder Also one other consideration is to not replicate a ton of different states. If you can at all randomize these from one or a couple of values, you can place those someplace like GameState, and simply let all actors set themselves up locally from those replicated values.
That's more for setup though. Wouldn't handle runtime movement or anything. Can cut off a lot of data use though.
Oh like maybe generate all these random values from GameState, Gamestate replicates this, then clients just reference gamestate when accessing that data or I guess i would repnotify from gamestate to update the clients object with that data
Please no
please please use Steam please
i'm so tired of games using their own launcher or relying on custom websites for no reason, Steam is great, manage alot for you, easy to use for your users, there's really no reason you should have your own website or launcher or anything unless your a big company with alot of franchise
or atleast use some popular indie websites like itch.io or other
But Stranger said if I use the Steam thing to handle multiplayer I won't be able to have my game on consoles and I need that. Yeah why not using Itch.io but Steam takes 30% and it's alot
well anyway for consoles you're going to need to ship it to theirs stores
I don't think that it's either or. You can put a game on console stores and Steam.
Your website could link to both. Website encouraged, but selling directly from it probably won't go well.
But we were talking about the Steam Advanced Session plugin
steam advanced sessions is just a plugin to provide facilities for the steam api
to blueprints
I need a system to be able to create a session and find sessions
You can also use multiple online subsystems for the same game.
but advanced sessions works with all online subsystems that is compatible with the session interface
advanced sessions != steam only
advanced sessions is shipped with two seperate plugins:
- Advanced Session, the one providing you the advanced session nodes
- Steam Advanced Sessions, the one providing some utils functions for Steam only
But could I use both ? One for steam and one for consoles ?
you can use advanced sessions without problems as long as the online subsystem you use is compatible with the session system
I'm going for the EOS
so for example when you enable the Steam OSS you're going to use the whole Steam online subsystem for sessions, etc
for console you could use Xbox's custom OSS/Sony's custom OSS (I don't really know how its implemented for console tho)
I just need to read the documentation to set it up
@vagrant grail is this your first game?
That's not nearly what I said, fwiw
yeah EOS could also work, but with Unreal's online subsystem system it's abstracted away so you don't need to manage all OSSs cases
nope
so you can make code that works on steam, xbox, ps4, switch, epic games launcher, etc
Then I understood it that way, sorry
I wouldnt even try to thing about different platforms until u can make ur game work on 1 platform to be honest if it's your first game too, its nice and easy to say you can support cross platform but you'll most likely give up but if u focus on 1 platform u have a shot
in my opinion anyway
You'd think that's common sense, right ?
Yeah my first goal is to have a game on pc first. But after finishing the pc version I won't publish it until I have consoles version because I don't want my game to be released on PC first then 1 year later on consoles. That's why I'm asking if I used one system or the other could impact development for consoles or cross platform later, like having to rebuilt all my game because I didn't choose the right system in the beginning
Simple question do you want voice chat in your game?
yes
Oof
lol
?
I think literally everyone here agrees that this is a 50 person team's job
Cross platform voice isn't solved very often, I think fortnite solved it? but i don't know who else
Well. Indie dev might get away with it, but voice chat in games recently became a nightmare.
I want cross platform but it's not mendatory, like If I can't do it it's ok. But I need my game to be playable on consoles and pc (pc with pc players, and consoles with respective consoles players)
So on the simple point of wanting voice chat in your game, focus on PC, you're gonna want features you won't be able to have cross platform
tried using UE4s builtin voice chat with Steam OSS, crashed with every server travel so I rage-quitted VoIP for now in UE x)
As far as the business side goes, cross platform is paid, as far as public information goes; console take cuts similar to Steam, and voice chat legally requires text to speech and voice recognition
Just so you know
But everyone's been telling you this is a doomed project and you have yet to believe anyone here so ๐คท
I got VOIP to work on seamless travel, definitely wasn't easy but not too bad
EOS gives a chat system.
Yeah consoles take a huge cut like Steam but if I can avoid it on PC it's a benefit for me. Consoles there's no alternative so it doesn't matter
quite interested to know how you did it
Zino devaddict on youtube has a good video on it
why text to speech ?
At this point, Voice chat isn't even about getting it to work, it's all the extra stuff you need with it. Just isn't worth it for even an indie company. Make them use Discord.
oh, gonna check it out thanks!
Legal requirement in the US
AND voice to text
Which is 50x harder
My game would be close to what among us do, and for instance playing among us in discord isn't fun the same way as voice chat with distance and other stuff like that
What ? I'm not asking about something converting voice chat to text or vice versa, I just need a way to speak ingame ...
show me the law please
Communications and Video Accessibility Act
You can google it yourself frankly
It's not exactly a secret
Next up you'll discover that game rating agencies have to okay your game on console
so no way to solve this ?
Sure, just call Nuance or whatever they go by these days
They'll give you a nice 5 digits price
There is vague information around it. Video games have managed to evade it for a while, but there have been issues with that lately since 2019. It does state "within reason", but that's a very vague term.
Hold on as sec. Are you telling me for instance Among Us did something for people with disabilities as they have a voice chat in their game ? Or paid a 5 digit number to a company to do so ?
It's makes no sense to me
I'm assuming that from what you said above
Read up on it
You know what, fine
apparently x)
proximity chat if you prefer
played among us like 2 weeks ago, no sign of voip so I don't quite understand what is going on here xD
I don't think you're actually listening to anything said here, so I'm not going to lose any more time here
When you're close to someone in game you can talk with him and when you're in the thing to vote you speak with people
oh wait maybe it's a mod
I think yeah ^^
I need to check how they did it on consoles to see if there's a voice chat or not
Then I'm gonna just put a chat text you can type in and it shows above your head, is that ok ? Or there's another law about that ?
And also I don't understand then why would Epic have that in their EOS if people won't be able to use if they don't have enough money to pay the 5 digits to a company
yeah
yeah I'm not from the US anyway
yeah
Can anyone provide any insight on this question?
@blissful slate Out of curiosity, why remake the system? I'm assuming you have a Character class. It already has both crouch and jump which are replicated states.
Mostly trying to make sure I understand the flow of replication and how this would expand to other actions
Hehe stranger 
Hey guys,
I have one weird issue , where i store the Transformation of each actor into a json structure and store in our database(server). Next time when i join the server i respawn the actors, but actors seems at different places when i join from windows client or Quest Client.
Can someone give me some idea what this can be about ?
As an indie I had zero idea this law had been updated in 2019 to apply to games with specific comm models, thank you for posting
Hey, I'm trying to do a Server build in UE5 but I'm getting the error: Server targets are not currently supported from this engine distribution.
I'm also getting this error: Microsoft.MakeFile.targets(45, 5): [MSB3073] The command ""C:\Program Files\Epic Games\UE_5.0EA\Engine\Build\BatchFiles\Build.bat" AzarServer Win64 Development -Project="C:\Users\Ehsan\Documents\Unreal Projects\Azar\Azar.uproject" -WaitMutex -FromMsBuild" exited with code 6.
could this be happening due to a version mismatch? My uproject folder's EngineAssociation is 5.0 (not early access) but the folder says UE5.0EA
oh really
how do you make a dedicated server then?
I think that's what I'm doing. I made a new build target called Server.Target.cs
but ok let me read more
ah
that's it
i guess the reason you compile it yourself from the engine's source code was confusing for me is because I do have the source code locally in my IDE and I am able to modify it
curious why pulling it from github would change anything about that
Right now you have the source code, but the engine operates from binaries
You also don't have the full sources, just the engine itself
There's no way to modify prebuilt engines, has to go through actual source build
interesting. thank you!
Would anyone know why like let's say a child actor of another actor doesnt load in for clients on seamless travel? all actors seem to load fine but seamless travel some actors aren't loading in only for clients and theyre not being spawned, theyre part of level
is that just cuz child actor components are super buggy?
or something specific to server travel
difference between the branch 5.0 and the branch ue5-main?
is the latter less stable/more features?
hahaha
Why are child actors more buggy?
Actors are not supposed to be attached that way and the result is fundamentally broken
I see ok thanks
Is there a better way to handle a need then of like a blueprint that places mul;tiple blueprints for u in a level?
A vehicle for example could have different components you want to be interactable, so it would seem logical to create child actors for interactable components, but then if theyre buggy i would have to put like 4 blueprints in the level each time instead of 1, which isnt too bad
I would just call SpawnActorFromClass from the blueprint of the vehicle, and make it so that the classes of actors you're spawning have replicated set to true
if you want them to be physically attached you can attach them at a socket or bone
but they dont have to be in the same object hierarchy
true that would be interesting
The server only needs to do that or just allow everyone to do it by default,
if you want the vehicle to be able to reference all of the shit it spawned, you can put references on an array on the vehicle
if you do it that way, you spawn everything from server and set all actors to replicated: true. if you do that you wont have to deal with custom RPCs
Ok and since you set it to replicated to true, even if client hadnt been loaded in when u spawned or reconnected, it would replicate that actor to client joining back?
yeah
that would be a problem if you spawned the actor via a multicast RPC or if you spawned it just on a client
Is there any way to override a OnRep function in a child class?
you could make the parent OnRep function call another function/event that you create OnRepOverridable and override it in child class

sounds a bit hacky, but I'm up for it
lol hey if you know a better way go for it
nope nope. lol
@toxic lionI don't think there is in BP. In C++, you just mark the implementation virtual.
Thanks this worked easily enough in BP
Awesome, great to know. I'm prototyping now in BP before writing the class in c++
Is there something similar to set controlRotation for set location?
or is that done strictly by add movement input and the like
To set a specific location it needs to be set on the server and client. You can do this with an OnRep or ReplicatesMovement setting. Normally movement components are used for pawns since they move so frequently.
yeah, my context is a slight bit different, I have to figure out how to update a mesh location based on where a players HMD is at without using setRelative on the mesh
and there's no actual controllers in use, just an HMD
And this needs to be shown on all instances of the pawn?
yeah :/
well
maybe not, that's food for thought
I think definitely for local client plus server
Hi I have an Server RPC that takes in a weapon array and changes the weapon array (replicated) stored in a chest.
~ UFUNCTION(BlueprintCallable, Reliable, Server) void Server_ChangeWeapons(const TArray<TSubclassOf<ASWeapon>>& NewWeapons); void Server_ChangeWeapons_Implementation(const TArray<TSubclassOf<ASWeapon>>& NewWeapons);
void ASChest::Server_ChangeWeapons_Implementation(const TArray<TSubclassOf<ASWeapon>>& NewWeapons) { CurrentWeapons = NewWeapons; }
Unfortunately only the server can seem to make changes using this blueprint code.
Here prints the array of weapons im going to set the object with, and it prints the correct weapons. However if i print the weapons stored in the chest after setting it with the rpc above it prints wrong items. So clearly the RPC is failing and only working from the server. So my problem is that the client cant seem to change anything in the chest using a server RPC. Any ideas?
@pallid canyon This sounds like a client authoritive thing given it's from client's input. I'd start by making a replicated variable. Mark it Skip Owner. Do your stuff locally so that the local player sees it correctly.
For other clients.
Make an unreliable ServerRPC that sends the relative location to the server. Send the current location that you need through, set it on the server and also set the location here(for listenservers), then also in an OnRep for this, you'll set the item's location there for all non owning clients.
Doing that will give you a snappy, jittery version. Add some interpolation to currently server set state and it should look okay.
so the problem with relative location is that I'm setting the actor rotation based on HMD rotation through Controller->SetControlRotation, so my HMD relative location is offset from actor zero and then rotated about that actor zero
@royal vault Does the client making that RPC call actually own that chest? If not then you can't have that chest RPC from that client.
unless you're saying actor relative location, I fear will have the same problem though
if you mean by widget owning player, then yes
Actor ownership. By default clients own three actors. PlayerState, Their possessed Pawn, and those two object's Owner, the PlayerController.
If that chest is not set(On the server) to be owned by the PlayerController, or something owned by the PlayerController, then it cannot ServerRPC
so the chest needs to be a pawn?
Can all players affect this chest?
couldn't you just RPC to server to say please set weap array, then multicast/run on client from the server the array back to character?
if i removed all replication then yes everything is stored correctly
it just doesnt replicate to the other players
cuz then you dont have to trust clients not to cheat
o yea i tried that
i did a server rpc that ran a multicast
If the chest needs to be used by all players, you need to send the RPC through one of the other actors that the client owns.
wait im wondering something
(const TArray<TSubclassOf<ASWeapon>>& NewWeapons)
does the const
mean i cant pass anything through?
No effect change.
This is literally nothing more than an RPC issue.
ServerRPC invoked from a Client on a Server or Unonwned actor. It's dropped.
ohhh
so i have to send it through lets say, the player character?
Or controller, or PlayerState, yeah. You could even make this something as vague as an interface call. Get the local player's controller, and call a ServerRPC that takes a UObject* and TArray<TSubclassOf<UObject>> as parameters. Have an Interface function implemented in the chest that you could call on the UObject* and pass the array through it.
Only necessary if you plan to pass class arrays to other things through maybe. Just depends.
Conceptual question, so I have physics actors in my levels that I replicate movement on so out of 100 actors in the level, there may be 10 that are replicating movement and have physics enabled, so clients/servers interacting with them all see the current movement state and 99% of the time there isn't a desync issue when I have the net priority above 1.0 (currently 1.2). When I had it at 1.0 it was common for some of these physics objects to get desynced for clients and server. Why would priority fix a desync issue or appear to fix it? Is it because net priority. It does say higher value means it means more likely to replicate. So is this just making it more likely to keep replicating movement for everyone so there is never that desync issue, on top of this is there a better way to handle desynciing? I would imagine unreal engine would have some timer base ability to just grab certain actors on an interval and make sure their location is the same as the server for clients? just ttrying to get my head around this topic a bit more.
alr ty!
My idiocy has been a constant companion, so I figured out what to do. Add movement input would constantly snap my mesh back to default rotation and position regardless of where HMD was.
Because the mesh was marked relative to parent. I tried to work around it by manually setting controlRotation
when I could have
just made the mesh relative to world
...
tysm it worked
when you set a variable in a player's state via a server call, then try to get the same variable from the playerstate in the client, its not the same
is that intentional or am I misunderstanding networking RPC
I thought everything in playerstate is replicated, meaning however I set it its the same
@gaunt cliff Assuming that your property you set is a replicated property. If you're sending a ServerRPC and then checking the value on the client in the same execution it won't be the same. Client will still have whatever they had before until the server can replicate it back.
This is why you need OnRep functions. You RPC to server, tell server to set the property, and then wait for it to replicate back which will call the OnRep function when the property arrives on any client
wait, do I need to specifically set the variable as UPROPERTY(Transient, Replicated) ?
At least Replicated, yes. ReplicatedUsing=FunctioName if you want an OnRep to run.
Transient won't matter for networking I don't believe.
The only things that will replicate are properties marked Replicated inside of a Replicated Actor, or Replicated Component that is part of a ReplicatedActor.
We are creating openworld survival game and its replicated to work in editor. Now we would want to make it work server so somebody can host server and others join. That for testing and later buy cloud hosted servers maybe. How would we start making that dedicated server? Any good tutorials?
Same style like in Rust or WoW
Player controller ID is not accessible on other clients right?
other than the client with the ID in question
no, player controllers exist only on server & owning client
what about bisplayercontrolled
that is only available on server and the owning client
if there is no controller, then its a remote player
thank you
i wouldnt use the Get Player Controller with id stuff in a multiplayer game
Well I managed to uniquely identify PCs elsewhere in my project. But I used a different setup here so I should look over what I did elsewhere. I broke my brain for today got nothing done even with 12 hours grind ๐ฆ
I used controller Id pair from game state or something like that. To give different players different colours
Random fun fact. GetGameInstance->GetFirstLocalPlayerController() is about 48% faster than UGameplayStatics::GetPlayerController(this, 0). It also is not prone to listenserver explosions.
Start here
https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/HowTo/DedicatedServers/
If I had a multiplayer game where 4 people matchmake to find a game, or where you can create rooms with friends, or queue with a party (2 in party so find 2 more players or another party of 2), I would probably look into having a dedicated server run on a service like AWS. They say they have a "multi-location fleet", so if 4 players were matchmaking from 4 different regions, AWS would handle finding the best server between these people? Or would it always default to whatever location I have my EC2 instance set?
Well it's not like it would be running off just that ec2 instance, still trying to wrap my head around how their gravaton instances and gamelift service works
@twin juniper i built the engine from source. whats the cleanest way to replace the binary build copy with my newly downloaded engine?
fuuk
what the best way to do that
i right clicked it and a menu came up
nothing happened
haha.
they're both on 5 tho
i see
it
so it seems to be working
build times are outragous
is this my new life?
also should i be checking in the entire engine into source control or how will this change propogate to everyone else?
i dont mean build artifacts
i mean if i make changes to the source
which i dont exactly plan to do but now that i'm building from source i can
So, I just want to make sure I'm not missing an important replication detail with a hypothetical scenario. I have an actor who holds a cupcake (like in the content examples) and I want, when a key is pressed, for him to toggle the visibility of his cupcake. Which works just fine as shown below:
But in this case here, where the actor only ever sets his cupcake to hidden once:
Is there really no way to achieve the same functionality (making the cupcake hidden in a replicated manner that is still safe for when players join after the start of the game) without the use of the rep notify variable? I ask this because in this example the variable serves no meaningful purpose other than to be a rep notify. Thanks in advance :)
There's no other good way to handle that if it's state based.
Replication is the main consideration which is mostly for the Server's CPU use. On a side note, if you make the component replicate instead, Visibility is already a replicated state.
This makes sense, thank you! Itโs just unfortunate, I wish there was a cleaner way to do one off replication, but I suppose this isnโt too bad, especially if I donโt forget the basics such as component replication it might not occur as often lol ๐
How to replicate TestInt or test in FFastArraySerializer?
It seems that FFastArraySerializer only replciate Items
@pallid moatI'm not sure you can. Items is the only thing replicated I believe. If you needed that, you'd probably have to replicate them on the Actor itself, and then OnRep, set that property in the FastArray struct.
Thanks, actually have a lot of extra property in FFastArraySerializer and other Fast Array, so i wonder if there is a way to replicate in struct , i found some code like below in Engine source code, but don't know how to do like that
if(bSomeBoolSetInConstructor)
{
DOREPLIFETIME();
}
Is it safe to do something like this?
I'm not sure about that specifically, but I have at least changed replication types in the same manner.
Replication types? You mean conditions?
I question whether that would work. Conditional property replication is already a supported feature, just not like that - https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/Actors/Properties/Conditions/
mmm yeah, so GetLifetimeReplicatedProps is called on the CDO so it'd work fine for a specific type but not if you changed it per-instance. Per-instance changes would need to be done via conditional property replication.
This doesn't seem useful at all though - there's already a way to modify replication conditions in subclasses.
Can we make it not totally replicate by that?
I want to disable a replicated property completely based on a condition
yes
RESET_REPLIFETIME and RESET_REPLIFETIME_CONDITION macros let subclasses override parent classes replication conditions.
used in the same way as DOREPLIFETIME and DOREPLIFETIME_CONDITION
if you need per-instance replication conditions or changes to an instance over time then you need custom replication conditions which are mentioned in the link i posted earlier.
There's also a macro to disable a replicated property as well in a subclass.
RESET_REPLIFETIME should do that
I thought that enabled a disabled one?
The two I know are these.
DISABLE_REPLICATED_PROPERTY
DISABLE_REPLICATED_PRIVATE_PROPERTY
๐ฅณ
err yea, those
Thanks for the infos
Hi, if i spawn a replicated actor from client, i will be able to destroy it from client ? ๐ค
it's actually just to do a fake projectile for fx and debugging
Any actor spawned on a client is local only and will have zero networking capability as if it wasn't replicated at all.
thats what i was thinking ๐ just wanna be sure thx !
Quick question, where is the best place to put game end logic, in game mode? I have some logic that, first wave enemies all died the second wave will appear, or 60 seconds later the second wave comes, and the end logic is that if all enemies are all died. Where should I put those code into?
Game processing logic should go in GameMode and use GameState to relay anything it needs to to clients.
Why it needs to go through the game state? like the game state exist in each player client, the game mode only exist in the server right? Thanks
Correct. GameState is GameMode's way of replicating stuff so that it doesn't have to exist on clients itself.
Of course you can put anything on GameState that is game wide related, but it's original idea was as a replicated state actor separate of GameMode.
If I wanted to switch the serverโs map through an in game widget (dedicated server), could I just put the server travel function in the game mode with a has authority check and cast to the game mode and call the function as the client?
Asking here to see if Iโm missing something because I couldnโt find a clear answer online.
Thank you so much
clients do not have access to the gamemode.
So where would I put the function to call, just make a function library?
Whatโs the way people normally do it
You can't server travel from a client. You would need to put a server RPC on something that's replicated and owned by the client... which is generally going to be the player controller.
Gotcha thanks
hello guys
i am new to aws need tutorial for setting AWS using c++
can any one help me?
Hey everyone ๐ I did a post on #online-subsystems a couple days ago, but since I had no answers I decided to repost here ๐
I'm trying to get my game to work with the Steam Subsystem and I can't seem to connect a client to a listen server.
Looking at the logs, it seems like the client is connecting to the Listen Server and immediately disconnecting?
I did a post here: https://forums.unrealengine.com/t/client-immediately-disconnecting-when-joining-game/269596
Any help is appreciated โค๏ธ
Iโm trying to test my gameโs multiplayer mode with 2 players, with different steam accounts, on different machines, and not connected to the same router (in different households). One of those players is hosting the game (is a listen server). Iโm doing this using the Steam Subsystem, and all the Host/Join game logic is taken straight from the S...
Hi guys, how can I make a variable be global in multiplayer that whenever I increment that variable in client1, it will be seen in client2. And if I increment in client2, it will increment from the last value (if client1 is last who incremented then it will continue from there). I'm using Blueprints so I need some guidance considering this as well.
@waxen stone Data only goes from one client to the server. Only the server can send data to all clients. Two clients can never under and circumstances send data between each other. A client has zero ability to do anything other than a ServerRPC, Replicating is a one way street from Server to Client.
Having said all of that, to allow two players to increment the same variable you'll need to start with an RPC in the PlayerController. Since this is just incrementing, you just need an RPC, no parameters. You call this from the client's instance of the controller, after the RPC you GetGameState, cast that to your custom game state. Inside of you custom game state, create an event. Have the controller call that event from the ServerRPC after the cast. After that you can create your property, mark it as Replicated or Rep With Notify. Have the function you just created in game state set this variable in GameState to itself +1 or whatever you want it to increment by. That value will replicate back to both clients and if you made it RepWithNotify it'll call that OnRep function which you can then do something with the new value on the clients.
Hello ๐ When i make a HUD/Widget(like Healthbar,Inventory,...) where should i put this. Should it be in the PlayerController,Character,...... Whats best practice. I make it in C++ and with a Dedicated Server. Ty ๐
Use the existing HUD class
Also as a reminder. All UI is client specific and has no tie in with networking. Relies on local values only.
This is difficult to do because clients can only affect other clients through the server, and they can only affect the server through "run on server" events through an actor owned by the local player (player controller or pawn)
So essentially, assuming the counter is in game state for example, you need to have such an event on the player controller, that then increments the value on server
Clients then get told the new (replicated) value on game state
hey does anyone know why when I call TakeDamage() and pass that into a client it doesn't actually take damage? I called it from a client btw
Client to client is not a thing
Thanks so much for this answer. Makes sense. I will research on how to use RPCs and GameState as I am so new to unreal, but I'm a long-time programmer of various languages so I hope I can get this part that you have mentioned easily with a bit of research. Just to be specific, I just cited a simple example of incrementation but what I really need to do is update an integer64 variable and more variables eventually. It like this: The first player enters a room, triggers an overlap and becomes the host of the room. I store that variable in that invisible room block that triggers a blueprint and updates that variable. Now if a second player goes in that room, triggers the overlap, it won't do anything because that variable already has a value that was triggered by the first player.
I shall try this as well. Thank you so much for the insights! I have enabled replication but i did it on the actual variable on the blueprint and not on a gamestate and maybe that's why values are not being updated.
Hi, would a database with REST APIs using VARest work if I wanted to have a variable (in this case a database field-value) that can be updated by all clients? Instead of using RPC-Gamestate direction? Is there a disadvantage in this direction? @kindred widget @bitter oriole
No idea. I've never personally used any non UE4 default networking.
Ok thanks.
hi, would anyone know why my fast tarray contains invalid data within the fast tarray items when replicating it to the clients?
If all clients have write access to the database, you just need to be prepared that cheating will be an absolute thing
array of what
well you could implement the security on the server side still
from the database server
OP asked about all clients being able to update. What you can do security wise here is fluff only
Good point. Yes I guess this can be tolerable in my case. And yes, securing the database will be a different story.
But this is of course a workaround because I don't know how use RPCs and GameStates yet... Can anyone point me to a specific tutorial using RPC and GameState to have a global variable update across all clients? Though a guide was already stated by @kindred widget tyvm
array of structs
check this out, it explains it all
hey everyone
my TakeDamage() code isn't replicating to multiplayer, and I tried UFUNCTION(Server, Reliable) but sending back unresolved externals
here's my code ๐
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Character take damage stuff
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Is it possible to pick a map that the client is sent to after session is interrupted? Currently when the server crashes the client is getting sent to the game startup map, I want to change it to my lobby map
Game instance can override it IIRC
guess no one saw my post ๐ฆ
The way you asked the question is difficult to understand what your problem is. Pasting a load of code for people to try and parse immediately also does not help.
cannot find it ๐ฆ
Hello a very small question, if i call from the server a function that live on gamestate, then that function is automatically replicated to all client?
and if it's true, if this function modify an actor implemented as text render on the level (like a counter) then i should put only the variable used for the count set to replicated?
and put the actor to replicated?
if it's a counter (score etc) then mark the GameState variable as Replicated, Set the value on the server only, and it will automatically replicate to all clients.
Each client can then either query the value, or you could setup an OnRep to notify the UI when the value changes.
No need to mark any actor as replicated for this.
ok i used this logic but my clients can't see the changes ๐ข
anyway thanks for the answer dude
It's HandleTravelError, might be able to short circuit the engine default behavior
Other than that, engine change it is
Consider making the lobby map your default map, since lobby & main menu make sense as a common level
Alternatively make the default map a completely empty one that redirects to whatever you want
hmm will try to open my lobby map on travel error as it is too late to split the maps at this point in development
thanks
Does anyone know where to find the default NetSerialize function? The one that is called to serialize USTRUCTS if they don't use custom?
Hey guys! Is there some cases where after a ServerTravel the GameState is just unavailable on the clients?
it happends sometimes not everytime ๐ค
okay so I investigated a bit it seems that it is indeed replicated correctly but for some reasons GetWorld()->GetGameState() returns an invalid object
(everytime, not only in the first few frames after the server travel)
Is it a seamless travel?
GameState gets swapped out from transition to final map I think
:<
If I call SpawnActorDeferred() on the server, are any properties that I set on this actor replicated to the actor spawned on the client? (Even if the properties aren't marked as replicated).
so, i'm trying to replicate an actor being spawn on a server. spawning the fake one on the client, then setting the location on the server. even setting the variable to replicate and then running the new actor to spawn thru playercontroller the variable doesn't update it always stays at 0.0.0.0 but on the client side it set itself to correct llocation.
What about CopyGameState ? ๐ค
yeah i read an old conversation from u about that
but so if the seamless travel doesn't keep it.. gamemode don't even re-create the gamestate ?
Only the ones marked as replicated
And only the ones that exist on the client
E.g if it's a pointer to a replicated actor
And that actor isn't replicated yet
It might be null
Great, thanks.
It should create a new one
What?
Even the picture doesn't help me understanding what you are trying to do
Could you rephrase it
So, i am trying to make it where i can simply spawn an actor on the client at a specific location and then send that location to the server to have it spawn on the server and then to the other clients if there is any but it only 2 player game.
so, 1 player take a turn and spawns an item. that item get sent to the server so second player can see. then after tht turn 2nd player can set an item and send it to the 1st player.
so something like chess or checkers
right now only the listen server has ability to place actors that the client can see but i cant seem to fake the client placing an actor till the server update it location
Why are you trying to do prediction in a turn based game?
Just send from client to server
"Please spawn this actor"
Then the sever spawns the replicated actor.
there no prediction in the game i was just using it to explain the situation. it not setting the correct location it always setting the location as 0.0.0.0
Show your run on server event
Send the transform in the run in server event.
Replicated variables are ONLY set on server. It looks like you're trying to replicate that transform from client.
Back up even more, what exactly are you trying to do? What is the actor you're spawning.
it just a basic static mesh nothing fancy that in a blueprint set to replicate. everything spawn on the server to client correctly just not the other way around
There is no "other way around"
Just add the transform to your run on server event
So client can tell the server what transform it wants for the spawn.
The only communication from client to server is Run On Sever Event.
so, when i c lick on the client window from the line trace to spawn that actor at that location just do a run on server at the end.
okay so i tried somethings like setting the gamestate ptr in the beginplay but it stills is invalid for some reasons..
i really don't understand
whats the proper way to leave a session?
Whatever is appropriate for your game, but usually calling destroy session in either cpp or BP and opening the main menu level is good enough
should destroy session be called from player controller, or from anywhere that can get it
It can be called from anywhere. I call it from a subsystem, but the player controller or the game instance is also common
I use a game instance subsystem for that.
I just call it when you join the main menu level
as you shouldn't be in a session at that point
Seems I can't modify a rep notify variable in an interface
is the best bet just to create an event to do so instead?
Update: Can't call an event from an interface as I still get an error
a bit of a general question, assume I have 3 players (1 Host and 2 client ) , I want each client before they join the server to specifiy their health point before joining, how can this be done ?
Host 100HP
client 1 , 50HP
Client 2, 200 HP
Another example would be a car game where the client choses his own car to join the race with
One way of doing it might be to store specified health value on player controller
I thought this was free? In order to get fully set up, you will need to pay a $100.00 fee for each product you wish to distribute on Steam (the "Steam Direct Fee"). You can pay this fee with any payment method supported by Steam in your region, except methods that use the Steam Wallet.
@pastel escarp As far as I know generally only two things survive joining a server as you have to OpenLevel to it. GameInstance and SaveGames. If you want client to have authority over how much health they're supposed to have before joining a game, then you need a system in place that can store that value in either GameInstance, GameInstanceSubsystems, or SaveGames of some kind. Then once client is loaded in, they can read from that value locally, and RPC it to server to have server set up their actual authoritive health.
@autumn prairieFree to develop on. Costs $100 to start selling a game for paperwork fees.
Can a server access a client's game instance ?
Not directly. Server can access a client through a client owned actor. That's PlayerController, PlayerState, and PlayerPawn to start with in normal framework. Server would have to ClientRPC the client, and ask Client to ServerRPC back a value from their GameInstance.
Hmmm, Ok thanks , that explains it a bit more , I will give it a try and let you know
I'm tryingto get UI to display a message whenever something notable happens on the server
I'm trying to decouple as much as possible to avoid
what's the standard approach to having the UI listen to an event without tightly coupling it to an object/actor?
basically, a global replicated event
@toxic lion There are multiple ways to handle this. Are you looking for something more like a popup that requires and OK, a simple message showing in the center of screen for a few seconds, or more like a chat log message?
At the moment a simple message in the middle of the screen
I would use something akin to FName or GameplayTags for two major reasons. They both compress WAY down for networking, and they're both fantastic for data lookup. The lookup adds an extra layer, but it's necessary if you ever want to consider localization.
As for where to put it, GameState is the first obvious choice. If you really want to abstract it out, you could put it in a Component that can go on the GameState.
Could probably be it's own module as a component/widget. Drop it on your GameState and use a static function call to access it and broadcast.
Hi! i'm having some troubles moving a third person character (default) to some random location.
I'm spawning the third person character, than going to my controller and posessing that pawn, than using "simple move to location"
Am i missing something?
@fluid summit Nav mesh?
nav mesh is outside of the place i'm trying to move -.-" maybe it's that, going to check.
Also, cache that random or you'll get two different randoms, unless that's intentional.
it's intentional, just to test if i can move it on multiplayer
Ah. Yeah. Two different pawns.
thanks for the advice
I'll look into just using FName instead of FText if feasable
Okay, I think storing it in GameState can work out for me, and have a dispatcher that the clients are hooked onto
I'll give it a shot. Thank you
it was the navmesh, thanks!.
Now i'm trying to move the character without using the player controller, the "posses" mess up my camera setup and turns into a "first person" on that character and it's awfull
On a side note. You'll probably eventually want to do this via Stringtable. You can look up data from them using FNames. You could have a single stringtable of all of your error messages and just pass the single FName through for lookup. Widget itself can use the stringtable to display the correct message just by passing it the FName.
got it working as intenteded, need to spawn a new AiController for each new character and use that new controller to posses it, after that i can move N number of characters at the same time on the network.
Thanks for the help!
Ah that's a good idea.
Didn't think of that before for saving bandwidth
It's partially for that. The major reason is localization. If you have multiple nationalities playing the game in their own language, they can all see the message in their own language from the same key.
My day job. ๐ I didn't either until a year ago.
never thought about how I was gonna handle localization.
good to know. I'll have to start with that in mind so I don't screw myself over with hard coded strings
Thanks again!
On a listen server, I have 2 player clients and my PlayerController fires the BeginPlay event 3 total times. Once for each client, plus once for the server. When the event is called, I want to check if the controlled pawn Is Locally Controlled or not, as I believe that's the easiest way to determine if the client owns it or not. However, for some reason, Get Controlled Pawn seems to be null in BeginPlay for 1 of the 3 total controllers. Why is this? Is it safe to assume that the controlled pawn who is null at the time of BeginPlay is the listen server's 2nd controller?
I also don't understand why GetPlayerName in PlayerState becomes blank for the listen server after a client other than itself connects.
eh I think i'm rambling, probably poor design choices led me here. gotta take a look again tomorrow
Controller possession exists separately from the controller being created. The controller gets created, then a pawn gets created for the controller and the controller possesses the pawn (somewhere like AGameModeBase::SpawnDefaultPawn). BeginPlay is too early to check for a locally controller pawn for a player controller
You can override APlayerController:OnPossess and APlayerController::OnUnPossess (If you need to handle the unpossess case) to probably do what you're looking to do
That makes sense. However, On Possess is only available on the server (I actually moved from that to BeginPlay). I need to run some things when the pawn is possessed on a client.
Hmm. Let me look. I remember running into something similar.
How about overriding APlayerController::SetPawn? That looks like it gets called on both sides
Is that possible via blueprints? 
Oh, I assumed the programming section was C++ stuff. Not sure if there's a BP way to do this on the controller side. I know APawn has ReceivePossessed and ReceiveUnpossessed. Looks like you can bind to GameInstance->OnPawnControllerChangedDelegates in BP to accomplish this, maybe?
What end result are you looking to achieve? Might be a different way to accomplish it if that doesn't work
I'm not doing anything really important.. just setting variables that exist on the character-casted-pawn rather than having to fetch and cast every single time. Because those variables differ per-character, I would need to re-set them any time a new character is possessed.
There is no BP only way to detect possession on clients. If you require that you're looking at a tick or timer function that calls something else when values change with a cached value for checking against.
Hmm sounds like I may not want to do this then if it's not already designed for it
Looks like you can bind to GameInstance->OnPawnControllerChangedDelegates in BP. You would need to do that on a manager-type object, though, not in the controller BP
Hmm I will take a look at that
Well, in this case, what you'd really want to be doing is having the server set the variables and replicate them to clients.
Oh. That is a fair point. That is the strangest place for that. O.o I wonder why GameInstance.
Okay i'll try the game instance way and if that doesn't work or seems too weird, i'll just use a few more nodes for my functions instead of having those variables.
I am new to networking but it doesn't really make sense to me to have the server replicate components as variables just for the sake of saving like 2 nodes of space per function.
Thanks for the help !
Was UE multtiplayer support added somewhat recently? Or has it been around awhile?
@naive oar What do you mean by multiplayer support? If you mean general networking, that's been a thing for a very long time. Over 20 years or so.
Huh... Cool
as it applies to UE4 it's been there day 1.
Yeah. Older versions of the engine it's been there since at least 1999. Probably longer.
It would be best to store if players are ready to start the game or not in the gamestate right?
depends if you want to make the other players aware of it
but yeah I think so too
or you can store it in playerstates
and then access it via playerarray
Ah ill just use playstates then, thank you!
can you access the player array in gamemode?
Great thanks
I'm getting a LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: BP_MyClass_C /Game/MyAsset.MyAsset NOT Supported. error as I'm trying to multicast a parameter which is an asset (made from a custom class that derivates from UObject).
What are my options? If it's a matter of implementing something to serialize some reference I'm okay with that, but I don't know where to start.
it needs to be replicated
check the pins for replicating uobjects
I have often seem times where people want to call RPC functions inside a UObject that has an outer ofContinue readingCalling RPC functions inside a UObject
will also need to follow normal UObject replication.
Mmm, it's a Blueprint Custom Event set as "Run to Server" in an Actor Component but I call it from a Character (which owns said component).
The event is compiled down to an RPC, but is it still concerned by this article if I'm calling it from an Actor?
It's an uasset made from a custom UObject class which is hanging inside my Content directory. It's static, it has some material & constants but it never changes.
It's not "owned" by an actor or anything. It's like some Material. I just need to send to the server "please tell everyone to use this", which then multicasts to clients "everyone use this!". I wish some id or even the path could be transmitted to identify it.
I think I found my solution: I'll send the Primary Asset Id instead.
But thanks for the resources, I think it'll be soon useful for me
if a replicated actor A is referenced as a replicated UPROPERTY with notify in some other persistent actor B, would on rep be called for that UPROPERTY at the instant the actor A is replicated ?
yes
is it worth it to implement multiplayer into a singleplayer game that is like almost done? or should I restart with multiplayer in mind
i'm not sure how hard it would be because the game is already made and designed for singleplayer
It's usually incredily difficult
damn
Hard to say anything without knowing the game though
yeah that's true
In this minimal example that I put on an Actor, I expected "MULTICAST BY SERVER" to be printed by Server and Clients. It is only printed by the server:
Any lead on how this can be? What is the logic?
@valid imp Not replicated.
The Actor has "Replicates" ticked. Now I don't know if it's enough to be replicated but I assumed it should.
Do you see the "I'm Client!"?
Yes.
Ah. May be replicated fine. Likely relevance. Try checking Always Relevant.
Damn that was it, well done. Now I need to learn what on Earth relevance is ๐
I don't remember the specifics off hand, but it's likely your actor has no mesh or shape object. Just having a SceneComponent root won't allow it to be relevant.
Indeed, I am using it as some kind of invisible singleton handling stuff.
By the way, while my Actor replicates in this case, would have it mattered here? Actor's "Replicates" field is only about variable values (and components) no?
If you read C++ AActor::IsNetRelevantFor is a good place to start.
And it would matter. It has to replicate to clients to send RPCs as well.
That means I'm wasting a bit of bandwidth replicating variables I only use for server-side computation, too bad.
Also there's always AInfo class. It's more or less an Actor class that requires actor stuff like replication but has no SceneComponents, can still hold ActorComponents though. GameState is a good example of an AInfo class.
Interesting, never heard of that class. I wonder if it can send RPCs (which are done by opening ActorChannel no?).
It can. GameState is based off of it, which is what GameMode uses to replicate and RPC to clients largely.
Awesome. Thanks a lot, you saved my day.
I finally fixed my problem!
So for those who may encounter the problem one day, it is caused by the fact that I didn't specify a transition map (I let unreal manage it because it was said in the documentation that Unreal creates one by default)
Does anyone know if FastArraySerializer works with nesting? Say I have a struct with several FFastArraySerializers in it, and then just replicate that single struct as a property
It doesn't
It only works when it's a base property of an actor/component. Even when embedded in another struct it doesn't work properly.
Thanks!
I don't have have access to UDN but I'll take your word for it
What might work is implementing NetDeltaSerialize on the parent struct, then internally calling it on all the embedded structs.
Not tried that though
Oh actually, probably won't work.. thinking about how it creates the base compare state
yeah it's not the end of the world. We were just hoping we could define our entire level in a struct with all it's nested data, mostly an organizational thing. Fine to replicate each property separately
In NetSerializer.h I see this:
static constexpr int32 MAX_NUM_CHANGED = 2048;
static constexpr int32 MAX_NUM_DELETED = 2048;
Does that mean the array can't be any larger than 2048? Or you can only mark 2048 items as dirty at a time?
It'll only replicate that many changes/deletions in one bunch IIRC
you can have more than 2048 if you wanted
Interesting, and is that because TArray without FastArraySerializer can only replicate up to 2048?
Or am I just finding BS when googling max size for TArray
nvm I see MaxRepArraySize now
Okay, I see why this is a thing, max packet size.... makes sense now
Does anyone here know if FastArraySerializers handle chunking on their own? The delta limit for the array is 2048 but I'm curious if that means I have to manage that on my own. Use case is we send an array of data which contains data for a user-created map. This array can change during play which would be minimal changes, but I'm worried about the big data dump when joining a server for the first time, will need to send the entire map over, which is very likely to be more than 2048 array items.
@meager spade Is this something you would know?
I guess the work around would be to have several of these arrays
Try not to tag people randomly, specially mods.
On a side note that's something that's probably fairly easy to test if you have a FastArray set up. Just add a ton of entries to it. Have a client join long after that, test the array.
I have a Listen Server and Client.
I have a Xbox controller connected.
I want to shake it when the player presses the attack button.
I'm running it on UE Editor.
Get Instigator Controller:
Get Player Controller (Index 0):
Attack button pressed on Server: Gamepad does not shake
Attack button pressed on Client 1: Gamepad shakes
Get Player Controller (Index 1):
Attack button pressed on Server: Gamepad shakes
Attack button pressed on Client 1: Gamepad does not shake
Why does it not work on Server?
I understand on Client. Only its own player controller exists (index 0), so I understand why it works on Client.
On Server, index 0 seemingly refers to the Client's. And index 1 refers to itself. That's why Get Player Controller (Index 1) works. That's fine. But then why doesn't Get Instigator Controller properly work?
Have you tried using just GetController?
This looks a lot like the controller is only registering for the second machine and not the server machine. Could be a PIE with controller issue.
Can you try running with separate process?
Standalone 'should' act differently.
Yeah, I did try Get Controller, same results
Okay, let me try that out
Ah, that was it:
Now it works with Get Instigator Controller
I guess PIE kind of messes up the gamepad owner
Thanks you guys.
oop thanks
Hi everyone, quick question: if I have a struct which contains a set of member variables and some functions too, and I have an array of this struct being replicated, does the presence of the struct functions increase the packet size, or is UE4 able to only replicate the changed variables and ignore the function definitions?
it only replicates the variables which are marked as UPROPERTY(), or if you're using a custom NetSerialize function. Functions shouldn't have any affect on packet size.
only UPROPERTY variables are replicated. None of the rest matters
you can also mark UPROPERTY with NotReplicated in a struct to also not replicate them
Thanks all ๐ Great stuff
I didn't realise you could do that, that's actually going to be useful for me
Hi all. I have a game in which standing over a goal area will cause the player to lose. However it is currently crashing when the player steps over it. Can someone give me a hand? I have both C++ and Blueprints
How many bytes is FVector_NetQuantize again?
Yeah trying to figure out the bytes, so if it's 60 bits overall, it's like 8ish bytes overall?
about 7.5
Thanks!
normal fvector is 12 bytes
And the NetQuantize_10 and NetQuantize_100 versions are closer to 12 I imagine
And the QuantizeNormal much less
Read the comments in source now
Makes sense!
Damn this is so useful. I can now have some redundant server only data in a replicated struct without having to strip it out and send 2 different structs when dealing / taking damage
Very handy when passing damage info around without having to separate it. I assume that anything marked with NotReplicated in an otherwise replicated struct is 0 bytes and initialized to default on the client? @meager spade
As in if I have UPROPERTY(Replicated) FSomeStruct MyStruct; and some members of FSomeStruct are marked with UPROPERTY(NotReplicated) they wouldn't waste bandwidth replicating down but the other members will as usual?
Hi! one question with regards to replication and performance.
on the picture below:
character: rep all
boxes: collision not rep, mesh rep.
i'm spawning a bunch of boxes for wich i only want to check collision against the character on server side, do i get any benefit for spawning a mesh on the client side at "Box position" or is it the same if i replicate the mesh component on server side?.
the boxes won't move.
NetQuantize 100 is 3.5 bytes
Its lesser
Not according to the source
* FVector_NetQuantize100
*
* 2 decimal place of precision.
* Up to 30 bits per component.
Valid range: 2^30 / 100 = +/- 10,737,418.24
* FVector_NetQuantize
*
* 0 decimal place of precision.
* Up to 20 bits per component.
* Valid range: 2^20 = +/- 1,048,576
Yes
Yea makes sense now
Trying to get some input on this issue currently, the functionality for the aim offset works on the client but is never seen by other clients. I'm replicating other components of the anim BP the same way and it works fine; besides the yaw and pitch for aim offset.
COND_InitialOnly only replicates the first time we set the variable ?
GetControlRotation doesn't provide replicated values - this function is trying to pull the control rotation from the controller itself, and in multiplayer, the player controller only exists on the owning client and on the server so right now your multicast event isn't getting any replicated data other than perhaps the actor rotation.
Yea, I switched it to Get Base Aim Rotation and it seemed to work properly after that.
Is this sane? It's a moving platform that replicates the "Loc Interp" (the interpolated location)
It does seem to work, but it seems wasteful because weโre continuously sending Loc Interp to the clients. Loc Interpโs location should be deterministic relative to time, so assuming we have the starting time in sync with client and server, sending Loc Interp over the network seems wasteful.
Do rep notifies run on the server for PlayerStates?
From what I recall, repnotifies execute on all in blueprints. In C++ I don't think they do fire on server.
hmm, i wasnt able to get it to execute on the server for BPs, even when setting the variable on the server
Do you have any replication conditions set on it?
No, all default
Very simple test.
I wasnt able to get a has authority node working, would default to false everytime
Based on your wording, I'm not sure if you're trying to set the variable client side and hoping the server receives that update?
No no, setting the variable server side
Ok good stuff.
Is your test setup with dedicated server? Like running as client?
Yes
hm strange, no idea why mine is not working
//Died
if (Health <= 0) {
DropItem();
if (GetLocalRole() == ROLE_Authority) {
FActorSpawnParameters SpawnParams;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
if (DeathMeshTemplate) {
DeathMesh = GetWorld()->SpawnActor<AActor>(DeathMeshTemplate, GetActorLocation() + FVector(0, 0, 10), GetActorRotation(), SpawnParams);
UDestructibleComponent* DestructComp = Cast<UDestructibleComponent>(DeathMesh->GetRootComponent());
//Subtract our location from theirs to get vector that points in kb direction
DestructComp->ApplyDamage(100, GetActorLocation(), ((GetActorLocation() - DamageCauser->GetActorLocation()).Rotation()).Vector(), DestroyImpulse);
DestructComp->AddImpulseAtLocation(((GetActorLocation() - DamageCauser->GetActorLocation()).Rotation()).Vector() * DestroyImpulse, GetActorLocation());
//optional, but set death material to be our slimes color material
DestructComp->SetMaterial(0, SkeletalComp->GetMaterial(0));
}
Destroy();
}
}```
hi i have a death
called in a replicated actor
everything works
but
when i spawn the deathmesh it only has an impulse applied to it when played on server
the clients cant see this impulse
the deathmesh has replicated movement
yet the clients cant see this fired impulse
any ideas?
is there a convenient way to get the acceleration of an actor for replication?
what do you need the acceleration for?
hmm. i thought about it, and instead i'll just send a bit instead. it should work and would be a lot faster
Hey, I'm doing Load Stream Level on the server, including hiding/showing it after. Is it correct that this all should already be replicated? On the client I see a black screen when the new level is loaded and the current is unloaded, instead of seeing the new map
Hello ๐ I Have a AActor class, How can i set ReplicateMovement to true in the Constructor? bReplicateMovement = true; does not work ๐ฆ
SetReplicatesMovement(true)
Thank You ๐
Could anyone give me an estimation for the price of a server please ? I know that there's no answer because it depends on alot of factors but I'm gonna give an example of an existing game as it's the closest to what my game would be.
The game is ... Fall Guys :
- 60 players
- Average players per month : 8,500,00
I don't know the tickrate they use and other stuff but just give me an estimation of how much their servers hosting cost please.
Obviously depends on average play length per month
And their game's server side performance
And which provider they picked
i have a question. is it possible to copy fortnite old game files into ue4 and change stuff and make it work or its not?
because i download this "Rift" thing that lets you play old seasons and i was wondering if i can make that online with my friends
No
so how did Rift do it? but offline
They probably didn't change stuff
Just give me an estimation x)
That's not possible
I told you the missing data
so can take the files and make it online for me and my friends for free?
and the server side performance, take a guess on what could it be and give me an estimation
And it's stupid anyway because 95% of Steam games cannot fill a single Fall Guys server at any given time - 60 players is a lot
95% being literally the real number here
so can take the files and make it online for me and my friends for free?
Well Fortnite runs on c4.8xlarge servers, about $1.6 per hour, so assume your 8,500,00 monthly players play about 10h per month and do the math
Obviously if players play 5 or 20 hours instead the result halves or doubles
That's spot pricing, which they're not probably using
And AWS is expensive
That's why you just can't know
(Fall Guys also doesn't have 8,500,00 monthly players by any stretch)
So 8500
hi guys
Anyone know how to host online session
i was using playfab Legacy but they are going to shut it down any advice?
They have 14,000 playing right now so that's obviously also wrong
Assume 50k, 10h per month, 1.6$ per hour
So a cool $750k
Assuming Fortnite performance and completely arbitrary player counts and play time
$750k per ?
month ?
Damn that's alot
I calculated the average players on fall guys it's 24261.76 per month
so we can divide that by 2
fortnite performance is so high compared to fall guys
even 100k is alot
I have no Earthly idea about which game is costlier on CPU
And I mean, Fall guys has 230 people behind it so you can assume something like $20M a year in pay alone
Makes the hosting look like a joke
After reading some infos, the more players you have the more CPU you need
true but they have investors maybe and they made their money back, but even that it's alot to consider
You're in wild guess land anyway so maybe it's $100k per month, maybe it's $20k, maybe it's $500, who gives a shit
I just needed an estimation to just have an idea
Again, the real cost is the team
Then the office space I guess
Then probably royalties
Then hosting
More players does not immediately mean more CPU usage either. 20 players in a super simple game can consume way less than three players in a heavy game.
Interesting
@kindred widget Could you also give me an estimation for a Fall Guys like game ?
I know
Not really. I have no idea what that stuff runs. I've never once cared to be interested in dedicated server hosting costs. Without a team and at least a half fleshed out game and a profiler, it's just pointless speculation and a waste of time that I could be learning something new like AI or Slate.
But why nobody thought about making a website where you fill some infos and it gives you an estimation. Like you have input boxes like these :
- Genre of game
- Max Players
- Competitive / Non Compรฉtitive
...
And it gives you some potion to go for and it gives you an estimation like "Between 50k and 200k" ...
Because it's not possible
mhhh ๐
Like we keep telling you
aright
There's just far too many considerations. Like, even something as simple as having too many scene components on player pawns makes a massive difference when you start getting past dozens of players.
Calculator cannot account for the myriad of different design styles or potential optimizations(or lack of)
interesting, Thank you ๐
Also another question not related to unreal or servers : Do you know what's the english word for the mechanic of a character giving instruction through voiceline like in Apex Legends when you spot a place it says "Over here", "Come Here", "I'm Attacking in 3, 2,1, Go ! ",...
Call Outs is my first impression
Thank you ๐
if I use a RPC to set a value on the server, what is the ideal way to replicate it to simulated proxies?
thanks!
If you have to ask, you don't need to worry about it right now.
Hi, is there a document for how to use the network prediction plugin ?
I think it was Jambax who's made a few mentions about it. I was under the impression that it is still in development.
would anyone know how to properly stream levels in a multiplayer environment? i have 0 clue if i should use owning client in the player controller or stream the levels on the server? im currently streaming them on Owning client for everyone individually and im getting engine crashes because of it any ideas?
Does anybody know how to setup a LAN multiplayer game between Android Instances? (I'm testing Windows to Android right now, but Android to Android is the ultimate goal). Windows to Windows works fine, but Android is not picking up Windows sessions and vice versa. I've read past posts about this and it seems to be a known issue possibly having to do with UDP broadcast restrictions on Android. I'm not ready to give up though. I am on Unreal 4.27.2. Does anybody know if this issue has been resolved in 5? Are there any alternative options? Bluetooth perhaps?
Not ideal, but maybe worth a try.
Server browser would be nice, but inputting the IP address and port number works on LAN so I'll just stick to that for now. Since I don't have a second Android device, I can't test between Android instances, but I'm going to try doing an iOS build and testing between Android and iOS. Has anyone tried that before?
From the client's perspective, listen server and dedicated server are the same thing, right?
if the client isn't acting as the listen server, yes
Coolio ๐
Has anyone ever ran into an intermittent replication issue, where an animation replicates at one point when moving but then if you stop moving and start moving again, it doesn't replicate?
I debugged it by printing the variables of what the client has versus the server, and it is properly replicating the values, but the animation doesn't always play for prone movement.
https://i.gyazo.com/cfd1c4ba093d1e5fe8efbc781cf5e55c.gif
Scratch that... I was missing a single boolean variable that should have been replicated.... ๐คฆ I guess a night's sleep helped me think lol
Thanks.
When we attach to actors together on a multiplayer game, do we have to attach actor on server too, or we can skip on server ?
I have a question, I am looking into database solutions for my project
I am going to be running a dedicated server for my project, which is going to be write heavy as I "want" to have a persistent voxel based world
I was thinking NoSQL in the form of DynamoDB? Anyone have any other suggestions or what not? I was going to originally just go with what I knew which was a MariaDB/MySQL variant but I realized that it won't be able to handle the amount of writes I need
I've never used it for gaming, but Postgres is a high performant db
NoSql already has such limited use cases where it'd make sense in the field it was popularized already (web dev)
I'd think that there'd be even fewer use cases for game dev
Another developer I talked to has persistent voxel world and used RocksDB for serialization of world instances
My use case is similar to his but I honestly just straight up don't know when it comes to Databases lol
so the main point (to my understanding at least) of using NoSQL is that it's a non relational database where you can store data objects that haven't been previously defined in a schema. they are somewhat lose in the sense that the DB doesn't actually care what you put in there
Instead of having multiple tables where you store your data, you have a single "table" (forget the actual name for it) where all the data is stored
please note, I'm no DB expert (or even professional), so take what I say with a grain of salt, but I do have experience using them
Anyways, when it comes to it, you usually want relational data. that's when NoSQL databases lose their shine
You either store a whole object in the DB, or store a reference to another one.
Now you have to modify data in multiple places
And of course you fall into the pattern of writing the same data in multiple places
instead of references (links such as IDs)
Well maybe you can help me then when I tell you my exact use case
Its an RPG so items, well they're not pre-defined. They're randomly generated, so the chances of two items have the exact same stats is very very slim. So each time an item is created/generated it is it's own unique item entry to the database.
So I expect this to occur a lot, so I need a DB solution that will take all the items and store them as they're being created
there is an exact pattern for that with traditional relational databases
how do i replicate add impulse
the actor is spawned from server
but the add impulse needs to replicated
one second @dense mantle
any ideas
@royal vault do it on begin play, if this impulse needs to be on beginning, as actor is spawning on server and actor is replicated, it will spawn on each client and all begin play will work,
But if you want to control the Impulse timing, then create an event inside actor, then fire that event on a multicast, it will only work if actor is owned by the owning client (player controller) other wise if it is not owned, then create an event on playercontroller and use player controller to fire the event.
DestructComp->AddImpulseAtLocation(((GetActorLocation() - DamageCauser->GetActorLocation()).Rotation()).Vector() * DestroyImpulse, GetActorLocation());```
what do i do if i have information i need to pass in
do i create variables on the actor and set them replicated?
Also if this is for simulating physics, physics isn't deterministic, so you have to write a system that'll handle the movement replication and prediction.
@royal vault well, if everything is done correctly, most of the parameters should already be on sync, but if not, you can pass via event, then execute.
if yes simulating physics, then its whole another story
That isn't the issue with physics so much. Two machines won't always have identical movements even with the same inputs. If you launch a ball and let it bounce around with the same inputs, it can end up at different places. This is what I mean by not deterministic. On top of that, networking has different timings. If an object is 2 seconds through dropping through the air, and server adds force to it, and multicasts, it could be 2.01 to 2.3 seconds through the air on the client before that same effect is done.
ok
so my object is simulating physics
but its like doesnt have to be accurate
its just whats spawned after a mob or something has been killed
so it doesnt affect gameplay
and the actor destroys itself after a few seconds anyways
what if we have very good movement replication system, and we do the Impulse on one client and the replicate the movement, in that way most of the effect should look the same ?
If you really need to simulate physics over network, your only real choice is to replicate four values. Location, Rotation, Angular Velocity and LinearVelocity. Replicate these semi often to the client, or RPC them. Let client interpolate on tick to the new value. Client will always be a little behind the server, but it'll be semi close enough and simulate a similar state.
wait but isnt there a way for me to just send from the server to client the impulse
and only that
@royal vault if logic which suppose to start Impulse happening on server , yes you can directly send it to clients.
great now the clients physics is working
but
i now have an even more strange problem
i have this code
all those variables are replicated from cpp
if (GetLocalRole() == ROLE_Authority) {
FActorSpawnParameters SpawnParams;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
if (DeathMeshTemplate) {
AActor* DeathMesh = GetWorld()->SpawnActor<AActor>(DeathMeshTemplate, GetActorLocation() + FVector(0, 0, 10), GetActorRotation(), SpawnParams);
ASDeathMesh* SDeathMesh = Cast<ASDeathMesh>(DeathMesh);
SDeathMesh->Location = GetActorLocation();
SDeathMesh->Impulse = (((GetActorLocation() - DamageCauser->GetActorLocation()).Rotation()).Vector()) * DestroyImpulse;
SDeathMesh->NewMat = SkeletalComp->GetMaterial(0);
//Subtract our location from theirs to get vector that points in kb direction
//optional, but set death material to be our slimes color material
Destroy();
}
}```
