#multiplayer

1 messages · Page 729 of 1

bitter oriole
#

You do not need any concept of IP or port

#

You can forget about those forever

#

What you want is "create session", "find sessions", "join session"

#

Using the appropriate online subsystem

potent coral
#

yeah i made these

#

but not sure how its supposed to actually find a session without specifying an IP

bitter oriole
#

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

potent coral
#

and how does it know if its a session from my game or some other random unreal game?

grizzled stirrup
#

public IP of the machine you are hosting on

potent coral
#

what if i have 2 public IPs? will it use both?

grizzled stirrup
#

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

potent coral
#

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

grizzled stirrup
#

Have you opened the level with ?listen

#

If you haven't even with a created session you won't be able to join

potent coral
#

at least i guess thats what this part of code does

grizzled stirrup
#

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

rocky stag
#

how can i make unique net id repl from unique net id string?

hollow ginkgo
#

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

arctic hazel
#

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

latent heart
#

Not "within" UE, that'd be down to whatever backend service you're using to spin up instances.

arctic hazel
#

I c.. hmm need to figure it out

rocky stag
fathom aspen
#

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

arctic hazel
#

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?

half oriole
#

Yes lol

#

You probably don't want to be handing out access to SQL through clients

arctic hazel
#

hmm.. need to figure out a way to handle it then unless keeping game open world, but that would seem annoying

rocky stag
arctic hazel
#

yeah but when they go into an instance i want a player to get their own instanceID of it

#

but keeping items updated/saved

twilit radish
#

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 🙂

dark edge
arctic hazel
twilit radish
#

Then load it again if they move to a different server.

arctic hazel
#

but if its peer to peer? the instances

twilit radish
#

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.

dark edge
arctic hazel
#

hr

#

yea listened my bad

dark edge
#

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.

twilit radish
#

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.

arctic hazel
#

so cluster would be the only proper answear for it then? so its a dedicated started up when a player asks for a instance.

twilit radish
#

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.

dark edge
#

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.

arctic hazel
#

defeat cheating in 2022, that be a dream lol

dark edge
#

But honestly if this is your first commercial game. Don't do it.

twilit radish
dark edge
#

This is like your first car being an F1 car.

arctic hazel
#

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.

twilit radish
#

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.

arctic hazel
#

fair warning and appreciated.

dark edge
#

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

arctic hazel
#

bug to loop host new instances causing a massive bill

#

sounds.. fun

dark edge
#

I mean Space Engineers only hosts like 30 servers themselves, and they've done fine.

dark edge
twilit radish
#

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.

arctic hazel
#

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.

dark edge
#

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.

arctic hazel
#

Oh you code alot of Gmod?

#

Its where i started back in 2009,

dark edge
#

I'm working on a game inspired by GMod, or rather by WireMod and ACF

arctic hazel
#

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,

twilit radish
# arctic hazel True, Publish aint in my scope ever unless local with friends, and was thinking ...

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.

arctic hazel
#

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

acoustic drum
twilit radish
#

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.

acoustic drum
#

A proxy for the database is to prevent malicious behaviour which is what was intended in my message

pallid mesa
#

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

acoustic drum
#

Its amazing how successful COD multiplayer has been with their p2p model

twilit radish
#

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.

acoustic drum
#

I suppose a lot of people buy it for the campaign

arctic hazel
#

There wont be any "PVP" but will be PVE Group-based

pallid mesa
#

but with a listen server model you are alwaya screwed

arctic hazel
#

and would suck if someone comes in with cheated weapon and 1 boops a 20 min fight

pallid mesa
#

sorry to ruin your world

acoustic drum
twilit radish
#

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:

arctic hazel
#

cheaters always cheat, even outside games.

acoustic drum
#

Damn

#

That was pretty deep

#

Who hurt you man

twilit radish
#

😂

arctic hazel
#

lol

#

32 yearsof life :p olly

acoustic drum
#

God i hope I dont have to make it to 32

arctic hazel
#

plus sweden ig..

acoustic drum
#

Hey at least you're doing the world favours over there

arctic hazel
#

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

acoustic drum
#

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

arctic hazel
#

never figured out how to use it more then listening and connecting thru steam and using friendlist/groups for invites

acoustic drum
#

Steam does however ask for 30% of sales and on top of that you have 5% revenue from epic

twilit radish
#

Steam limits you to their platform btw.

#

That's the big "catch" with it.

acoustic drum
#

I wouldnt say thats a big catch tbh they have so much exposure

arctic hazel
#

so could inventory be stored thru steam then or would it still require a sql db in the end?

acoustic drum
#

The biggest catch is 30% off your sales OUCH

arctic hazel
#

not if its a free game dun dun dun

twilit radish
#

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 🙂

acoustic drum
acoustic drum
arctic hazel
#

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.

twilit radish
# acoustic drum The biggest catch is 30% off your sales OUCH

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 😛

acoustic drum
arctic hazel
#

still seem to know few bits that i dont :p

acoustic drum
arctic hazel
#

even a 3$ game can make a fortune with right quanity

#

:p

twilit radish
#

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.

acoustic drum
#

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

acoustic drum
arctic hazel
#

Sent you in dms olly, Current project i did when bored in 7 days b4 arriving here

acoustic drum
#

Fortnite is free and they seem to be doing something right 🤣

twilit radish
#

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 😛

arctic hazel
#

been here for.. uh.. 43 days now

thin stratus
#

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

twilit radish
#

So again.. Steam 😄

thin stratus
#

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

twilit radish
#

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 😂

abstract fulcrum
#

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

cinder steeple
#

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?

acoustic drum
cinder steeple
#

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...

acoustic drum
#

It may not be your lack of concision but my lack of understanding. I'm afraid I dont think I can help sorry

cinder steeple
#

no worries, seems like there is no way to ignore a level in the same folder or subfolder

#

duplicating the sublevel data does work

wanton pollen
#

what networking type lyra sample game uses anyone knows?

lost inlet
#

?

wanton pollen
#

I want to make warframe like lobby/base but don't know where to start

shell forum
lost inlet
shell forum
lost inlet
#

Yes

#

And a shared party system

shell forum
#

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?

lost inlet
#

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

sacred spire
faint eagle
#

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

nova wasp
#

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

faint eagle
nova wasp
#

for starters

#

let me get the other one

faint eagle
#

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?

nova wasp
#

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

short walrus
#

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

bitter oriole
#

Don't replicate the component, mind you - meshes have nothing to replicate. The resource

short walrus
#

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

bitter oriole
short walrus
#

Thank you!

twilit radish
# lost inlet I didn't get the rest of the context but the quoted messaged is BS, I worked on ...

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 ^

rotund sail
#

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

chrome bay
#

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

rotund sail
#

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)

chrome bay
#

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.

rotund sail
#

Well, yeah, that's where the ReplicateSubobjects comes in, to replicate the actual object itself

chrome bay
#

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.

rotund sail
#

Wait, so ReplicateSubobjects is called only once?

chrome bay
#

No it's called everytime the outer actor is checked for property comparisons

rotund sail
#

Yeah, and that's the problem - it has to iterate through all of the items, every single time

chrome bay
#

Yes but it will do that anyway, marking the array as dirty makes no difference

rotund sail
#

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?

chrome bay
#

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.

rotund sail
#

Yeah, which is the case here

chrome bay
#

You do not for example need to implement ReplicateSubObjects() for a UPROPERTY(Replicated) TArray<AActor*>

rotund sail
#

class ULyraInventoryItemInstance : public UObject

chrome bay
#

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

rotund sail
#

Yeah, I get that

chrome bay
#

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)

rotund sail
#

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

chrome bay
#

That's right yeah

rotund sail
#

My question is, if it weren't UObjects but structs, would there be a need for ReplicateSubObjects in that case?

chrome bay
#

If the replicated property is in an Actor/Component - then no

rotund sail
#

It is, so it would be much more efficient, right?

chrome bay
#

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

rotund sail
#

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?

chrome bay
#

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.

rotund sail
#

So iterating over all of the UObjects in every tick despite them having not changed would actually be preferrable?

chrome bay
#

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.

rotund sail
#

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"

chrome bay
#

Yeah - but even the Fast Arrays NetDeltaSerialize is called every NetFrequency tick, to check which elements are dirty

rotund sail
#

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"?

chrome bay
#

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.

rotund sail
#

Sure, but that just checks the array itself, not each and every item inside it, then?

chrome bay
#

FFastArraySerializer maintains a 'Dirty' list internally

rotund sail
#

So the takeaway is: if the data can be represented in a struct, use a struct, not UObject

chrome bay
#

Generally speaking yeah, UObject is only if you need inheritance or something

rotund sail
#

GDI, Lyra

chrome bay
#

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

rotund sail
#

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

chrome bay
#

Yeah only works for float Var[2] etc.

#

Static Arrays are "unfolded" when they are members

rotund sail
#

Oh, so not static float Var[2] ?

chrome bay
#

no, can't replicate static vars

#

UPROPERTY() doesn't support them anyway

#

by static array I mean a fixed-size C-style array

rotund sail
#

Hmmm, so I actually might be able to use that for inventory - as long as the inventory has a set size

chrome bay
#

You can, but it's a hardcoded size

rotund sail
#

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

chrome bay
#

all arrays only replicate the changed items

rotund sail
#

Yes, wrong wording on my part 😄

chrome bay
#

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

rotund sail
#

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

twilit radish
#

But why is it better for large data sets btw?

chrome bay
#

You literally can't stop the server iterating over all elements without rewriting the networking layer of the engine

rotund sail
#

... I thought you've said that fastarrays keep a list of items that changed?

chrome bay
#

Yes but that list will still be checked every network tick

rotund sail
#

Or rather, which were marked dirty?

#

The list or all of the list's elements?

chrome bay
#

The list of dirty elements

rotund sail
#

Yeah, that's fine

#

I just don't want to have the server iterate over all 100 inventory slots every tick

chrome bay
#

Items are identified with unique ID's, whereas in a TArray they are identified by index

twilit radish
#

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

chrome bay
#

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

twilit radish
#

But then why would you not use fast array? Callbacks. Seems to be more performant too?

chrome bay
#

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)

twilit radish
#

But how much overhead are we talking about?

chrome bay
#

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

twilit radish
#

The whole item or array?

chrome bay
#

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)

twilit radish
#

Sounds pretty complicated to find out what truly is more efficient.

chrome bay
#

There's no one answer that fits all

rotund sail
#

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

chrome bay
#

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

rotund sail
#

Yup, that's my case

chrome bay
#

Well, they can, but you lose the custom delta serialization if you do so

twilit radish
#

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?

chrome bay
#

Because you have no idea if the client currently has the same value at index 4

rotund sail
#

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

chrome bay
#

Well a FastArray will only replicate the internal array property, nothing else within it will replicate

twilit radish
#

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?

rotund sail
#

The internal array is a TArray of structs, so I presume it will replicate that?

chrome bay
#

Yeah but since the engine can't guarantee that, it's not possible to do a generic implementation

chrome bay
#

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

rotund sail
#

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?

chrome bay
#

yeah that's fine

rotund sail
#

At least that's what I'm rewriting it to now 😄

twilit radish
#

Although I guess the way I would be thinking of requires an acknowledge of the client which can make replication quite slow 🤔

chrome bay
#

Also clients could modify the array locally etc.

twilit radish
#

Well sure. But assuming you don't do that it would safe quite a bit of bandwidth no?

rotund sail
#

And fastarray can detect local modifications?

chrome bay
#

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

chrome bay
#

And not really in sync with the "lossy"-ness of replication in general

twilit radish
#

Yeah.. I suppose.

#

Would be a major headache to keep it all in sync yes x)

rotund sail
#

And, say, if you've removed 4th element, then 3rd - but the clients receives the 3rd removal first...

twilit radish
#

Well that's the thing you would do it in order.

rotund sail
#

The 4th element would have jumped to 3rd place, and the "remove 4th" would instead remove 5th

twilit radish
#

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.

chrome bay
#

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

twilit radish
#

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.

chrome bay
#

Just comparing properties is intensive enough already

twilit radish
#

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.

chrome bay
#

You'd still have to compare the elements for changes anyway, and what about arrays embedded in other properties etc.

twilit radish
#

You are aware of the changes because you would just override Add, Append, Remove etc.

#

Otherwise this entire idea would not work anyway.

chrome bay
#

But what about Element[0].Something = true; ?

twilit radish
#

That might be an issue yes.

chrome bay
#

Keeping the API/usability simpler is just as important

twilit radish
#

In that regard this sucks yes.

worn wagon
#

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

twilit radish
#

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.

worn wagon
# twilit radish GameState has `float GetServerWorldTimeSeconds()` but I severely doubt the way t...

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.

twilit radish
#

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.

worn wagon
#

Yeah fair enough, thanks for the replies 😄

twilit radish
#

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.

rotund sail
#

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?

twilit radish
#

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 😅

worn wagon
rotund sail
#

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? 😄

twilit radish
#

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.

worn wagon
#

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

twilit radish
#

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 😄

worn wagon
#

Thanks for the link

rotund sail
#

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?

rotund sail
#

And you are concerned about feel good of weapon draws? 😄

worn wagon
#

It's not an issue for firing?

#

I can explain how it works if you want

twilit radish
#

Tracing on the server lags behind, that's what they mean.

worn wagon
#

Yeah I was looking into rollback netcode too

pallid mesa
#

it includes a little taxonomy of different replication strategies

#

and their CPU implications

worn wagon
rotund sail
#

Oh you are

pallid mesa
#

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

rotund sail
#

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

twilit radish
#

I mean rollbacking your shots is also not a holy grail btw.

worn wagon
#

😩

twilit radish
#

I was so confused at first lol.

rotund sail
#

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

worn wagon
twilit radish
#

Well yes that too, but it still allows cheating in two ways Bachelor.

pallid mesa
worn wagon
#

Idk man this shit is complicated

rotund sail
#

It is, which is why I'm surprised you are focusing on draw time 😄

pallid mesa
twilit radish
#

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 😄

worn wagon
twilit radish
#

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.

chrome bay
#

"Favour the shooter" is the only sane way tbh

pallid mesa
#

Yes

chrome bay
#

Server-side is detection is garbage

twilit radish
#

Server-side detection is still not cheat proof anyway like I said.

chrome bay
#

yeah

twilit radish
#

Regardless of having full rollback perfection or not.

chrome bay
#

You need to validate both where the shooter fired from, as well as what they hit

worn wagon
#

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

twilit radish
#

There's also something called 'lag compensation abuse': https://youtu.be/JXzkcKP_qFU

  1. fake latency caps at 800ms because any ticks older than 1 second according to the server are discarded
  2. 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 ...

▶ Play video
chrome bay
#

Nout you can do about aimbots really, that's where heuristic anti-cheat comes in

pallid mesa
#

and also there are mitigation techniques to avoid no-spread cheats

#

and rate of fire

#

and on the likes

worn wagon
#

I really don't want to calculate the random spread on the client, but that makes doing the detection on the client very hard

chrome bay
#

Use a seed, send the seed to the server - make sure they are using the correct seed

pallid mesa
#

yep

#

and timestamp your shoots

#

it will make cheating harder

worn wagon
#

Oh okay, so the spread is linked to the time

twilit radish
#

Also Vori I may hope this is milliseconds right? Wait nevermind it is yes.

pallid mesa
#

its like added layers to your onion

worn wagon
#

Still, find the seed with 0 spread, force the time

#

harder though sure

twilit radish
#

Yeah I just noticed the side panel xD

chrome bay
#

You can only validate so much, as soon as it becomes a detriment to regular players you just have to accept it

worn wagon
#

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

twilit radish
#

Shooters are just a horrible genre network code wise lol.

worn wagon
#

anyone with a ping greater than 1000 is fucked anyway

worn wagon
pallid mesa
#

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

worn wagon
#

I guess i'm setting my standards a bit high for some shitty little game not many people will likely play

pallid mesa
#

and those with 120 or more server tracing

worn wagon
#

I would like to learn proper networking regardless

worn wagon
#

Yeah I get your point

twilit radish
#

Learning is something else than publishing a project though.

pallid mesa
#

Ghetto, you'll find out that even in the industey these models arent totally bulletproof

chrome bay
#

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

pallid mesa
#

Oh James maybe you could tell him the teleport cheat you had goin on in HLL

#

that was interesting XD

chrome bay
#

tbf you can do that in virtually any UE game

twilit radish
#

The what happened?

chrome bay
#

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

twilit radish
#

Oh I thought teleporting as in the CMC lol.

warped steppe
#

lol, awesome

twilit radish
#

Was worried for a second haha

#

But that's a bit odd yes.

chrome bay
twilit radish
#

Great stuff lol.

latent heart
#

What's actually happening there?

chrome bay
#

BTW - you can totally do most of this in Lyra 🙃

latent heart
#

Is he teleporting enemies in front of him?

chrome bay
#

weapon speed hax, ez

twilit radish
#

Just teleport clients locally yeah. That's what it seems like.

chrome bay
latent heart
#

That's some terrible code right there.

twilit radish
#

Also speed hacks yeah?

chrome bay
#

You can speed-hack CMC still but I'm not sure on the mechanism

twilit radish
#

I only just realised how speedy they are xD

worn wagon
twilit radish
#

Wait you can speed hack CMC? Wtf?

chrome bay
#

tbf we did once ship the client in development mode which also included all of our console cheats. doh.

twilit radish
#

🤣

pallid mesa
twilit radish
#

I mean as long as you patched it afterwards..

graceful flame
#

TotallyLegitCheatsNotA0DayCryptoMiner.exe

chrome bay
#

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

pallid mesa
#

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

twilit radish
#

And that's clearly why we discuss it an open public Discord with tens of thousands of people 😄

chrome bay
#

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 😄

pallid mesa
chrome bay
#

be lying if I said I hadn't thought about it though 😄

#

But also... that's my livelihood now 😄

pallid mesa
#

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

quasi tide
#

Forgo PvP - embrace Coop only. Ignore anti-cheat

pallid mesa
#

"this is how you make a fully predicted vehicle network resilient"

#

XD that's too much for starters

twilit radish
#

Even in co-op people try to ruin others their games. Kind of sad honestly.

quasi tide
#

That's why it's friend invite only 😈

twilit radish
#

😂

pallid mesa
#

lmao the best anti cheat system is a report button

twilit radish
#

"vote to kick"

pallid mesa
#

(drama - it wont work)

quasi tide
#

Nah - people do bogus reports because they're salty they lost.

pallid mesa
#

thats the drama bit

#

XD

latent heart
quasi tide
#

I had already committed to my statement before you mentioned drama.

latent heart
#

At least in pvp you can fight back.

pallid mesa
#

on GiT we gave Listen server owners buttons to kick/teleport/broadcast messages

#

it was hilarious

#

it lasted online 1 hour

twilit radish
#

Oh oh xD

frozen goblet
#

Horror Game fun stream in an hour 😈

worn wagon
#

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

lost inlet
#

for rewinding, you actually need the latent time

vocal cargo
#

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?

worn wagon
#

Unless I'm misunderstanding

lost inlet
#

without accounting for RTT

worn wagon
#

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

lost inlet
#

even for those you can dumbly predict them on the client

worn wagon
#

But for shooting yeah you'd need rollback netcode or something more complicated

lost inlet
#

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

worn wagon
#

Hmm

#

so how would you do it? @lost inlet

lost inlet
#

do what exactly

#

for timers, it was just as I said, dumbly predicting

#

and it worked well enough

blazing socket
#

How can I tell a client if players connect or disconnect to the server? (trying to make a UI player list with scores)

lost inlet
#

there are Login/Logout events on the server, but I imagine this is just iterating through player states?

blazing socket
#

Are those on the GameMode or on player state?

fathom aspen
cosmic epoch
#

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?

fathom aspen
#

Login gets called if the travel was hard. HandleSeamlessTravelPlayer for seamless. If you want one that is travel agnostic use HandleStartingNewPlayer @blazing socket

fathom aspen
pallid mesa
pallid mesa
#

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

dark edge
#

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

cosmic epoch
#

I guess I either have to make a real conveyor with moving segments or go for some trick with add force

dark edge
#

the velocity of the thing you're standing on

#

CMC can already do that

#

so just trick it into thinking it's moving

cosmic epoch
#

ah my bad, yeah that would be easier than having actual moving meshes

dark edge
#

It looks like it's virtual, have fun

cosmic epoch
#

thx, I will xd

somber bluff
#

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?

dark edge
#

@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.

dark edge
#

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

cosmic epoch
#

yeah sounds like the most straight forward way, I just hope the CMC plays along and doesn´t start jittering or whatever

dark edge
#

If the speeds are constant it should but you never know with CMC, it's a behemoth

cosmic epoch
#

yeah

#

i mean adding actor world offset works too, but it´s a mess when ure starting to run or exit/enter the conveyor....

dark edge
#

Although subclassing BodyInstance..... ugh idk bout that lol

cosmic epoch
#

I will try to just override the entire get movement base velocity function for my CMC

#

and have a bool

#

like bUseConveyorVelocity

dark edge
#

But what if you put a conveyor on a conveyer

#

lmao

cosmic epoch
#

LOL

dark edge
#

nah that'd be too wild

cosmic epoch
#

my conveyors will have changing flow though, but not constantly, I guess a synced timeline will do fine more or less for that

thin stratus
#

The CMC only jitters if you:

  1. Perform a Move that needs to be saved client side but isn't (e.g. a bDash flag missing)
  2. Perform a Move on Server and Client with 2 different states (e.g. speed)
#

And 3. whenever it pleases

cosmic epoch
thin stratus
#

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

cosmic epoch
#

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

cosmic epoch
dark edge
#

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.

dark edge
#

As a fallback you could just lay a force volume sideways for your conveyer but lemme know how overriding base velocity works for you.

cosmic epoch
#

yeah surely will do

thin stratus
#

Things that are based on player location are basically automatically synced

#

cause you step onto it in the same timestamp

cosmic epoch
thin stratus
#

So you apply the force at the same time

cosmic epoch
#

yeah, that´s atleast what I always pray for 😄

thin stratus
#

E.g. a JumpPad is actually very in sync

cosmic epoch
#

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

thin stratus
#

UE tutorials are shite in a lot of cases

#

At least the first few months/years produced a lot of weird things

cosmic epoch
thin stratus
#

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

coarse vault
#

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

thin stratus
#

Doesn't stop jumping kinda already do this?

coarse vault
#

I think it just stops adding velocity

thin stratus
#

Hm okay

#

Well you can do it like that I guess

coarse vault
#

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

thin stratus
#

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

coarse vault
#

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

thin stratus
#

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

cosmic epoch
#

it really does fetch the MovementBase component for everything else

coarse vault
cosmic epoch
polar lotus
#

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

cosmic epoch
polar lotus
#

the pawn is actually valid when the event is called

#

cool, thanks @cosmic epoch

cosmic epoch
#

No problem

fathom aspen
#

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

dark edge
#

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.

fathom aspen
#

Yeah too many things going on in there ^^

polar lotus
#

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

fathom aspen
#

That's why you should equip only when the weapon replicated

polar lotus
#

Yeah how do I do that?

fathom aspen
#

OnRep

#

UPROPERTY(ReplciatedUsing=OnRep_MyWeaponActor)

#

^ Above your weapon actor

#

And you call that equip function inside the OnRep function

polar lotus
#

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?

fathom aspen
#

In BP it's called RepNotify

polar lotus
#

oh yeah, right

fathom aspen
#

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

polar lotus
#

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

dark edge
#

I think maybe waits for players to start?

shell forum
#

Does it wait for all players to join in?

dark edge
#

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

fathom aspen
#

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

dark edge
#

Depends on if it aligns with your game design

#

if you're making a match based shooter than sure.

polar lotus
#

I use it

#

It works well with my game

fathom aspen
#

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

polar lotus
#

Yeah

#

I use GameMode

#

There used to be just GameMode and no GameModeBase but it got split into those two a while back

fathom aspen
#

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

polar lotus
#

Oh I had a similar issue

#

what kind of jitter?

fathom aspen
#

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

pseudo schooner
#

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

pseudo schooner
vague spruce
#

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

dark edge
#

open IPADDRESS?

#

should work on client

vague spruce
#

open 192.168.1.122

#

not working

dark edge
#

try it from a launched game. just right click uproject and hit launch

vague spruce
#

good call

#

one moment

dark edge
#

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

vague spruce
#

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!

dark edge
#

lmao

#

linux or windows server?

vague spruce
#

bro how is this running on my

#

LAPTOP

#

LOL

#

linux

#

im losing my mind unreal engine is the best engine ever made man

dark edge
#

You can probably run 10 instances on your laptop, maybe more

vague spruce
dark edge
#

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

vague spruce
#

im gonna set up persistence right now in the game

#

it's an m1 macbook

#

im gonna set up persistence using sqlite

dark edge
#

It should slay but maybe there's some considerations due to M1.

vague spruce
#

more than likely

#

this is rosetta

#

it's not compiled for arm

#

.......maybe i can compile for arm

#

LOL

dark edge
#

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

vague spruce
#

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

dark edge
#

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

vague spruce
#

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

dark edge
#

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

vague spruce
#

😢 looks like no cross compilation for arm64 yet

#

i dont see how to get the sdk

dark edge
#

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

vague spruce
#

you have some kind of CI/CD pipeline?

#

dude there's a slim container image

dark edge
#

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

civic turtle
#

do you have to build from source to be able to have the dedi server?

vague spruce
#

at least thats what i experienced

#

it wasnt letting me package the server

#

you can probably get away with running it from the editor

civic turtle
#

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.

vague spruce
civic turtle
#

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.

#

😛

vague spruce
#

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

dark edge
vague spruce
#

i built the wrong configuration so now i'm building again lol

dark edge
#

That's nice for testing

vague spruce
#

yeah just use the editor

#

you can put launch args in your IDE

#

use -server

#

it'll launch a dedicated server

civic turtle
#

trying to work with ows2

vague spruce
#

you can also set up like a batch or python script that'll launch the UnrealEditor.exe with the arguments you want

vague spruce
#

wtf is ows2

civic turtle
#

Open world system

vague spruce
#

from sabre?

civic turtle
#

yeah

vague spruce
#

i didnt know that was still a thing

#

they got funded by epic games

civic turtle
#

yup still a thing

vague spruce
#

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

civic turtle
#

i am not going for massive just for more say 100 clients in a persistant world

vague spruce
#

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

civic turtle
#

spread out

dark edge
bitter oriole
#

Not to mention you need like 10,000 players to have 10 of them online in the same region

twilit flint
#

Is GameLift Managed Servers SDK working correctly with UE5 ?

grave lynx
#

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?

potent coral
#

any idea why my multicast play sound wont trigger on clients?

grave lynx
#

is that an actor?

potent coral
bitter oriole
#

How are you calling the server event and which actor class is it

grave lynx
#

the class

potent coral
#

its called in this event

#

which is in another actor

grave lynx
#

is this actor replicates?

crisp relic
#

Then your actor need replicate

potent coral
#

but it is

bitter oriole
#

which actor class is it

potent coral
#

just actor

bitter oriole
#

Make sure the server events are called.

potent coral
#

it is

bitter oriole
#

Make sure the multicast is called

potent coral
#

it does the score logic

#

but it doesnt do the multicast

#

the multicast is called but only on the server

bitter oriole
#

Guessing the code you haven't shown between the add score event and the multicast call itself simply doesn't reach the multicast

potent coral
bitter oriole
#

Does the string print

potent coral
#

yes

#

its really just the multicast not being called on the clients

#

but on listen server it does

bitter oriole
#

Is the string printed on the server

#

As opposed to, say, a client

potent coral
bitter oriole
#

Should work if that actor is properly replicated

#

And server owned, IIRC

potent coral
#

ohh damn im stupid, i forgot to make the main actor replicate

acoustic drum
#

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

twilit radish
#

How are you trying to replicate it though?

silver loom
#

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?

wary wyvern
#

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?

twilit radish
#

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.

wary wyvern
dark edge
#

You're trying to DoSomething when a team scores right?

potent coral
#

yes

dark edge
#

Are you familiar with how big of a project implementing P2P would be in Unreal?

dark edge
potent coral
#

actor

dark edge
#

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

potent coral
#

but this runs in overlap event of the goal

#

everything works fine now btw

acoustic drum
#

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

dark edge
#

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

potent coral
#

but then i cant score points lol

dark edge
#

Event Overlap -> Are we on the server? -> Get GameControllerActor -> Tell it someone scored

potent coral
#

but i still have to check if the actor has the flag and is in same team as the goal

dark edge
#

the actor has the flag on the server and the goal has a team on the server

#

its all on the server

potent coral
#

but isnt this also on the server?

dark edge
potent coral
#

ok i see

dark edge
#

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

potent coral
#

but basically it doesnt make a difference if i replicate it to server?

dark edge
#

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

potent coral
#

yeah but i mean it still works even if i accidently make it replicate to server

dark edge
#

yes but that's just a fortunate coincendence.

#

Bad practice

potent coral
#

so i guess i should do same on this lol

dark edge
#

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

zinc acorn
#

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?

cosmic epoch
#

Any idea if that's just the CMC being buggy or a problem on my end?

cosmic epoch
#

Disable as in movement mode none

zinc acorn
#

ah

#

ill check that out then when i work on my thingy again

rocky stag
#

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

zinc acorn
#

update: what i did instead was i called the movement non replicated and then called it on the server

vague spruce
rocky stag
#

Oh really?

#

How ?

rocky stag
#

😂

graceful flame
#

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.

fallow shadow
#

at this point i genuinely cant tell if yall are trolling this man or if you are fr

graceful flame
#

@rocky stag Who's your hosting provider? Do you have access to firewall?

rocky stag
#

thats the funny thing

graceful flame
#

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.

coral wing
#

What's the best way to replicate adding static mesh components to an actor?

graceful flame
#

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.

coral wing
#

Does rep notify trigger when someone enters a session?

graceful flame
#

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.

nova wasp
#

Check the pins for a nice example

graceful flame
#

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.

coral wing
#

Ok. Using a repnotify might be my best bet then. Thanks for the help.

mellow stag
#

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

mellow stag
#

How would I have the client animation play ONLY for the client

#

Right now it is playing client and server

lapis zinc
#

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

summer tide
#

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.

dark edge
#

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?

summer tide
#

Yes I'm using CMC. I can't use control rotation since I want the movement to be based on the character facing.

summer tide
dark edge
summer tide
dark edge
#

Are you using the flying movement mode in the CMC?

dark edge
#

So what's different about flying? Other than the no gravity. What changes?

summer tide
#

I was using multicast to set the rot rate

dark edge
#

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

dark edge
#

That's gross

#

And will never be in sync

summer tide
dark edge
#

That will drift over time

#

Ok, plain English. The capsule points towards ..... What?

summer tide
dark edge
#

Dude. I'm asking you. Right now, what is your rule or function for determining the rotation of the capsule?