#multiplayer
1 messages · Page 729 of 1
You can forget about those forever
What you want is "create session", "find sessions", "join session"
Using the appropriate online subsystem
yeah i made these
but not sure how its supposed to actually find a session without specifying an IP
That's literally the entire point
You never use an IP
You search for a list of live sessions on the current online subsystem, and then pick one from the list
and how does it know if its a session from my game or some other random unreal game?
public IP of the machine you are hosting on
what if i have 2 public IPs? will it use both?
If you google what is my public IP it won't show 2
so whatever one it shows you are using use that as the address to connect to
OR if it somehow is hosting on your other IP then just try connecting to that instead
But as mentioned subsystems are an easy way to avoid this kind of hard coding IP stuff
it should be able to find a server in that multiplayer test thing right?
left side is listen server and right side is client
i tried creating a session in left side
but its not finding a session on the right side
Have you opened the level with ?listen
If you haven't even with a created session you won't be able to join
i have
at least i guess thats what this part of code does
I'm also not sure if you can join via IP for instances in the editor like that
Try launching 2 standalone versions of the game and testing there
how can i make unique net id repl from unique net id string?
does anyone here have experience with session based multiplayer games and have a few minutes to help me wrap my head around the workflow of it all? I have a few questions
A question! Can you make a dedicated server allow users to request a new instance from a dedicated server for e.x how path of exiles instance system looks like?
Or would it require tons of servers
Not "within" UE, that'd be down to whatever backend service you're using to spin up instances.
I c.. hmm need to figure it out
You need your own cluster server service if you dont want to use peer connection
Well that property is somehow a "motor health", so it should be on the motor actor. Whenever you approach the motor(a collision check probably, fyi collisions fire on both server and client) you show the widget on client, and on server you start changing that property the way you see best. The fact that motor actor is replicated and its health, then you can retrieve that data inside the widget and use it to display the slider value
That only element for that property only
hm.. ig cluster server is very pricy
Would people be able to 'cheat' in peer to peer tho if theyre host but all items/inventory handled thru sql connection?
hmm.. need to figure out a way to handle it then unless keeping game open world, but that would seem annoying
You should get all player data's when they logged into server (dedicated or listen ) and apply them .
yeah but when they go into an instance i want a player to get their own instanceID of it
but keeping items updated/saved
Why do you need an “instance id”? If you want an inventory system you’ll need to link it to some account ID that’s unique per player and then whenever that player logins on a server request the data for that user through whatever backend you use and save it to that same backend whenever you think it’s needed 🙂
You don't need servers unless people buy your game.
but e.x if the open world is on a dedicated server and inventory is loaded there, and then for e.x a player enters a Instance or dungeon / map, I still want them to be able to load all data from the SQL load into there, and be able to loot items to save to the players save,
Then load it again if they move to a different server.
but if its peer to peer? the instances
If your dungeons are peer to peer and they can get loot in there then there's no reason to have a full backend service with inventories because they can just cheat all items in anyway.
There is no peer to peer in Unreal. You might be thinking of listen server.
But you are going WAY too big in your scope if you even have to ask these questions IMO.
If you want to rule out cheating, you need to store the items on dedicated server.
And not have parts of the game suddenly be a listen server too because then they can just cheat and do whatever they want. Which really defeats the purpose of having a database for inventories in the first place.
so cluster would be the only proper answear for it then? so its a dedicated started up when a player asks for a instance.
If you want to have full control over who has what items then yes, you need dedicated servers. You just can't trust people to not cheat if parts of your game are listen servers and they can get loot / items out of those moments.
Yeah you need to do everything on dedicated unless you think up some wacky cryptographic setup to deter cheating but even that'll be defeated.
defeat cheating in 2022, that be a dream lol
But honestly if this is your first commercial game. Don't do it.
Just a matter of time no matter what solution you come up with to delay it.
This is like your first car being an F1 car.
Ive workt on others adriel, but not The dedicated side of things, nor handled SQL, and found it to be a fair ground of learning it, wont be aiming for instantly publish and stuff more a wide learning ground.
done sql outside unreal in Valve etc, but never within this.
All I have to say and can give as advice is if this is just for learning go for it and learn whatever you want, everyone has to start somewhere. But if this is for a game you want to publish please have a team of people behind you, a business plan and money. Dedicated servers are complicated, time consuming and most important really expensive.
fair warning and appreciated.
I think community dedicated servers are viable tho, the TF2 / Minecraft / Valheim model.
But yeah hosting yourself? One bug and you got a $500k hosting bill lmao
I mean Space Engineers only hosts like 30 servers themselves, and they've done fine.
I turned my cloud server up to $1k a month to compile Unreal headless on it. Turned it back down after 20 minutes and it only cost me 5 bucks. Imagine if I had forgot though.
Even then I would still argue don't unless you once again have a team which again costs a lot of money. It's a ton of effort to keep up with that all. All the games you just named have teams of people working on those games.
True, Publish aint in my scope ever unless local with friends, and was thinking of trying with the dedicated Server PC @ home, for starting purpose just.
I have 2 projects that will require dedicated servers but they're on the garrysmod/valheim model. Not a big deal if there's cheating vs some LiVe SeRvIcE type game.
I'm working on a game inspired by GMod, or rather by WireMod and ACF
Oh i see
General area of working for me rn is super smash misc type of games, but felt lackluster and wanted to make a bit more open world, hence why this idea came to mind, But i guess it be easier to make Open world "Farm" then instances for purpose of testing/learning,
If it's just trying to see how things work and you're trying to learn from it and then mess around with friends go for it by all means, don't let anyone ever tell you that such a thing in specific is bad to learn / try. I've seen people that straight up tell others for stuff similar or like this that "it's too complicated for them" which is nonsense advice. Everyone has to start somewhere while yes it's definitely more complex. But what I am trying to warn for is that actually publishing a game with dedicated servers is often so expensive that people have to shut it all down within no time or have wasted years of their lives trying to make something out of it.
That's just the route you shouldn't go unless you actually have the funding and experience along with the people for it 🙂
And even then it's still a risk.
risk is always there, can never learn without failure along the way, just hopefully not a big enough failure to cost a leg and a limb
You can cheat but you can make it very difficult for them to cheat and if you combine a proxy with your database then they cant do anything malicious
Preventing cheats is a lost battle if you can't have 100% authority in whatever you do. Companies as big as Epic them selves, Valve, Riot etc. still can't win battles like this. Although they are of course much more targeted than other companies. Also a proxy before your database is not going to do much as they can still very much request to store items they never had if you can't verify what they were supposed to get from a game.
A proxy for the database is to prevent malicious behaviour which is what was intended in my message
The worst aspect of cheating is worsening others play experience. So if you have a PVE game in which there isnt much interplayer experience you can reduce your budget in anti cheat services
definitely something worth to put into consideration
Its amazing how successful COD multiplayer has been with their p2p model
Even in PVE games people cheat. Take Deep Rock Galactic as an example, it's a game I love and completely not PVP related and yet people cheat and ruin other people their games permanently by ruining their save games.
I suppose a lot of people buy it for the campaign
There wont be any "PVP" but will be PVE Group-based
yes, that's essentially inter player experience
but with a listen server model you are alwaya screwed
and would suck if someone comes in with cheated weapon and 1 boops a 20 min fight
sorry to ruin your world
At the end of the day if a client is running the server and they have access to their memory then they can do almost if not anything they want and there's no way to solve that except using a dedicated server
Of course it's much less than in say a PVP game. But it's trying to get the point across some people just love to cheat and ruin others' experience D:
cheaters always cheat, even outside games.
😂
God i hope I dont have to make it to 32
plus sweden ig..
Hey at least you're doing the world favours over there
true, but eh, i wanna make this world somehow ^^ even if its gonna take years
got 4 people, 1 world designer, 1 sql uni-trained person me as coding general, and then a person familiar with boss designs in unreal engine
Well if its any use to you: steam actually allows you to use their proxy servers for p2p games
They also allow you to store player data like XP and any stats they've got
All on their own servers
I believe Epic Games also does that but not quite as extensively as Steam
never figured out how to use it more then listening and connecting thru steam and using friendlist/groups for invites
Steam does however ask for 30% of sales and on top of that you have 5% revenue from epic
I wouldnt say thats a big catch tbh they have so much exposure
so could inventory be stored thru steam then or would it still require a sql db in the end?
The biggest catch is 30% off your sales OUCH
not if its a free game dun dun dun
That's why it's between quotes it's a complete fair trade-off you can make. But just don't expect to get crossplatform play that way 🙂
I think you'd need a database still but thats fine because you only need one database. Latency from different continents isnt that problematic unless for whatever reason your database is being used during play time
Why on earth would you do that XD
Fair point
Would you mind if i add you olly so i can dig your mind sometimes? Currently at vacation at wifes and returning home in 6 days.
I mean considering how much people Steam has, how easy they make it for you to put a game out and all the services they provide idk. I don't think it matters too much for most games, it's only the bigger studios that usually say no to that. But obviously less of a cut would have been nice 😛
Yeah I don't mind but im nowhere near an expert so you might be dissapointed
still seem to know few bits that i dont :p
It all depends on your profit margin doesn't it but yeah most likely if your game gets big you'll make a pretty buck
I kind of just see it as Steam giving people at least the chance to grow into something. Sony, Microsoft, Epic, Nintendo etc. don't give really small games the chance to even begin selling on their platform.
That's true but if you can make a good enough pitch to Epic they will give you a grant so that you can make your game big
Absolutely as long as your profit margins are right
Sent you in dms olly, Current project i did when bored in 7 days b4 arriving here
Fortnite is free and they seem to be doing something right 🤣
I would not bet my entire game on Epic giving me maybe money to do so out of all hundreds if not thousands or more ideas they get all week 😛
been here for.. uh.. 43 days now
Epic only grants additional money
The Grants aren't meant to finance your game
Only to help a bit
They do publishing though by now
But that's also a pretty strict selection I guess
And you usually need to be quite far with your project already too
So again.. Steam 😄
Yeah, I mean, visibility on steam is garbage by now
But that's no different to EGS by the time they open the gates
You have some less common options like itch.io
But well
Itch has so much less people that use it compared to Steam though. Like you can also sell it there but I would not take it over Steam in anyway.
But then again, who am I to tell someone what to do in this regard 😂
Hey everyone, maybe this isn't the right channel, but I've been trying to get an asymmetric VR template working, and so far, it's working really well. It's using a server/client setup and a game mode where the VR player is running on the server, and the third person is running on the client.
The only thing that isn't working, and that is confusing me is the ambient fire sound. It seems the default fire sound that plays is now spatially located in relation to the third person character's location, even with the fire sound playing out of the VR headset. I can teleport up close to it, and the volume doesn't change, but if I move the third person character up to it, the VR headset now plays the sound louder.
Any ideas here? I have the template project here in Github:
https://github.com/AndBobsYourUncle/AsymmetricVRTemplate
Hi all, does anyone know of a way to have two persistent levels reference the same sub-level data, but not each other, without duplicating all the sub-level data?
I'm not sure I have understood your question properly but could this help? https://docs.unrealengine.com/5.0/en-US/API/Runtime/Engine/Engine/UGameInstance/
Got it from here https://stackoverflow.com/questions/65376613/how-to-save-data-between-levels-in-ue4
sorry if that was not very clear, basically I am trying to have two persistent levels using world composition and streaming sublevels. one persistent level is for single player, and the second persistent level is for multiplayer, there will be some differences between the two persistent levels however, the sublevels that stream in should be the same sublevels. When I put the two persistent levels into the folder together, they identify each other as a 'streaming level' and we get some duplication of the persistent level items. I was just thinking if I arrange the persistent levels into the folder hierarchically maybe they wont see each other...
It may not be your lack of concision but my lack of understanding. I'm afraid I dont think I can help sorry
no worries, seems like there is no way to ignore a level in the same folder or subfolder
duplicating the sublevel data does work
what networking type lyra sample game uses anyone knows?
?
I want to make warframe like lobby/base but don't know where to start
You can't use Epic store and Steam together?
I didn't get the rest of the context but the quoted messaged is BS, I worked on a game that had EGS and Steam cross-play even before EOS supported it
True cross-play? As in Steam and EOS playing in the same servers?
Wow, didn't know that was possible. Might want to do that in my game.
Does EOS manage the subsystem and sessions for you?
Or was it custom subsystem/2 packaged builds?
Custom basterised EOS subsystem on 4.26 and the Steam one
Though we had a custom backend for some stuff
And they were separate client builds
Which is slightly easier to do on 5.0
i think i heard if you are bigger studio only 5% fees cut. Steam does not like indie, too bad
Why can't I see struct contents in unreal insights after implementing NetSerialize for my structs? 🤔 the data is still valid as the game plays correctly
probably because your new netserialize it uses doesn't call any trace macros
slap on a QUICK_SCOPE_CYCLE_COUNTER(PoggerStructSerialize) in there and it might work
if not there are other macros that are more insights specific
check the docs
hmm any hints which macros specifically should I use in this case (or maybe a link to specific docs page)? there are tons of them and i'm not familiar with any of them
literally slap in what I pasted there in the scope of the function
for starters
let me get the other one
while i'm profiling is it ok to serialize archives in NetSerialize just by Ar << MyArray? Do I have to implement FFastArraySerializerItem for my array item and wrap the array into a struct if I'm only interested in sending this data over RPC and not replication?
woops, I was thinking of TRACE_CPUPROFILER_EVENT_SCOPE_STR
but this is a net trace!
my bad dog
I can't figure out a simple way to trace these network events
my guess is to see how that struct gets serialized by default and see if any traces are called in there
Hello - I have a question about replication. I have actors that have skeletal mesh component. Should the skeletal mesh component be replicated or should I just multicast the set skeletal mesh component function? If I do the latter one, it does not work correctly, I assume that it is because client connects after the multicast call ( I do it on the begin play), so the correct way would be to replicate the mesh component property?
But another issue is that i cannot replicate the mesh on ACharacter class, because it does not have "Replicated" annotation in .h file
You should replicate the skeletal mesh resource to set, and set it to the component when the property replicates
Don't replicate the component, mind you - meshes have nothing to replicate. The resource
Oh ok, that makes sense, so if I understood correctly, I should create a pointer to skeletal mesh in the Actor/Character and replicate it, and then in onrep function just override the component when it replicates
Yeah, you'd just call SkelMeshComp->SetSkeletalMesh(MyMeshResource) in the onrep
Thank you!
It’s not “BS”, the context of this was that if you use Steam their backend for lobbies you’re obviously limited to their platform in the way that if you were to sell your game on Epic right now you can't use the same backend to connect players to each other. But I see how I created a bit of confusion with my statement. You can totally fine sell your game on a different store than Steam while also being on Steam but don't expect Steam their services to work on a different story 😄
@shell forum ^
I've been thinking, is it a bad practice to replicate objects/actors through fastarray as opposed to structs (as in, if the data you need replicated can be represented as a struct, then you shouldn't have it in a class)? If I understand it correctly, one of the advantages of fastarrays is that the server doesn't need to check whether each item in the array has changed, but can tell from the array itself thanks to MarkArrayDirty / MarkItemDirty. But if I'm replicating a fast array that contains objects, then I have to also manually replicate the objects themselves in the ReplicateSubobjects function of the Actor/Component which holds the fastarray (otherwise the replicated fastarray will just contain null elements), which throws that part of the optimization out of the window
FastArray has extra item overhead, so it doesn't make sense to use it over a regular TArray<UObject*> IMO
And just a note, you don't need to override ReplicateSubobjects() most of the time, i.e. it's not required for actors/components/asset references etc.
You can just use the regular push model macros if you want the server to avoid checking the array for changes.
But ask yourself - how enormous would that array need to be to make pointer comparisons a significant cost.
Probably larger than you can reasonably replicate anyway
But when you change a property inside a UObject element of the array, then it's not pointer comparison, is it? It has to look into the object itself, so it's not just the size of the array itself that determines the cost, but also how many properties the items have
I guess the push model could be the solution, it just feels like an overkill to make the items be Actors instead of just simple UObjects
It also boggles me why Lyra does it this way (LyraInventoryManagerComponent has a fastarray of LyraInventoryItemInstance which are UObjects, when I can't see anything in them that shouldn't work if they were structs)
You're replicating a pointer in that array, so it's the value of the pointer that is compared (or rather, a net GUID) - not the object and all it's internal properties.
Well, yeah, that's where the ReplicateSubobjects comes in, to replicate the actual object itself
No that's not how it works. ReplicateSubObjects is only required to create an FObjectReplicator for the item and have it's properties compared, it doesn't care about the array
The Array is a property of the container class, it's replicated by the container and it only cares about the NetGUID of the objects being pointer to - it doesn't care about the objects themselves.
So if you change a property of the object, only that object will have it's properties compared. The array containing the pointer will not be checked.
Wait, so ReplicateSubobjects is called only once?
No it's called everytime the outer actor is checked for property comparisons
Yeah, and that's the problem - it has to iterate through all of the items, every single time
Yes but it will do that anyway, marking the array as dirty makes no difference
Sure, but if the fastarray contained structs instead of objects, then ReplicateSubobjects wouldn't be needed, no?
The fastarray itself would ensure it replicates the contents of each struct only when it changes?
ReplicateSubobjects() is not needed for anything, unless the objects contained within are not replicated already through some other means. E.g, they are an actor, an actor component, or an asset or otherwise stably-named object.
Yeah, which is the case here
You do not for example need to implement ReplicateSubObjects() for a UPROPERTY(Replicated) TArray<AActor*>
class ULyraInventoryItemInstance : public UObject
ReplicateSubObjects() is just a way to add additional replicated objects. You don't even need them to be referenced within another replicated property.
The objects replicated via ReplicateSubObjects(), and replicated references to those objects are not linked to each other in any way
Yeah, I get that
And ReplicateSubObjects() will always be called, regardless if the actor or any of it's properties are dirty
Because that is what performs and checks whether the object needs to send anything
The FObjectReplicator created for each of those sub-objects then decides what properties to compare (if marked as dirty or not using push model) and send (if they are dirty)
But the situation as it stands right now is that the manager component contains fastarray of UObjects, and as such needs to replicate the UObjects themselves (so that the fastarray doesn't contain only null pointers) through ReplicateSubObjects
That's right yeah
My question is, if it weren't UObjects but structs, would there be a need for ReplicateSubObjects in that case?
If the replicated property is in an Actor/Component - then no
It is, so it would be much more efficient, right?
If it belongs to the sub-object, then yes - otherwise that array will never replicate or be checked etc.
Since it would be a replicated property of a non-replicated object
Yup, yup, the array is directly in a component
And the other option would be to rewrite the UObject elements into Actors, use push model to replicate the actors themselves, and drop the ReplicateSubObjects - which, again, should be more efficient, right?
Not necessarily, Actors have lots of their own properties - and each actor requires it's own channel. You also then have to consider the possibility of race conditions between the different actors replicating in various orders.
So iterating over all of the UObjects in every tick despite them having not changed would actually be preferrable?
The engine is going to do that anyway, so it doesn't matter. Even if you split it into an actor, the engine still ticks that actor at it's NetUpdateFrequency to look for dirty properties
*If * a property is dirty, it's compared. If it's different to the previous value, it's sent.
Oh, that's true, it's only a fastarray of structs that benefits from the "don't iterate over the elements, because the array is not dirty"
Yeah - but even the Fast Arrays NetDeltaSerialize is called every NetFrequency tick, to check which elements are dirty
Oh, that's not 'marked' on the array itself when you call MarkItemDirty?
Something like "no items were marked dirty, so skip checking the contents completely"?
That's what FFastArraySerializer::NetDeltaSerialize() does internally, but the function itself is still called every network tick.
NetDeltaSerialize() effectively replaces a lot of the inbuilt dirty/comparison machinery, so you have to write it yourself.
Sure, but that just checks the array itself, not each and every item inside it, then?
FFastArraySerializer maintains a 'Dirty' list internally
So the takeaway is: if the data can be represented in a struct, use a struct, not UObject
Generally speaking yeah, UObject is only if you need inheritance or something
GDI, Lyra
But IIRC Lyra does what it does because it's trying to be as flexible as possible
But yeah, I'm not a fan of the way it does inventory either tbh
Particularly the "you need at least 10 classes to make a functional weapon" part
Hah
Yeah, I'm preparing to write my own system for that, considering that I need an actual RPG-like inventory, but I've already copied the same "fastarray of UObjects" approach for the quest system I wrote
And only now have stopped to think about how dumb that approach is
These are things that won't be changing 99% of the time, yet this approach still goes over every single damned item every time
Also, is it possible to use push model for elements in TArray of structs? I see a MARK_PROPERTY_DIRTY_STATIC_ARRAY_INDEX macro, but from the name I suppose that's only for arrays that are static
Yeah only works for float Var[2] etc.
Static Arrays are "unfolded" when they are members
Oh, so not static float Var[2] ?
no, can't replicate static vars
UPROPERTY() doesn't support them anyway
by static array I mean a fixed-size C-style array
Hmmm, so I actually might be able to use that for inventory - as long as the inventory has a set size
You can, but it's a hardcoded size
Yup, yup
Even if players could upgrade their inventory from, say, 50 to 100, it might still be a good fit if it only replicates the items that have changed - having an array of 100 with only half of it used is not really an issue if it's only sitting in the memory on server and client and doing nothing
all arrays only replicate the changed items
Yes, wrong wording on my part 😄
marking something as dirty only means "compare it" - comparisons are usually very cheap, the actual benefits from push model are usually marginal if even measurable at all
the main reason to use FastArray is a) large data sets, b) removal from anywhere in the array, c) callbacks for items
My concern isn't actually network optimizations - again, the items will change so rarely that even if it replicated everything, it would still happen only once every few minutes. My concern is optimizing the server side to not iterate over all the elements all the time
But why is it better for large data sets btw?
You literally can't stop the server iterating over all elements without rewriting the networking layer of the engine
... I thought you've said that fastarrays keep a list of items that changed?
Yes but that list will still be checked every network tick
The list of dirty elements
Yeah, that's fine
I just don't want to have the server iterate over all 100 inventory slots every tick
Because so long as you don't care about order (or if you can rebuild the order client-side), you can remove from anywhere in the array without subsequent items needing to replicate too
Items are identified with unique ID's, whereas in a TArray they are identified by index
Oh...
So if the index changes mid way everything behind it needs to update too.
Huh.
Assuming you do that and not just replace it of course
if you remove something form the middle of a TArray, then every item after that will have moved. There's a very good chance therefore that they will not match whatever was at that index previously
RemoveAtSwap would be faster most of the time, assuming the client receives/acks every update
But then why would you not use fast array? Callbacks. Seems to be more performant too?
Because FastArray has additional overhead of it's own
And it doesn't preserve order, so if you need to preserve item order, you have no choice but to use TArray
(Or you rebuild the order client-side with FastArray if you can do it deterministically)
But how much overhead are we talking about?
Every time it replicates it replicates the array replication key, the number of deleted indices, number of changes indices, and which indices changed/deleted - as well as the replication ID of each item, and the items contents.
It can now do delta-serialization of each internal item, but previously items would serialize in blobs - so you make any change to an item, the whole thing would be sent
The whole item or array?
whole item
By default however, it doesn't do that anymore - just the changed properties of each item should be sent.
(but those in turn have to be identified with headers, which are minimum two bytes each)
FFastArraySerializer::WriteDeltaHeader is the extra data that must be written (as well as each items' Key + Data)
Sounds pretty complicated to find out what truly is more efficient.
There's no one answer that fits all
Yeah, if TArrays had a mechanism to mark only specific items dirty so the server doesn't have to check all of them, I would gladly switch away from fastarrays
TArray on the other hand would be the TArray property header (2 bytes), and the item index (1 byte minimum). Then it's headers + data for the internal items.
If your comparisons are fast (e.g, it's a float property, pointer property or w/e) - then comparisons will be negligible.
But generally speaking if you have a large array of items, which changes fairly infrequently, and the order is either not important or rebuildable, then you may as well use Fast Array
Oh another caveat of FastArray is they cannot be embedded in structs - they only work if they are base member properties of an object
Yup, that's my case
Well, they can, but you lose the custom delta serialization if you do so
Why can't TArray just perform the same operations that are requested on it though? Lets say I want to remove index 4 out of 10 elements. Why can't Unreal say to just remove 4?
Because you have no idea if the client currently has the same value at index 4
I actually have another array nested in the fastarray, but that can easily be TArray - server won't even look at it until the parent fastarray entry is marked dirty, so that's completely fine
Well a FastArray will only replicate the internal array property, nothing else within it will replicate
But assuming the client doesn't change the array then the order should always be the same right? All methods TArray has are deterministic right?
The internal array is a TArray of structs, so I presume it will replicate that?
Yeah but since the engine can't guarantee that, it's not possible to do a generic implementation
FFastArray can only have one replicated property - the TArray it wraps around
Unless you are also for some reason writing/reading those additional properties yourself in NetDeltaSerialize - but I've never seen it done tbh
Not even certain it would work
Yeah, but if the TArray it wraps is a TArray of structs, and each of those structs contains a TArray of another struct, that should replicate, no?
yeah that's fine
At least that's what I'm rewriting it to now 😄
Although I guess the way I would be thinking of requires an acknowledge of the client which can make replication quite slow 🤔
Also clients could modify the array locally etc.
Well sure. But assuming you don't do that it would safe quite a bit of bandwidth no?
And fastarray can detect local modifications?
Sort of, the order of elements in the fast array can be modified client-side without causing problems
Each is identified with a unique ID, and a map of IDs->Indices is rebuilt each time it's serialized
You still need to ensure the client has the exact same state up until that removal, so I expect it's more trouble than it's worth
And not really in sync with the "lossy"-ness of replication in general
And, say, if you've removed 4th element, then 3rd - but the clients receives the 3rd removal first...
Well that's the thing you would do it in order.
The 4th element would have jumped to 3rd place, and the "remove 4th" would instead remove 5th
But that's where also the difficulty comes in because then the clients needs to acknowledge it made that change.
In theory arrays are completely deterministic, if you say "add this item to the last index" then a client can do that just fine. There's nothing I can think of that prevents a client from not being able to execute the same steps. The only issue is packet loss and thus you need to acknowledge from the client that you made a certain change.
And if that's all worth the effort? Probably not.
Almost certainly not. And probably adds more CPU overhead, which most of the time is the bottleneck rather than bandwdith
You can get away with sending a lot, it's the CPU time that kills usually
At scale anyway
This would not be so CPU intensive though. You just need to keep the calls to the array on the server in perfect order and replicate those to a client.
Just comparing properties is intensive enough already
But it doesn't need to. All it needs to do is store it in a queue for example and then push that in order to the client.
You'd still have to compare the elements for changes anyway, and what about arrays embedded in other properties etc.
You are aware of the changes because you would just override Add, Append, Remove etc.
Otherwise this entire idea would not work anyway.
But what about Element[0].Something = true; ?
That might be an issue yes.
Keeping the API/usability simpler is just as important
In that regard this sucks yes.
I'm trying to find the best way to solve this problem: For example, a client switches their weapon. The weapon has a draw time, and they are unable to start shooting until the draw timer has finished. Currently I am using a Rep Notify to run the same code on the client that the server runs when the ActiveWeapon variable is replicated. However, this leads to the client being unable to shoot for an extra amount of time proportional to their latency when they should be able to shoot already on the server. The alternative method I am considering would be to send a "FinishTime" so the client can start shooting as soon as they are able to on the server, and then change the draw animation speed to match. I would need a synced GetWorld()->GetTimeSeconds() variable for this though. Is this the right approach, or is there a better way?
Sorry for the long winded hypothetical
GameState has float GetServerWorldTimeSeconds() but I severely doubt the way that works is accurate enough for what you want as it's pretty prone to latency.
I'll take a look into it, thanks. But would you know the "standard" way of dealing with this issue? Currently, I either have to delay switching the weapon until I receive a response from the server, which doesn't feel nice as the client, OR I instantly swap it on the client and just don't allow them to do shoot until the draw timer finishes on the server. This will lead to a delay after the animation finishes where the players feels like they should be able to shoot but they are unable, which gets worse the higher the latency. And in both scenarios I still have to deal with the tail end added delay of waiting for the bCanFire variable to be replicated, so they are always unable to shoot for a little bit even though technically bCanFire is true on the server at that time.
I do not know what a good way / 'standard' way is to solve this. If you want full authority but still reactive controls then all I can think of is doing it similar to how the CMC works. Predict the local behaviour and then do the same on the server to see if it all matches up and if needed disallow/correct. But I'm still unsure how the CMC does its thing without having cheats and it's likely a very complicated setup.
But I have absolutely no idea if that's what people actually do or if there's a better way.
Yeah fair enough, thanks for the replies 😄
Valve actually has an article about it: https://developer.valvesoftware.com/wiki/Latency_Compensating_Methods_in_Client/Server_In-game_Protocol_Design_and_Optimization
Which I think is what I just said except the Unreal specific parts. They seem to just predict literally everything from holstering to shooting and then making sure it's valid on the server. So a pretty big setup.
There's also the question whether your game needs that sort of precision - either you are making an esports-level competitive PVP game in which case it will be played on local servers where the latency will be a few miliseconds max, or you are not and then... do 50ms really matter?
I kind of assumed we were talking authoritative behaviour here, if that doesn't matter by all means just let the clients cheat yeah / lag a bit. Will save a lot of pain 😅
It's more about making it feel good on the client. My ideal scenario I think would be it instantly playing the animation, and then dynamically changing the animation speed so it finishes EXACTLY when I would be allowed to fire again assuming a latency of 0ms. There will always be the added latency on the end for the fire request but that's just a given.
Players will generally have very similar latency, so everyone will be affected more or less equally. And those who are lagging, well, I think they will have larger issues than weapon draw time
Is it that detrimental to the good feel? Normal person won't have reflexes to click a mouse button the exact moment the draw animation finished. I'm not saying it's not a good example of how to solve latency-related things, but practically, does it really matter in this case? 😄
You can also consider if cheating is not a concern (PVE game for example) to just not care about it on the server.
Saves even more trouble.
Cheating is a concern
I'm factoring that into all the networking i'm doing
That's kind of the problem, if it wasn't I could make it "feel" a lot nicer on the client
Then the Valve article explains it and even warns you of it lol. But that's the way to do it I suppose. Just be aware it will take a decent amount of pain and time. If this is for a game that is just starting out by all means just ditch the authority and make it feel good first and then worry about authority if your game grows.
That's my two cents 😄
I guess I'll just have to do some reading 🙂
Thanks for the link
Out of curiosity, are you doing bullet hit traces on the server, or on the client and just telling the server what the player has hit?
On the server ofc
And you are concerned about feel good of weapon draws? 😄
Tracing on the server lags behind, that's what they mean.
Yeah I was looking into rollback netcode too
Btw, just to add something about net optimization https://vorixo.github.io/devtricks/network-managers/
it includes a little taxonomy of different replication strategies
and their CPU implications
Thank you 😄
If you do it on the client aren't you opening the door to all kinds of problems with cheaters?
Oh you are
you do hit detection on client and validate the hit in the server
it adds some room to cheaters but if your validation is decent enought it will be fine
What I meant is that if your latency is bad enough to notice that you can't fire the moment you finished drawing a weapon, then you will absolutely notice not hitting targets that you shot at
I mean rollbacking your shots is also not a holy grail btw.
Issue is with spread then, I have a recoil pattern with random spread similar to cs. If you do that on the client you can have no spread cheats
😩
Oh it's a CPU optimization xD
I was so confused at first lol.
Yup, rollbacking will make sure that the player who shot did hit the target - but it will feel horrible to the target, because they will suddenly die even though they have ducked behind cover 100ms ago
I was thinking of caching hitbox transforms every x amount of ticks and depending on client latency use the older position?
Well yes that too, but it still allows cheating in two ways Bachelor.
yes the most like you'll have to do
I think this problem is unavoidable if you want to make it feel good on the shooting client
Idk man this shit is complicated
It is, which is why I'm surprised you are focusing on draw time 😄
tbh... the capsule is enough most of the time unless u want to go full competitive lol
Yeah fair enough 😂
If this is for a game that is just starting out by all means just ditch the authority and make it feel good first and then worry about authority if your game grows.
That's my two cents 😄
I just hate the idea of this though
I think you should rather hate the idea of spending weeks if not months on making it cheat proof to A) still have hackers and then B) likely wasted a ton of effort that you could spend on other things. If your game becomes the next CS:GO you can afford people to help out and fix stuff like that.
If your game however never becomes anything because you just kept worrying about authority you lost quite literally a lot.
"Favour the shooter" is the only sane way tbh
Yes
Server-side is detection is garbage
Server-side detection is still not cheat proof anyway like I said.
yeah
Regardless of having full rollback perfection or not.
You need to validate both where the shooter fired from, as well as what they hit
You can still do aimbots sure but that is unavoiable outside of prevent the cheat running to begin with
The spread is what I am wanting to keep server side
There's also something called 'lag compensation abuse': https://youtu.be/JXzkcKP_qFU
- fake latency caps at 800ms because any ticks older than 1 second according to the server are discarded
- most CS:GO servers use the default value of 200 for sv_maxunlag,
if you're wondering why this was released today, old channel got BTFO
lag comp video: https://youtu.be/6EwaW2iz4iA
Cheat: Aimware
Music: Crypt of the Necrodancer ...
Nout you can do about aimbots really, that's where heuristic anti-cheat comes in
and also there are mitigation techniques to avoid no-spread cheats
and rate of fire
and on the likes
I really don't want to calculate the random spread on the client, but that makes doing the detection on the client very hard
Use a seed, send the seed to the server - make sure they are using the correct seed
Oh okay, so the spread is linked to the time
Also Vori I may hope this is milliseconds right? Wait nevermind it is yes.
its like added layers to your onion
mhm yes :3
Yeah I just noticed the side panel xD
You can only validate so much, as soon as it becomes a detriment to regular players you just have to accept it
I guess you can make sure the client time is within like a second of server time so they can't find some preset time with good spread
Shooters are just a horrible genre network code wise lol.
anyone with a ping greater than 1000 is fucked anyway
Yeah I'm beginning to understand this lol
also... you can do server tracing if your player has high ping
...
an hybrid approach
its what UT4 did
and iirc also Battlefield 1
so let clients with 120 ms or less do client tracing
I guess i'm setting my standards a bit high for some shitty little game not many people will likely play
and those with 120 or more server tracing
I would like to learn proper networking regardless
I once again stand by this.
Yeah I get your point
Learning is something else than publishing a project though.
Ghetto, you'll find out that even in the industey these models arent totally bulletproof
Worry about it when it's a legit problem is a valid approach tbh, we shipped HLL with precisely zero anti-cheat or lag comp
And some stuff is very hard to get your head around without an actual playerbase exploiting it
Oh James maybe you could tell him the teleport cheat you had goin on in HLL
that was interesting XD
tbf you can do that in virtually any UE game
The what happened?
Effectively with the stock ShooterGame code, you can teleport other players to you client-side, shoot them, and the server will validate the hit
it doesn't care about where the victim is, only where the relative hit location is. Utter memes
Oh I thought teleporting as in the CMC lol.
lol, awesome
https://www.youtube.com/watch?v=2degQm1dZP0&t=11s
Video of it in action
Great stuff lol.
What's actually happening there?
BTW - you can totally do most of this in Lyra 🙃
Is he teleporting enemies in front of him?
weapon speed hax, ez
Just teleport clients locally yeah. That's what it seems like.
Yeah - the shootergame code only cares about the "relative" hit location, so you can teleport them locally, get a valid hit, and tell the server
That's some terrible code right there.
Also speed hacks yeah?
You can speed-hack CMC still but I'm not sure on the mechanism
I only just realised how speedy they are xD
Oh I was worried this might be a thing
Wait you can speed hack CMC? Wtf?
tbf we did once ship the client in development mode which also included all of our console cheats. doh.
fun stuff... happened to us in GIT aswell
I mean as long as you patched it afterwards..
TotallyLegitCheatsNotA0DayCryptoMiner.exe
yeah most of the shootergame stuff is long gone now
Trouble is if you base your project on an Epic sample, it makes the job easier. A lot of the cheats that work on PUBG, Lawbreakers, Valorant etc. are carried over because they all use the same core
The engine + samples being open source makes it easy
if epic would put the samples in github
things would've change
and i can tell you first hand
there are looots of fellas interested in having a resilient sample project to avoid reinventing the wheel every time
Lyra is a great sample
if only it could be put in gh
And that's clearly why we discuss it an open public Discord with tens of thousands of people 😄
tbh most places are unwilling to give over their anti-cheat secrets tbh, and I can understand why
"security through obscurity" is a crap approach but it's about all we've got until the world is on quantum internet 😄
ofc, but we are speaking about 101s here nothing too serious
be lying if I said I hadn't thought about it though 😄
But also... that's my livelihood now 😄
hahahahahahah
yes
on my behalf I am mostly against bad practices
and i think those must be addressed at the root
at least with a simple good practice
Forgo PvP - embrace Coop only. Ignore anti-cheat
"this is how you make a fully predicted vehicle network resilient"
XD that's too much for starters
Even in co-op people try to ruin others their games. Kind of sad honestly.
That's why it's friend invite only 😈
😂
lmao the best anti cheat system is a report button
"vote to kick"
(drama - it wont work)
Nah - people do bogus reports because they're salty they lost.
Co-op is actaully worth for griefing because you can't do any thing about it.
I had already committed to my statement before you mentioned drama.
At least in pvp you can fight back.
on GiT we gave Listen server owners buttons to kick/teleport/broadcast messages
it was hilarious
it lasted online 1 hour
Oh oh xD
Horror Game fun stream in an hour 😈
I found this article which is pretty cool https://medium.com/@invicticide/accurately-syncing-unreals-network-clock-87a3f9262594
When implementing real-time network multiplayer in a game, one very important tool is a reliable network clock.
Knowing how long requests are taking should help a lot with clientside prediction
That way instead of having the roundtrip request-response delay which gets doubled when I am using a timer after the response, I can reduce it to just the request time (the ping) as long as whatever action I am doing takes longer than the roundtrip time
Still the clientside line trace really rubs me the wrong way, and will lead to shit like that HLL video you posted xD
I really don't think compensating for the RTT is really worth doing
for rewinding, you actually need the latent time
hey, so I know that the PlayerState might be null a few seconds after loading into a level... but I thought that overriding OnRep_PlayerState meant that I could always have a valid PlayerState. Is there a known issue with this?
But if you know how much time has passed you can subtract that from your timer and have it finish at the same time as the server?
Unless I'm misunderstanding
well it isn't for that, when I say I hit someone, I want the server to rewind to the time I thought it was
without accounting for RTT
Ah right, yeah I mainly talking about for simple timers, like weapon switching
So you can start drawing and finish the animation at the right time
even for those you can dumbly predict them on the client
But for shooting yeah you'd need rollback netcode or something more complicated
that's why I actually objected to the PR with a comment
the game I previously worked on actually depended on that server time behaviour
do what exactly
for timers, it was just as I said, dumbly predicting
and it worked well enough
How can I tell a client if players connect or disconnect to the server? (trying to make a UI player list with scores)
there are Login/Logout events on the server, but I imagine this is just iterating through player states?
Are those on the GameMode or on player state?
GameMode
What's the best practice for conveyor belts that transport characters in multiplayer? Obviously add actor world offset doesn't sync very well, so should I rather make a conveyor with real moving meshes and hope that the CMC takes care of that or is there some other trick?
Login gets called if the travel was hard. HandleSeamlessTravelPlayer for seamless. If you want one that is travel agnostic use HandleStartingNewPlayer @blazing socket
Yes that's a known issue, and it's because PlayerState takes a bit more time than other GameFramework classes to replicate. Though you might still have the issue even if it replicated faster, so the way you should be handling it is the way you already handling it now
I sent a more precise synced clock without destroying the engine's one
@worn wagon #multiplayer message
Oh awesome, I'll take a look
its inaccurate the first 10 seconds but after that its aight
i like more this approach as it isn't destructive with the vanila timestamp system
which btw it is usually good enough
rewinding is also possible with this one as the delta offset can be calculated with current - previous
so its not a drama
Best practice or a hacky practice?
The ideal solution would probably involve overriding the base velocity calculation
so you trick the CMC into thinking it's moving when it's not
How hard that is, idk
Problem is the character also has to be able to move on the conveyor
I guess I either have to make a real conveyor with moving segments or go for some trick with add force
I mean base velocity
the velocity of the thing you're standing on
CMC can already do that
so just trick it into thinking it's moving
ah my bad, yeah that would be easier than having actual moving meshes
It looks like it's virtual, have fun
thx, I will xd
Hey guys, I'm having issues replicating a mesh's movement, I've ticked the 'Replicate Movement' tick box in the meshes settings but still isn't syncing for all players?? Could it possibly be because I have placed it in the level as apposed to having it spawn in after a set number of seconds (via say a gamemode bp). Any ideas?
@cosmic epochFound this in the Character.cpp, there's a utility namespace that does the calculating for you.
You'll just wanna add to that, OR override the GetUnrealWorldVelocity() for the component. IDK which way would be easier. I would prefer overrideing GetUnrealWorldVelocity() myself.
Then your CMC or Character don't have to do anything special, all your changes are in the conveyer belts.
thx, much appreciated
Thank you 🙂
In BodyInstance
Shit that might work for my wheel/tank tread idea too
just trick it into thinking its moving and let the physics/cmc go with that info
You would just add float ConveyerSpeed x vector ConveyerDirection to that calculation for Linvel
yeah sounds like the most straight forward way, I just hope the CMC plays along and doesn´t start jittering or whatever
If the speeds are constant it should but you never know with CMC, it's a behemoth
yeah
i mean adding actor world offset works too, but it´s a mess when ure starting to run or exit/enter the conveyor....
Although subclassing BodyInstance..... ugh idk bout that lol
I will try to just override the entire get movement base velocity function for my CMC
and have a bool
like bUseConveyorVelocity
LOL
nah that'd be too wild
my conveyors will have changing flow though, but not constantly, I guess a synced timeline will do fine more or less for that
The CMC only jitters if you:
- Perform a Move that needs to be saved client side but isn't (e.g. a bDash flag missing)
- Perform a Move on Server and Client with 2 different states (e.g. speed)
And 3. whenever it pleases
ad 1), Kaos said he sprints without a flag and corrections are so minor they´re not relevant in his case
Yeah that's more or less a "I don't want to fix this issue." solution :D
But sprints are also so simple, they are fine
I mean apart from the conveyor belt, I already have a launchpad, which, surprisingly works well, I just add Impulse on overlap to the character, and I add it on both owner and server xd
yeah I personally do have a sprint flag in my CMC
I also have a force volume, which pushes the player upwards constantly, also works fine, doing Add Force on tick, 0 issues
so adding force or impulse does seem to be ok with the right timing when done on both server and client
You testing with lag and jitter?
120ms + 1% packet loss, it´s a competitive arena game, ure better off not playing it above that ping
If the forces and such are static as in they always are the same in the same location I'm sure both sides would agree.
yep, they are
As a fallback you could just lay a force volume sideways for your conveyer but lemme know how overriding base velocity works for you.
yeah surely will do
Things that are based on player location are basically automatically synced
cause you step onto it in the same timestamp
also that´s what I meant earlier with tricking stuff with Add Force (and lower friction too ofc)
So you apply the force at the same time
yeah, that´s atleast what I always pray for 😄
E.g. a JumpPad is actually very in sync
cause with the CMC, one never knows......
so funny how the official unreal tutorial for conveyors shows the one way that is sure to not sync nicely in MP xD
add actor world offset falls apart if ure moving while on the conveyor
UE tutorials are shite in a lot of cases
At least the first few months/years produced a lot of weird things
the vid is from 2015 😄
Dynamic Speed changes are basically impossible to "sync" without an initial correction
So you'd basically just set it on Server and Client and pray
Fixed speed values, like a sprint, can be part of the CMC and based on a flag the client can send to the server, such as the jump and crouch flag
But the initial correction from changing speed (back and forth) is usually minor
It triggers at sqrt(3) or so, and the Mesh usually interpolates, so you don't see it
Very new to Networking here, just want to reassure if this is the "correct" way to do replication. So I have a feature here to cut off your rising velocity when you release Jump (like many platformers do), so what I do is I invoke an event on the server to reduce Z velocity and then do it on client, like this
And CutoffJumpScript simply looks like this
But what I do here is that I get the client velocity and server velocity respectively, and I dont know if that's a good or bad thing
Doesn't stop jumping kinda already do this?
I think it just stops adding velocity
I mostly wonder if this looks okay at a glance. I was mostly wondering if I need to do a server request to get the characters velocity to set the clients with that, or if this works
It might be placebo but while it does work, it feels a little off
It's basically the same idea as sprinting
You tell the Server that you released the key
That's mostly all you can do in Blueprints
If you want it proper you'd need to do it in C++
There might be a small correction where the Client either moves with full Z velocity and the server doesn't or other way round
But that's one frame and it's gonna be corrected and you will probably not notice it visually
Fair enough
Speaking of, how different is Replication in C++ in comparison to Blueprints
Can you set UFunctions as Replicate on server/Multicast, etc in the parantheses and that's that or is there more to it
It comes with a bit more boilerplate code
But in general it works the same
Gives you a bit more power in same cases too
GetImpartedMovementBaseVelocity() is exclusively used for jump off velocity it seems....
it really does fetch the MovementBase component for everything else
Turns out it might have been fixed by using the "Get Last Update Velocity" node instead of "Get Velocity" node directly. Perhaps it's more synced up that way with the velocity calculation. If I used Get Velocity the min jump height was shorter for the server, but longer for clients
nvm, the GetMovementBaseVelocity function that u mentioned is actually inside character.h, I misread again
is there any function in the GameMode class that I can override that gets called when a player is being spawned
My purpose is that I want to grant each player a weapon actor when they spawn
I'm trying to use HandleStartingNewPlayer but the controller given from the event does not have a valid pawn until like 0.1 seconds later
I need to use a delay in order to wait until there is a valid pawn, which I don't really want to do
I need to execute my code after the pawn has been spawned
How about using on received restart or on possessed instead
oh hey nice OnRestartPlayer seems to work nice
the pawn is actually valid when the event is called
cool, thanks @cosmic epoch
No problem
That's not correct. It's done automatically for you. The entry point is HandleStartingNewPlayer
Yes. Even if you use PlayerStarts or you don't, it manages to spawn the pawn accordingly
Calls functions like FindPlayerStart and does some checks along the way
The whole pawn spawning call graph is a rat's nest, there's a ton of options
and I think HandleStartingNewPlayer just bypasses all of it but I'm not sure.
Yeah too many things going on in there ^^
So the issue I'm running into is that when I spawn a weapon on the server, it takes some time for it to replicate over to the clients
and the thing is that I tell the player to equip that spawned weapon right after I do SpawnActor from the server
so when the equip function on the client gets called, the weapon hasn't yet been replicated over for atleast another hundred milliseconds
That's why you should equip only when the weapon replicated
Yeah how do I do that?
OnRep
UPROPERTY(ReplciatedUsing=OnRep_MyWeaponActor)
^ Above your weapon actor
And you call that equip function inside the OnRep function
I'm doing this in BP at the moment
I can do it in C++ if I need to, but is there a way to do it in BP?
In BP it's called RepNotify
oh yeah, right
That's some classic networking issue, where you run into null references due to not replicating in time you need the data
That's why OnRep/RepNotify is there
Heh, I forgot, I actually defined the weapon var in C++ anyway
welp, I guess I'm doing it in cpp after all, I guess it'll be a bit faster that way
I think maybe waits for players to start?
Does it wait for all players to join in?
I think without it it'll be off to the races on load and not wait for anyone
zero players
but it's either that or waits for all players to ready up
or a start game call
It has to do with that if you use the MatchState enum inside AGameMode
I'm not sure what it does in action though
Sure thing it's from the days of UT
I remember myself years back setting it to true inside ShooterGame and what it did, it just never started the match. I guess I could play as a spectator and just roam around, or probably just freezing in place, can't remember
But ShooterGame is heavily affected by this MatchState system. If you do it in Lyra today, prolly nothing would happen
Depends on if it aligns with your game design
if you're making a match based shooter than sure.
Something you have to understand is that GameModeBase is different from GameMode in that GameMode is designed for shooter games with match states and it really offers you too many things that GameModeBase doesn't. GameModeBase is more of a generic type of game mode that is meant to fit any type of game really
Yeah
I use GameMode
There used to be just GameMode and no GameModeBase but it got split into those two a while back
Yes, that's why I spend my time doing "Find Usages" on stuff ^^
I can't remember the last time anyone has talked about the built in Spectator system.
I did btw
Have a nice read 😄
Are you working on one?
Good stuff, now you know how to make it more sophisticated ^^
Do I make it more sophisticated? I can't promise, read so you know xD
btw I just pushed an update so prolly refresh(or clear history for last hour) or use another browser in case you already opened it, so you get the update immediately
Hey, I need some kind of sanity check. I have my Character and Character Movement Component marked to replicate. Server works fine, but the client's movement components are not updating.
Get Current Acceleration always returns 0,0,0 on the clients
This used to work fine. I've obviously changed something and I'm not sure what
This data is replicating perfectly, as are player states (dodge, roll, blocking, etc)
hey whats up everyone
i'm running a dedicated server on my local network. how do i connect to it from the client
i forget the command
is it open?
for some reason open isn't working from pie
maybe i have to run it from the client itself
try it from a launched game. just right click uproject and hit launch
That's how I do all my testing, server and client
you can launch a server like that too so you don't have to build, just yoink from source control and run a batch file
yea im gonna set up a pipeline soon but just trying to get it to work
i have the server on a container
it's up and running, just need to connect to it. im compiling the client now (just pulled source recently and apparently had not compiled the game with this source) lol
gonna take a while
OH SHIT IT WORKED
i just had ot open UDP!
bro how is this running on my
LAPTOP
LOL
linux
im losing my mind unreal engine is the best engine ever made man
You can probably run 10 instances on your laptop, maybe more
stop talking dirty to me bro
That's how they scale out game servers, many instances on a single machine. Although yours looks like it's doing some work or that's a wimpy laptop
im gonna set up persistence right now in the game
it's an m1 macbook
im gonna set up persistence using sqlite
It should slay but maybe there's some considerations due to M1.
more than likely
this is rosetta
it's not compiled for arm
.......maybe i can compile for arm
LOL
You'll probably be in uncharted territory trying to do an ARM dedicated server but I see no reason it wouldn't work since you can build the game for ARM targets
omg
there's arm64
lmao dude im losing it
i cant believe how freaking cool this is
there's some challenges. the container is 12gb
excuse me, ONE container layer is 12gb
it's about 20gb in total
I'd recommend just getting a dirt cheap x64 box and slapping Ubuntu on it and using that for your dev
since that'd be what's running your real servers most likely
yep that's exactly what i mgonna do
ive got some other ideas 👼
but i will have a dedicated box for builds and a dev server
I got paid 200 bucks to take an i7 4700k computer so that's what I use it for
I paid 100 for the computer and sold the crappy GPU for 300 at the peak a few months back
Yeah cross compilation is spooky territory, I got it to work on linux but I rather like just launching from a linux editor setup
5 seconds from committing to source control to relaunching the server
Yeah it's called I reach over to the other machine and hit build
lol
Or don't even build if it's just a Content/BP update
do you have to build from source to be able to have the dedi server?
unfortunately, yes
at least thats what i experienced
it wasnt letting me package the server
you can probably get away with running it from the editor
i am not sending the dedi out id be hosting it myself
but yeah ty for the info.. seems like a huge giant misstep on ue part.
eh, it's hardly a giant misstep. but it is a minor inconvenience 🙂
takes forever lol
what did ya do today.. i made a 1 line change then spent 10 hours looking at 1>[773/932] Compile Module.
😛
lmao
to be fair... i've compiled the engine once yesterday, and i've built my game four times already on different configurations
so maybe you need a faster computer? XD
You can just launch a dedicated server if the machine has the engine on it
i built the wrong configuration so now i'm building again lol
That's nice for testing
yeah just use the editor
you can put launch args in your IDE
use -server
it'll launch a dedicated server
trying to work with ows2
you can also set up like a batch or python script that'll launch the UnrealEditor.exe with the arguments you want
wtf is ows2
Open world system
from sabre?
yeah
yup still a thing
it's interesting that this is a tool that's out of the box for this
but i'm literally just gonna write this all myself and pray it all works out lol
i am not going for massive just for more say 100 clients in a persistant world
100 clients is a lot lol
on the screen? replicating?
the M in MMO is mostly powered by trickery in a lot of games that aren't world of warcraft
spread out
That's way harder than you would expect unless it's something dummy simple like 100 people playing Chess
Not to mention you need like 10,000 players to have 10 of them online in the same region
Is GameLift Managed Servers SDK working correctly with UE5 ?
Hello guys, I'm wondering what's the best way to interact with niagara component on the map. To use a get actor of class or something else? Or maybe let them spawn by the gamemode?
any idea why my multicast play sound wont trigger on clients?
is that an actor?
what exactly?
How are you calling the server event and which actor class is it
the class
is this actor replicates?
Then your actor need replicate
which actor class is it
just actor
Make sure the server events are called.
it is
Make sure the multicast is called
it does the score logic
but it doesnt do the multicast
the multicast is called but only on the server
Guessing the code you haven't shown between the add score event and the multicast call itself simply doesn't reach the multicast
its here
Does the string print
yes
its really just the multicast not being called on the clients
but on listen server it does
ohh damn im stupid, i forgot to make the main actor replicate
My weapon doesn't seem to be replicating the fact that it's physics simulation is disabled on pickup. I've tried replicating everything but nothing works
How are you trying to replicate it though?
This could be a silly question. But I have a Widget replicated to each client & that works fine. However only the host can use any buttons?
Hi! Is it possible to use actor owner's location for replication cull distance?
I have an equipment, that gets attached to a character, character replicates, but equipment does not, and it gets culled when I'm far from world center.
I could attach it to a character on server as well, but maybe there is a way to make equipment use owner's location as a net cull distance origin?
I'm a bit confused about what you're trying to do because if it's not replicated then I don't see how it could possibly become irrelevant to others? But anyway you could for example use the "Net Use Owner Relevancy" or you could if you're using C++ override "IsNetRelevantFor" and implement your own way.
Checks to see if this actor is relevant for a specific network connection
NetUseOwnerRelevancy?
Thnks
That's a bit of a clusterfuck
You're trying to DoSomething when a team scores right?
yes
Are you familiar with how big of a project implementing P2P would be in Unreal?
Are you using GameState now or still your actor that controls the game?
actor
OK so:
In Goal Actor
Detect score -> branch on HasAuthority -> destroy ball or whatever -> get GameControlActor -> call TeamScored
In GameControl Actor
Event TeamScored -> Update scores etc -> call MulticastTeamScoredEvent.
MulticastTeamScoredEvent -> Play sound, etc...
The only RPC in this entire chain is MulticastTeamScoredEvent
everything else happens on server only
The weapon gets attached to a pawn so I thought it would naturally be replicated as a result of that. Even if that's not the case then I've literally selected replicate on everything so I just don't get it
I've tried making it multicast so that the server doesn't have to replicate something like simulate physics bool but that breaks something else
Ew no
that means that the CLIENT is saying if a goal happened
now
the owning client is probably the server
but that can just be a regular event
just detect the overlap on server and proceed as normal
but then i cant score points lol
Yes you can. THe overlap on the SERVER is the one that counts
Event Overlap -> Are we on the server? -> Get GameControllerActor -> Tell it someone scored
Just do this and it'll work
#multiplayer message
but i still have to check if the actor has the flag and is in same team as the goal
Yeah, what's the problem there?
the actor has the flag on the server and the goal has a team on the server
its all on the server
but isnt this also on the server?
Yes but that can just be a regular event
ok i see
it is behaving as if it was a regular event right now because Run On Server and Run On Self are the same thing because self is server
but that's just a fortunate quirk
None of what you just showed should be an RPC (Server/Client/Multicast) event
ONLY the stuff in GameController that happens after Event TeamScored
So make DeliverFlag and TeamAddScore just regular events
In the GameControllerActor you'll do this
Event TeamAddScore -> do score stuff -> call MulticastTeamScoredEvent
MulticastTeamScoredEvent -> do stuff that everyone needs to have happen like audio and popups and announcements etc etc etc
You ARE on server
you should have a switch on authority before the isvalid node tho
wait nvm
you did that in the event overlap
but you ARE on the server this whole time
A replicated actor is on server and on all clients
yeah but i mean it still works even if i accidently make it replicate to server
Yes, the only time you should be calling a run on server event is when you specifically want to pass some info from a client to the server
Anything not specific to a single client is all on the server doing its stuff
You'll pretty much only see run on server events in your character or playercontroller
yo, so i wanted to transform the player from one location to the other, i am doing this by using a timeline and then i call an event that sets the position based off of that, but i am getting lag when i do this, is there some sort of way to do this that i should be doing so i do not get the lag?
For testing purposes, I'm doing a single moving platform (moved along a spline by a replicated timeline). The platform seems to move perfectly in sync, as does the character while standing or walking on it. However, every time I mount or jump off the platform, I get a pretty noticeable server correction
Any idea if that's just the CMC being buggy or a problem on my end?
Try a replicated timeline maybe? Also disabling the CMC while ure manually setting the character location might be a good idea
Disable as in movement mode none
How can i fix this ?
NotifyAcceptingConnection accepted from: 83.121.36.119:33841
LogHandshake: SendConnectChallenge. Timestamp: 8172.655425, Cookie: 206013044159225054091214215086060075126164234022164151206118
this happens hundred times and makes dedicated server irresponsible
update: what i did instead was i called the movement non replicated and then called it on the server
sounds like youre getting hacked
😂
If its coming from a single IP address I think you can just make some sort of firewall rule to drop the incoming request, but if its coming from multiple IP addresses you might be stuck.
at this point i genuinely cant tell if yall are trolling this man or if you are fr
@rocky stag Who's your hosting provider? Do you have access to firewall?
The game was tested on a local network
thats the funny thing
So you're hosting your own server?
Its obviously exposed to the internet unless that IP is on your network or something. I dunno where you live.
What's the best way to replicate adding static mesh components to an actor?
Same way to replicate anything, it depends on your scenario. Is it changing frequently? Does it affect gameplay? Is it just for VFX? Does everyone need to see it happen live? What if someone joins late, do they need to see it too?
I like to use repnotify for most things, so I'm only sending a bool or some small value over the network, then when that value changes a function runs to do something.
So in other words don't think about the problem like you're trying to replicate the actual adding or removing of the mesh over the network instead think about replicating a boolean which represents the mesh's state. Then use repnotify so you can have a custom event handle the toggling of your actor's mesh.
Does rep notify trigger when someone enters a session?
Replicated variables are kept in sync, so if someone joins into the session later on they are automatically updated to the latest state of all replicated variables.
It triggers whenever the variable changes.
Example: A light switch can be on or off.
The level default is for all lights to be off. Player A and B join a session. Player A changes the light switch on and both players see the change. Then later on Player C joins the session and will see the light has been switched on.
Check the pins for a nice example
But if you're using RPCs with that light switch scenario, the 3rd Player C wouldn't see the light switch as on. It will still be off for Player C, but both A and B would see it on.
Because Player C wasn't in the session when that RPC fired.
Ok. Using a repnotify might be my best bet then. Thanks for the help.
I need help making client orientated replication, everything rn is just replicated over network so it is delayed for client
Alright so I have this almost working
So it executes it on the server first then it checks if is local controller, and then runs the animations for client
Although issue is now it plays the client animation then a sec later (depending on ping difference) plays the server animation
How would I have the client animation play ONLY for the client
Right now it is playing client and server
is their a way to fix this weird jiggly issue? i have two characters standing on a moving pawn but it jiggles underneath them, the effect is even worse in standalone
Is there a alternative to using capsule's rotation for forward and right direction so that the mouse rotation won't effect the movement? Currently using capsule causes ator rotation sync issue between server and client. If I enable comp replication for capsule then the movements get shaky.
Forward and right can be whatever your heart desires
Read up and make sure you understand ControlRotation and what it is and how it works. Basically it's a rotation in the controller that can be used for a lot of things and most represents your view rotation.
You can either have the capsule use it or not.
Are you using the CMC?
Yes I'm using CMC. I can't use control rotation since I want the movement to be based on the character facing.
yes
if I use character->GetActorRightVector, the actor rotation is still diff. https://gyazo.com/f0347dcb695d9017d5677209a5ff6ecc
So when the character is facing left, and you press W/up, which direction do they go?
Those values are when flying. After I land then press forward my char rotates to server value and syncs
Are you using the flying movement mode in the CMC?
yes
So what's different about flying? Other than the no gravity. What changes?
Rotation Rate. I think that's the culprit. Now the diff is way lower.
I was using multicast to set the rot rate
I mean control wise. When you're walking, the capsule rotation is driven by.......what?
And then when you're flying, the capsule rotation is driven by.......what
Ya don't do that lol
That's gross
And will never be in sync
So server should set the rotation rate. right. let me try that. But it didn't work for client. that's why I had to use multicast.
Ew no
That will drift over time
Ok, plain English. The capsule points towards ..... What?
I switched to character->GetActorRIghtVector, since it does the same thing.
Dude. I'm asking you. Right now, what is your rule or function for determining the rotation of the capsule?