#multiplayer
1 messages · Page 623 of 1
There's always a ban button for those people
Rust is overrun by cheating, people still play
Most cheats occur because cheating is a fact if life in multiplayer games
Yeah 😦
Yes
If the cheat can be solved by game code, that's anticheat 101
"don't be dumb"
Most of the time it can't
The client always lies
For shooter/action type games, I mean - of course your turn-based tactical game can have strong anticheat
I didn't mean only game code.. end to end knowledge of framework is also needed...
Like not doing server side simulation of projectiles
This is still very very obvious stuff
I just gave an example
I think Stranger's point is that there's just a whole class of client-side stuff that you can't prevent with your game code
My point is that most commercial cheating is purely client side and impossible to prevent
Aimbots, triggers, wallhacks, etc
Your point is right @bitter oriole
So why studios still use anticheat framewrok
When they know they can't prevent cheating
There's two sides to it
@potent cradle While the cheating aspect may remain, you still need to have main servers where players can play at least mostly securely. At least you know that you can get away with the same thing as the other guy. Meanwhile in Listenserver setups, you're at the host's mercy. And having community servers doesn't stop that cost necessity. You still need your own servers up and going to attract players before they make communities. All that does is ease your problem after the fact.
There's the game/server-code side where you try to prevent obvious spoofs and hacks
Then there's the client-side where you run some kind of anti-cheat agent that attempts to detect other software that allows them to cheat.
To make it more costly for cheat makers and mitigate how long people can cheat before they're banned and start over
Yeah, but the cost of hosting a few dedicated servers isn't that high. As demonstrated by the wealth of community owned servers in most games (in my neck of the woods).
That's galaxy-brain sort of stuff, way outside my understanding - but client-side cheats are the job of programs like EAC and the like.
Anyway, I keep advising people to plan their game for a population of 10 online players
@rich ridge THIS ISN'T WINDWARD
@kindred widget
https://scalacube.com/hosting/server/ark
Make an ARK Server for Free. No credit card required. Instant setup. Support 24/7. We offer the best cheap ARK Server Hosting services.
44$/month for 100 slots
As an example
And I bet you can host for cheaper with "real" hosting companies, vs a "game specific" one like this
That's insanely expensive even for dedicated servers, lmao
Oh for sure
But I mean, they market to gamers with no server knowledge
Premium cost
^ Hence
I haven't tested at scale yet, but Vultr seemed to handle Unreal fine when I gave it a go
Does anyone know whether UE4 UDP is going to change or replaced in UE5?
Highly unlikely tbh
UE5 is going to be UE 4.27 essentially
Probably with a handful of unannounced stuff we haven't seen yet
Epic are being quite smart by trialing a lot of the big stuff before they go ham with a full UE5 release
What would need replacement anyway
Because UDP is not optimised for mobile networks. And there are a lot of new and advanced protocols.
I hoping to see quic protocol
I'm skeptical Epic cares a lot about mobile tech right now
"If it ain't broke" and all that
To be honest
Yeah that too
You think there's more in the works? I was already impressed with what was announced.
I mean, I bet they're always working on new stuff, but the lineup seemed pretty good already.
I mean Epic's only game product is banned from both platforms ?
Quic protocol automatically detects network switch from wifi to cellular and vice versa, and the connection is not terminated.
I mean yeah but consider this : Unreal isn't investing a lot on mobile tech
@potent cradle Purely speculating but I bet they still have a few tricks up their sleeve, maybe nothing on the scale of Nanite etc... but there is so much stuff in the works already it wouldn't surprise me if there is some lower-hanging fruit kind of gems in there
The Quartz audio stuff seems to have been snuck in to 4.26 without anyone really noticing..
I mean quic is not exclusive to mobile. It can be used on consoles, PC or Mac or Linux.. it's just like it has more features for mobile
anyway.. OT
There's no point on PC or console
Considering I'm going: what? That's accurate.
Googling....
@potent cradle You need at least 2 sales per month to host that at near cost. But assuming that you get those 100 people and you have a 30$ game. That's $3,000. Minus steam, minus publisher, actually lets just leave the publisher out for a moment. So after steam you're at 2270. After taxes, and paying for that server. You could keep it up for 3 years, if you don't pay yourself or your employees anything.
Bleh just support listen servers and add AI 😄 At least the few who do invest in your game will still be able to play it when it's abandoned...
Seems fine, no?
Assuming that you get those 100 people and you have a 30$ game. That's $3,000
You have $1,500
Sorry to break it to you
That's before publishing
That's before everything really, just VAT and Steam
That was my last figure after tax and Steam.
1560ish or something.
Divide by 44, and you're at 36 months of hosting.
No tax until profit 🥳
You gotta claim that back though, still have to pay it upfront
Then you gotta pay an accountant to do it all for you 😄
You can use it to buy one of your work slaves a christmas present.
(Assuming we're talking UK rules anyway)
I'm not sure it works that way here 🤔
But I get your point, the argument was creative accounting anyway. You'd have paid for the costs to justify the tax break already, so it's not like you didn't pay to begin with 😄
You can probably write off the server cost in the States. I don't remember anymore. Been in EU too long.
At every step of the way somebody other than you is getting paid essentially
So you got 100 sales of your $30 (very expensive) game and made $1500. Assuming $20 per month, that's still a full third of your entire revenue stream
Anywhere I think, can't see that any other way. It's a business cost.
Assuming a more realistic $15, the calculation becomes intenable
Hell, assuming all your sales come from Steam sales, as they will, make it intenable
It's no coincidence we always arrive at monetary calculations in #multiplayer 😄
If you do the math for 100 copies of a $20 game sold on average at $15, that's $750, and hosting is now 2/3 of your entire revenue
I mean, if we only sell 100 copies, then yeah, it becomes problematic
But as soon as it scales and you get a few hundred
Most survival games only have a few official dedicated servers
But the necessities don't stop scaling either.
Beyond that, community server start popping up
What's a good way to send player skin information to players who are joining
Repnotify in playerstate
Ty 🙏
I would be very very annoyed if I bought a game and could only play on community servers
I know the survival games community is used to absolutely horrible games
But still
Nah, not only being able to play on community servers
There's often still official servers, even with free slots
But at some point the thing grows large enough that people host their own servers
It's a huge thing for survival games
At which point the load is spread
And the economics make more sense
(Depending on the game, I even avoid official)
The only way that most survival games really make it, is if they support listenserver and singleplayer play as well. Because then people also want to play with friends, and you can get off free if they play listenserver or host their own dedicated servers. And that can cover your costs for your own servers.
That just hasn't been the case in my experience
Rust, Beasts of Bermuda, TheIsle, Path of Titans
Dedicated servers, no listen server support that I know of
"Huge" games, and most of those are small indie teams
I think maybe here we need to acknowledge the context of the (sub)genre
I bet there's games that you have experience with that lead you to say that, and prove me wrong
Context specific.
For some formulas, it just really works great
@chrome bay, how about HLL?
Seems to be the same scenario
Gears 3 - personally I've been playing loads of that lately, and it's all listen servers now
HLL is dedicated only but wasn't my decision
But also... 100 players
😄
no residential internet is going to be able to support that anyway
Seems to work fine though
(Though I'm sure you did a lot to support that on a technical level, not discounting that)
Hey we got 100 players working before Fortnite came out so I'll take that 😄
If you have a more sensibly scoped game though, having a PvE mode that works on listen servers may not be a bad idea.
Probably a better idea than PvP tbh.. if you discount the extra enormous development cost of AI
Or just mixing them
I've decided not to go down the PvP only route, and to supplement it with PvE
They compliment each other quite well, and it frees you of the necessity to have high player counts
That's what I'd like to do tbh. Just can't ignore that huge AI development cost
I'd agree with that, yes
Still feels doable though, especially if you start with relatively simple AI and work your way up
Question is, at what point is it sophisticated enough to become adequately engaging
I can imagine it's even harder for a game like HLL
All the strategy and tactics going on. Tricky to make it not feel like a dumb meatpuppet running across the battlefield soaking up bullets 😛
If they want to add AI to HLL I'm gonna quit 😄
@potent cradle Hmm. I'd be very inclined to give you TheIsle. I can't find anything on them except just good stats. They have no other affiliations that helped them although they do tick my personal pet peeve of being in early access for half a decade.
Path Of Titans I can't find any real data on since it's not steam related and there's not a lot of data floating around, but it does look good. Path of titan's developers are also known for a popular ARMA3 mod though which helps their visibility. Still would be inclined to give that one to you.
Not really feeling Beasts Of Bermuda. Not sure about other platforms at least, but their PC is a small crowd. Admittedly they do have a decent amount of concurrent players. Their still active GoFundMe account definitely has helped their server upkeep cost at $16,000
Rust I'm definitely not willing to give. First off it owes a lot of it's success to the fact that it has a popular following from Garry's Mod. It had capital from that to start up. The development team size is 20 people. It's also not pure Online. It allows non Online Coop if their Steam is to be believed.
2/4, I'll take those odds! 😄
Rust I'm definitely not willing to give. First off it owes a lot of it's success to the fact that it has a popular following from Garry's Mod. It had capital from that to start up. The development team size is 20 people. It's also not pure Online. It allows non Online Coop if their Steam is to be believed.
Specifically for the argument of server cost though: it seems to prove my point.
There's tons of community servers
Could even argue that having a plethora of community servers is an asset to the game.
Which is generally true for survival games. Different rulesets, slight mods to gameplay, etc.
Not really feeling Beasts Of Bermuda. Not sure about other platforms at least, but their PC is a small crowd. Admittedly they do have a decent amount of concurrent players. Their still active GoFundMe account definitely has helped their server upkeep cost at $16,000
I don't play it myself, but it has a vibrant community, successful game.
Definitely. I wouldn't argue that at all about community servers. I play ARK a lot. But the tone of the conversation was about how you can be successful as a smaller team using dedicated servers. Rust already had a large following from it's developer's previous success, and likely had plenty of money to support it based on it's development team size.
But the argument is based around economics of dedicated servers, right? If you don't manage to grow past the need for 1-2 official dedicated servers, then yes, it's problematic. But as soon as that happens and the community starts joining in, the economics change.
I think the question then becomes: can you manage to reach that point?
Which is very hard to do without extra money as a very small team.
That I am inclined to give you, yes.
But considering there's quite a few survival games that have made it, it does seem within the realm of possibility.
I don't think I'd be making the same argument for twitch shooters though
If we were talking pure dedicated, with no other game modes like single or coop, and no other previous background to rely on or capital to support more than a could servers for half a year, I'd be iffy. Too much cost requirement of servers, business, personal living needed to develop said game, etc vs hoping your game becomes the next Valheim.
Do what ARK, or Rust did with singleplayers, or Coop, mods, you foster a community. They take a lot of your costs away. Ark also got away with being able to add in a few extra items and make a new map and make a stupid amount of money from DLCs.
Does Rust have any real amount of players playing Coop/SP? I didn't even know it was really a thing
This is a real risk, I agree
Dunno, there's not really any data on it. I presume some people do at least.
You won't see streamers or Youtubers doing it. Boring for viewers, and there's no data on how many people are playing it single vs online.
True 😄
Quick sanity check. HISMC doesn't automatically replicate the used StaticMesh in it, does it?
I have some questions about actor replication if anybody knows the answer.
-
Is the first replication of a created actor ordered? ie, will an reliable rpc sent regarding the same actor always arrive after all the fields have gotten their initial values?
-
When joining a session, is there some way for a client to know that all created actors have been replicated to it and that the state is robust?
I don't believe so. That feels more like custom work area of making certain actors register with GameState or something, and firing an event off when all of them exist on the client.
for #2?
Ah. missed one. Derp. Yeah that was for 2. For one, it's not promised. In fact I've noticed that RPCs sent directly after an actor's creation often arrive before the actor finishes replicating and spawning on the client. For anything like that, you're usually best off relying on a RepNotify.
Or maybe they don't arrive and get dropped, more likely. Uncertain. Either way they don't run on the client.
It's likely just the way it's designed. Server sends RPC through the actor. RPC arrives on client, Client looks for said actor, actor does not exist yet, RPC gets tossed. Fair question on the reliable part though... Curious.
I'm still trying to get to terms with that RPCs can only get sent to actors, but it seems, everything is an actor in unreal, even things that don't have a physical representation in the world, so maybe that's fine.
Been using stingray before and it gives a ton more guarantees, so it feels quite scary since networking easily can get messy and race condition-y.
like, we wouldn't even run the gameplay code until the event is fired that all state is in sync, feels like the wild west to start running any gameplay updated until we at least have a robust state.
...and all ordered RPCs would be ordered even among each other, not depending on actors it got sent to. Also ordered with creation and destruction of objects, so you knew if you've created an object on the server you were free to send RPCs about it and know they will arrive.
so... trying to get to terms with with these basically no guarantees for anything.
Just gotta code around it. It's pretty easy tbh once you get the hang of it
The only ordering that's guaranteed of any kind, is reliable RPC's on the same actor. Everything else is non-deterministic.
Most important thing is using variables for stateful changes, and RPC's for events only.
If you start using RPC's to control persistent state, then you will end up with a mess
The other important concept is relevancy
Oh FFS. Meshes are replicated by default. That's what was confusing me. I thought I actually replicated the mesh myself but I was going back over my own code and couldn't find it. ReplicatedUsing=OnRep_StaticMesh. Epic ahead of me again. I need to get out of my own way.
Aaaand.. it's not virtual.
Why is it not virtual?
So... There's absolutely no way to like.. override a non virtual function is there?
I know there's not. But I don't know why this OnREP isn't virtual. :/
What you could do to get around it
Subclass UStaticMeshComponent, and use DISABLE_REPLICATED_PROPERTY or whatever it's called
Then add your own property and replicate that instead
Might need to use DISABLE_REPLICATED_PRIVATE_PROPERTY I suspect, but it should work
Do you know what these things are?
PRAGMA_DISABLE_DEPRECATION_WARNINGS
Why bother disabling deprecation warnings inside of the function, why not just move the deprecation to the other side of it.
Ah maybe it's old code, I think the StaticMesh property wasn't fully private at one point
Yeah must be, this is further down:
StaticMesh = NewMesh;
PRAGMA_ENABLE_DEPRECATION_WARNINGS```
I think it was public in the past
After having been looking through a lot of Epic's code lately.. I'm reading through this file like it's written for something else entirely. Syntactical differences, style, everything feels off. :/
tbh the deeper you go you find that Epic has a coding standard they don't seem to enforce particularly strongly
But I guess that's expected from a 25+ year old codebase tbh
Like putting virtual on all OnRep functions. :/
On a side note. I went looking for DISABLE_REPLICATED_PROPERTY.
Someone mentioned that it cannot be used on private variables?
Ah. Cause this apparently exists. DISABLE_REPLICATED_PRIVATE_PROPERTY
Still going to go look up and see if that's currently documented. I feel like that needs bug reported.
Yeah DISABLE_REPLICATED_PRIVATE_PROPERTY is for private properties and looks them up via property name instead
Thanks to reflection
I don't know why they don't just replace DISABLE_REPLICATED_PROPERTY with the code of DISABLE_REPLICATED_PRIVATE_PROPERTY and have it work everywhere tbh, but maybe it conveys intent more
No mention of it in bug reports. Gonna write that up. Will work around it, but it's annooooying.
Also speaking of bugs. The icon in the bug search page is missing. Not sure if that's a bad joke or not.
alright, thanks for the tips!
If latency using Steam Sockets is more than 10x higher than without it enabled, is using the orignal non sockets Steam network (the one that is there by default) still recommended?
125+ ping for PCs in the same room is just way too high but I'm not sure if the encryption and relay that sockets provides is considered an essential feature nowadays with streamers
I'm curious, does the default Steam networking setup (without the steam sockets plugin enabled) not function properly for a MP game or would this be for a specific type of game?
Can someone help me? I can read PlayerState values clientside
In my WB i´m trying to fill a scrollbox whit all connected players, but when i pass the PlayerStates from GameMode to the WB it keeps reading null
@golden nest Why are you even passing these through? A client doesn't need to care about what is on the server. They need to care about what is on the client. You should only be getting the playerstates from the local client's GameState.
But i need all player states
so i get it from GameMOde
it´s that correct?
Cause i want to fill a chat combo box with all connected players so i can select one player to whisper
More realistically your UI just should update with what the client itself knows. Instead of making GameMode call this on each playerstate, just make a Beginplay call in your actual playerstate and run that to call your UI to update. On the UI update, get all playerstates from the GameMode and populate the UI. This way anytime a new playerstate pops up on the client, it will update it's UI locally with local values. No network necessity.
Well, beyond simply replicating playerstates, which is already done.
oh, and i have to switch on authority OnPlayerStateBeginPlay?
Depends on your setup. You could probably just run the call behind a IsDedicatedServer->Not->Branch.
Should run for anything that isn't a dedicated server.
Cause Dedicated doesn't care about UI.
Ok, i will give it a try
Thanks ♥
But what if i call an InitialSetup in my playerstate?
Like this, i read a save file to populate my PS
@golden nest How do you normally call it?
I'm uncertain. It looks like it can be called at any point once the playerstate is valid on the client. I assume it's a pointless function for DedicatedServers, so you can possibly just run it after the same IsDedicatedServer branch.
Do you have your UObjects set up to replicate?
Yep
Just making sure, cause they don't replicate by default. So if you didn't, the pointer would return null on clients.
Not dedicated. You need a Not between the IsDedicatedServer and the branch.
they're not 10x higher in the general case. They're only 10x higher for your two computers in the same room because all the traffic is going via Steam's network so them being close to each other doesn't matter, it's their distance to the rest of the internet (and the nearest Steam node) that matters. You'd likely have a lower ping to a dedicated server in the cloud than you would between your two computers on the same LAN since it's not using the LAN connection.
the main boon though is in emergent markets where the network topology can be very unpredictable, routing via steam's own private network gives a much more predictable routing and one optimized for latency rather than cost.
But client keep reading null values
@golden nest Here.
Ok
This will gate this logic off to only run if it's on a Client or Listenserver. Both of these have UI, so we want to run the UI update there. You probably also only want to upload the savegame data if this playerstate is the local player's Playerstate, so that's what the second branch is for. Which I suppose you can also use LocalRole for I think. Used to using the PlayerController check.
AFAIK these two checks return the same thing. The top might be easier.
In the settings or the UI update?
I think i should do the upload first
and after that, update the widgets
Am i right?
And we are doing the opposite, updating before loading
Just a sec. Reading through your logic flow. I think I'm missing a piece though. Where is EveryoneUpdates called from on the server?
It was in game mode, but I deleted it based on what you told me
What was calling it before?
And you need the UI to update after the creation of the User object?
Hmm. UObjects don't have a beginplay I don't believe. That complicates things.
No, UObjects don’t have it
So.. If this playerstate spawns on the local controlling client, beginplay runs. It gathers data and sends it to the server. Server creates another replicated object. Perhaps the UObject should have a Repnotify variable that is a struct of the information you want displayed. It itself could update the UI when it's changed, and it would be consistent with having the full data if it's sent in a struct.
I'm not certain what the User UObject is for besides this UI stuff, but it's possible that these settings you're feeding into it might also just be stored on the Playerstate itself and replicated there?
Mmmm it could be
I’m having trouble understanding the concept of replication sometimes
Let me finish my lunch and I be right back
I'm out of my depth a bit with the UObject part. I do everything through Actors or ActorComponents.
thats my name
is it possible to have multiple players possess a single vehicle? IE 5 players ride together in a truck
no, and I'm not sure why you'd do that. you'd have the driver possess
I wonder which user will control the truck then.
I am using a Widget Component for a health bar in my multiplayer top-down game. Everything about it is working great, except when the characters move, the widget doesn't seem to keep up, and it jitters quite a bit. The character movement itself is nice and smooth in multiplayer, but the widget is jittery. Any ideas? It's set to screen btw, not world.
Yeah I definitely get that the ping would be higher in general since it has to route through Steam but at 125 ping minimum it seems like a bit of a dealbreaker to use steam sockets even if other users could potentially get better ping in different countries. The ping here indicates that it's going to a server overseas and back rather than one in europe. The non steam sockets ping is around 10ms of course because it's directly connecting so it's expected to be very low. I'd be happy with even 50ms ping going through sockets but 125+ is just too high for a good player experience
That's the thing, I read everywhere that it's optimized for latency and finding optimal routes but the latency is 10x worse than not using the sockets feature
Maybe I'm just experiencing a rare case and for other users it's fine
But when testing with a friend from overseas we get roughly the same ping as I do with a computer in the same room
this is how playerstates already register with GameState under the hood and then love happily in PlayerArray @golden nest
you're comparing apples to oranges.
You're comparing a connection on the same network to a roundtrip to the closest steam node and back.
If you don't have a really bad connection 125 RTT to the closest steam node sounds very high though. It should be <10 if you have fiber and live in a place with decent internet infrastructure.
Yeah that's the thing I have a very good connection but the latency is very poor
though the point of using steam sockets is not for optimizing the case of ppl on the same ISP connecting to each other, you'll never beat the default routing for that since it literally is the shortest route to never even get on the internet.
It's optimizing a realistic route through the internet across countries or continents. You'll probably get slightly higher pings for the absolute ideal conditions, but you should be getting way better and more stable pings for the less than ideal conditions, ensuring everybody has a more consistent experience.
In that case it might be worth sticking with it then
If it gives a generally worse latency for people in the same country but overall better for global connections
I had just thought 125 was a bit crazy
As it feels like going from europe to US and back
however, if you want the boon of a private network but don't want the drawback you could try using NetworkNext, I don't think they'll fix NAT punching for you (I'm not up to date though) but they will improve the routing, optimizing for latency instead of only cost.
I have heard sockets is more stable, encrypted etc.
And that's very important for long play sessions
125ms does sound crazy to me too if you normally have <50ms in regular internet games
i left a company just after they released this for their game and I know they did get complaints from ppl playing on the same LAN reporting higher pings
Normally have 20ms for most games that use servers
I don't know how it ended up though.
alright, that sounds very fishy. I would try asking in the steam dev forums
I know valheim is having issues
Yeah I may do that thanks!
Might be some kind of routing issue for specific cases
Thanks for your help
no worries, glad to be of help
is it easy to make multiplayer , dedicated server friendly ladder for my FPS game ? should I change CMC or .. ?
@rose egret depends. CMC is not bad for FPS games
Where do I look more into why a OnlineSubSystem Join Session does not in fact join a session but seems to make a new game? I'm trying to see where in the c++ code it hooks up to GameModeBase, if anyone has any pointers to where I can look, would be very appreciated.
I imagine it would work fine to just change the direction to that of the ladder in AddMovementInput while climbing? If prediction doesn't work right this way, you would have to add a custom flag in CMC or something
@bleak hawk I Guess AddMovementInput wont do anything in this case because of gravity. this way users could cheat and go up on the sky 🙂
I need custom movement mode 🤔
Yeah you're right ofc
How do you guys handle weapon switching, ammo and currentweapon variable in non-competitive projects? I am analyzing UT right now, nullptr checks, local functions, nullptr checks again, setting weapons nullptr again, bruh.. blowed my mind xD
I thought about creating a struct and setting ammo, current weapon, secondary weapon there and setting an OnRep to it
If it's not competitive and not meant to be super snappy, just on rep it
I have ammo live on weapon actor, actor is spawned when pulled out of storage (equipping from bank or whatever)
@peak sentinel That depends a whole lot on your game style. If you're looking for oldschool shooter, just make a class map of weapons in the controller for private ammo or playerstate for public view. Handle the current weapon's ammo in the weapon, shoot til it's empty, then on reload you can add to the weapon and lower that weapon's class's value in the map. On weapon drop you can choose to add that ammo back to the map or not.
It really just comes down to what style you're after. I mean you can make a huge inventory system, but it's unnecessary if you're just going to have two equipped weapons and not care about ammo type or only care about ammo type for one weapon or a subclass of weapons.
Hey everyone,
I've been having an issue for almost 2 weeks now.
After a seemless travel, I use a "on swap player controller", but whenever anything gets replicated later on the client hast issues getting the values.
I found out, that the issue is that the client side is not ready at that point. (I used a delay to check)
Can someone maybe help me out on that one ?
there are definitely some areas where you do not want to use SDR (the relay system)
like, areas in the world
because valve doesn't have SDR relays there
but, i believe you can just turn off SDR with a function call
In this case in the UK I was thinking they would have relay servers at least nearby like in Germany or something? The 125+ ping suggests it's going to the US.
but i don't know how mixed SDR and non SDR connections work
Great to know you can turn it off though!
I'll see if it can just be cleanly disabled while retaining the other benefits like encryption
i believe it can
you just lose the ddos protection
you retain nat punchthrough and encryption
But keep the IP anonymous?
Great that sounds perfect
I suppose you don't keep the anonymity if not using the relay
you do not keep ip anonymity
Got it thanks
that's the point of the relay
Will search for that function to disable now
Yeah my bad didn't think it through
Just curious about the punchthrough, my games seem to work without it on the standard steam subsystem connection
Is this just because I happen to have some ports open on my router?
Or are there other benefits of having it?
no, the old p2p sockets have nat punchthrough too
Ah ok cool
they are deprecated though
Yeah I really want to stay with sockets but need to sort the ping out for a good experience for all
basically, steam network sockets without SDR are basically the old steam p2p sockets
with a few more features
Noted! And it is the way to go for future support / updates etc.
Will keep it on
Thanks for answering
I found OnlineSubsystemSteam.bAllowP2PPacketRelay controls whether or not packets should tunnel through the Steam communication network when using a dedicated server. but since it mentions dedicated server explicitly I'm not sure if it'll work for listen servers
Will try it out regardless
P2P listen servers always use Steam's communication network regardless of this setting. damn 😦
When Instantiating a replicated object on the server, the constructor should be called 2 times right?
once on server, once for each client
@lament sinew Are you running under one process? I don't believe the log will work for the clients if you're not running under one process.
How can I get a niagara particle system to replicate?
@twin juniper Usually you don't. You create replicated state and let that toggle the emitters client side.
yeah under one process, but if SetNetAddressable to false
i get correct log
for example someone shot his gun that guy plays some niagara effect and the server tells other players to play the same niagara effect for their simulated proxies
@twin juniper Such as creating a replicated boolean and toggling that from the server, and using an OnRep for the bool to turn the emitter on or off.
When working in multiplayer, what would you use for casting to your player class ?
In singleplayer, I used to use: GetPlayerCharacter()->Cast to BP_Player. Is there a multiplayer equivalent ?
(I'm just beginning trying multiplayer stuff, so sorry if that sounds very noob-ish)
@twin juniper Unfortunately that's not quite how that works. You can still use GetPlayerCharacter, but it doesn't work in too many places and the places it does you still don't really use the call. Maybe UI sometimes. You'll learn to abstract your data as you learn more multiplayer stuff.
idk if the name is stable if u created the object during gameplay
it must be same name on client/server to be netaddressable
Oh I see... Thank you. But how am I supposed to do my casts ?
Like here. What object should I use?
That doesn't change with multiplayer. Casting is nothing more than taking a reference to something, and converting it to a different type of reference. It's still pointing to the same object, you're just able to use it differently based on the casted class type. That has to do with class hierarchy.
So I'm guessing I can still use GetPlayerCharacter()... Even though the index is set to 0 ? If that's the case, that's pretty interesting.
@twin juniper This might help you understand a little. The bottom part of both of these are how the C++ in the top part works.
Now the reason this is important is because only one controller exists on each client. Only the server has multiple controllers. This is important because this is where it differs. In a Dedicated server, the server doesn't have a controller itself even though it contains all of the controllers. In a Listenserver, the server is also a player, and the first created controller is theirs.
What this leads to is that GetPlayerController at index 0 will always return the local machine's controller except for on dedicated server, but it still works on Listenserver.
For instance. Calling GetPlayerController on a client will always return null, even with fifty people in the game. While calling that same thing on the server will get the first connected client.
Mhm... It helps me understanding better.
In reality, you will never use anything except a zero in that call, because it should ONLY ever be used for local controller stuff.
So, stop me if I'm wrong, but keeping it at index 0 will always make sure the current client is selected ?
(ex: If I'm playing as a client on my game's server, it will return MY controller ?)
Correct.
That's why it's often only used for UI stuff. UI is always local and never networked,
I was indeed using it in a widget class.
Thank you very much for those explanations. Really!
@twin juniper your widget should be able to get its local player or controller, from there you can easily get the pawn
Yep! Done it, thank you 🙂
Can anyone help tell me why SubsystemBSD::GetAddressInfo fails and I can't create/host a Steam Session. Here's the log file
LogInit : WinSock: Socket queue.Rx : 32768 (config 32768) Tx : 32768 (config 32768)
LogNet : Created socket for bind address : 0.0.0.0 on port 0
PacketHandlerLog : Loaded PacketHandler component : Engine.EngineHandlerComponentFactory(StatelessConnectHandlerComponent)
LogNet : Game client on port 7777, rate 100000
LogSockets : Warning: GetAddressInfo failed to resolve host with error SE_HOST_NOT_FOUND[11001]```
And basically it's trying to find the host address: "World" on port 7777. And it can't resolve this address. I'm not sure why it's sending world. I'm just creating an advanced session using the SteamOnlineSubsystem
because that doesn't look like a remotely valid travel URL
and it's interpreting "World" as a hostname, which is at the start of the travel URL
@lost inlet thanks! So that's where the "World" was coming from. I copied the reference path of the level in asset browser and pasted it in Openlevel. Thought it would be able to open it still, as many things seem to be fine with that copied path.
Having an issue with mutliplayer widget components (Health Bars) looking fairly choppy when the other characters are moving. The characters themselves are moving really smoothly. Any ideas on how to smooth that out?
cate
@rancid cave try attaching the health bar widget component to the character mesh
@lost inlet sorry, i should clarify - Im aiming to have multi player vehicles in which there is a driver, gunner, ect controlling different aspects of the vehicle. I cant think of a way to do this outside of attaching to separate actors.
Dude.. that made a HUGE difference. Would have never thought of that... thanks a bunch!
👍 😄 glad it helped! That's because of how the character movement component handles updated component interpolation with mesh offseting
Characters possess the seats. The truck has multiple seats, and all the seats talk to the truck and send it their control Data like events and variables
Although you don't strictly need to use possession for this.
@dark edge 🙌
anyone know what would make a repnotify not trigger for all clients?
Are they all Network relevant? is the variable actually replicating?
jeez so it was the always relevant lol i thought that only matters when the actors were far enough away from each other
It depends on what your network relevancy distance is
There's also a visual factor to relevancy I think. For instance an actor with just a scene component won't be relevant on clients without Always Relevant.
There is nothing like visual factor in network relevancy
Ah. Not visual, my bad. Collision.
Well, that only applies for hidden things. Which technically while not visible, Scene Components shouldn't be hidden.
is it possible to replicate player state to characters that aren't possessed? like bWantsPlayerState?
Maybe possible, but usually PlayerStates are owned by controllers.
character inherits OnRep_PlayerState from pawn
and the controller owns the character
I can get the state through getowner I just want the onrep
Player state is available globally on all clients
I want the onrep in the character
The better question is which player state you want
the one associated with the owner
The owner of an unpossessed pawn should be null
I'm semi confused about the possession part. Usually even if your player controller isn't controlling the pawn, an AI controller does.
SetOwner
If you are manually forcing the ownership of the pawn, then you can add a new replicated player state on that pawn and set it to the owner's
that'll work
thanks
I'm controlling the pawns with the player I'm just not possessing them, and I haven't come across a reason to have an AIController for them yet
but I haven't made them do anything yet either
so there's that
I'm still just wiring up ability components and character switching
Why not possess them, though
I'm possessing a pawn with a camera, I didn't see any reason to possess them
You should possess the actual pawn imho
I'll be the first to admit that I love writing stuff from the ground up. But if you have semi complicated plans for these, which I assume is the case since they're characters and not basic floating pawns, I strongly recommend the AI controller route for blackboard/behaviortree access.
Also solves the current problem since AI controlled pawns can request PlayerStates.
Or that
that was my original plan but I didn't come up with anything I needed the AI to do that I couldn't just tell them to do directly
so I took the controller out
but I hear you
I figured cross that bridge when I get there but it's becoming relevant sooner than I thought
AI Controllers are cheap. You won't even notice them really. I was messing around with a 350 ai test at some point and running profiling. Controllers were near non existent.
yeah I'm running like 20 characters max that shouldn't ever be a problem
Sweeping movement on the other hand. That stuff is brutal.
it'll take like 20 minutes to put them back in should be fine
and then I can find out that onrep_playerstate isn't a good place to imbue default attributes lol
Attributes as in stats, and imbue as in affect?
yeah
Haha, weeeeeell.
You'd want to do that stuff server side. OnRep should just inform the client that something has arrived when you need to do something with the data like update UI.
the tutorial did it on the server in possessedby and on the client in onrep
on the client to set up input as well
I wondered why initializing the attributes twice though
they should just replicate right
They should. Client should have no effect over that stuff since the real data exists on the server. Changing that kind of stuff on the client is a good way to end up with UI bugs not displaying correct info.
so far I just did it when I spawned them in gamemode and used a client rpc to set up input, it worked alright
What kind of input?
each character has an abilitysystem, I give it an inputcomponent and bindabilityactivation; when I switch to the character I turn its input on in the playercontroller in buildinputstack
it does work fine when I take all the attribute initialization out of the client, thanks
How effective is lowering NetUpdateFrequency if I too many pawns in my level?
I am using 66 for now, not sure if its worth lowering or not at this value
Can someone help me? I can´t get the server calling client to execute an event Clientside
Based on that code, client should print "hello" when a new player state is spawn. But only server says "hello"
Even whit the event on the widget set to "run on owning client"
probably the playerstate was not yet created for the client and the code didn't execute?
and how can i check that?
you calling the client rpc on beginplay?
yep
you can try to use a delay for 5 or 10 seconds before calling the rpc on the client to see if it works
but you should find a better way to solve it
ok i´ll give it a try
@golden nest You should not have RPCs inside widgets. They should represent the game state by fetching it from somewhere else.
Why not just move the logic to client begin play? You are not passing any data in that RPC anyway. Also it won't reach the client as the PlayerState is probably not created on the client side yet.
hi! how come onrep event is not called on my authority client for array replication, but it is called for variable replication
(it is called on non-authority for both variables and arrays)
the variables/arrays are all part of player controler
so i moved the logic to PC, so went a player state begin plays, it loads client data and pass it to server, then it calls an update on every PC to populate their WB with new data. It´s that correct?
i checked by delay and what i noticed is that replication doesn´t happen in time
so if the server calls the all PCs update after 10 sec, it works
But i don´t know how to wait until data is loaded to run the AllPCs update
You can probably just call your functions client-side on BeginPlay. Why do you need to RPC that?
If the same client RPC is called in the same frame with 2 different inputs, would only the second input get called on the client?
i´m a mess with replication haha
So, call it only from begin play?
like this?
cause i need all players to update their wb
begin play is called on both client and server
So if you are calling a client RPC it should be checked if on the server first
@grizzled stirrup I doubt that the inputs matter. This at least prints twice in testing without arguments.
Yes it should be called twice
@golden nest the for loop is unnecessary. You don't have access to other players player controllers client-side.
oh
So, if i remove the for loop and call only a local update, it will happen in all clients and sever?
i mean
That seems fine
you probably should ask the server (server rpc) to send back data via client rpc
whenever client asks for it
So on begin play, load client data and pass it to server, then from server call a client RPC to update window?
https://twitter.com/playrust/status/1369611688539009025
And we were talking about how dedicated servers aren't easy yesterday
Update:
We've confirmed a total loss of the affected EU servers during the OVH data centre fire. We're now exploring replacing the affected servers.
Data will be unable to be restored.
731
So, i change the user variable to RepNotify, so i run the update on notify, but client does not execute anything on rep notify
I´m having a rough day with this..
@bitter oriole Haha, ouch. That's brutal. That's going to be a mad playerbase.
this is the setup of the player state
and the user repnotify
@golden nest If your User pointer notify isn't running, then that object isn't being replicated for some reason most likely. It will fire that notify on the client if that variable changes to anything other than nullptr
So what u mean is that client does not spawn user yet?
Cause i can´t find another way
Client loads data clientside and pass it to server. Server saves client´s data serverside and repnotify the change, so all clients should update their WB
Can´t find the mistake
It´s simply not running on client, but server prints that the value changed
wanna see the prints?
I have to stress the question again, are you absolutely certain that you've taken all of the necessary steps to replicate non Actor, non ActorComponent, UObjects? Because that pointer should resolve on the client and run the repnotify when the thing is spawned on the client from replication. At least Actors and Components work this way.
Meh, wipes are near constant with Rust
Part of the fun, actually
Yeah, I know, just amused that this happens right after our convo
Though I did check that our server was fine first
How is that "user data" structure defined ?
Yes, UObject
Gameplay_PS right ?
that´s the data structure
and i fill it whit clients data, and pass it to server
with*
Did you check that the server function is actually called from the client ?
I'm 97% certain this is a problem with not having UObject replication set up.
I change the struct to repnotify and it works fine
So, u are right
But, it´s impossible to have objects replicated in some way?
Two things I don't get
- where is that basic UObject in the graph ? player state is not one and neither is a struct
- what was the state of the struct if not repnotify ?
Before setting the struct to repnotify it was replicated
I mean, if it's just replicated, you don't get an onrep event i guess
And, the UObject is "User", it is in the event "SetUser"
yeah but i was trying to repnofity user object, not the structure
Basic UObjects don't replicate out of the box
nor can you get them to replicate via blueprints
So what if i would like to replicate them?
start networking in c++
Or use a component instead in BP
only Actors and ActorComponents replicate out of the box
anything not out of the box, blueprint can't do
Got it
its not the usual BP can't do everything c++ can here
BP has the bare bones network functionality
about 10% of it is exposed
no, but let me put it this way
i don't think a game with more then 4 players will ever work well with BP alone
Why?
networking and handling large data sets
are the only 2 things i would not consider doing from BP
well, few other more niche things as well, like pathfinding 😄
Blueprint is great to implement high-level logic, character-specific features, UI, level scripting
It's also how you interact with content
Well that's a stark reminder to backup my Droplet offline 😮
But it's not really great to create an entire multiplayer game
Right ?
The OVH fire is a stark reminder for sure, but makes you wonder how many games actually backup their dedicated server data.
My server data is already stored in S3 so I wonder if just having a periodic lambda job that copies it to another region would be enough.
and is it worth it given the rarity of cloud data loss
No backups at all is probably a bad idea
Some backups at a moderate frequency is cheap
What kind of data backup makes sense for dedicated servers??
backup world state and player data if stored on the machine
or if all stored in the same datacentre 🙂
@silent valley just a thought.. these data can be backed-up at analytics level
Like firebase analytics.. or gama-analytics
So no need to pay for any third party storage
guys, I have a problem...
In my multiplayer ""game"", I assign a pawn to a player and it gets connected to the controller via "start to join".
How can I tell after a world travel which controller should control the newly spawned pawn?
Most tutorials use controller 0 because they assume there is only one player but that might not be the case.
Can I assume that the controller that in world A was number 1 will be the same in world B? 
Another example would be: How to "remember" to which team a player belongs after a map change?
I think u should save the player data to disk or GameInstance when changing maps, so u can load it when u open the new map.
To have the same PC in both levels you can set it in WorldSettings of ur map. U need to change the game mode PC to ur custom one.
So when a new player arrives, the engine assings a new one, but whit the same logic, then u load your player data form disk o GameInstance
Also u can check the "Multiplayer with BPs tutorials" by Epic in YouTube, but its a little bit old, you would have to learn some things by yourself, like posting in this discord channel haha
Server travel can solve quite a bit of that.
I tried but it's really confusing. It starts trying to replicate variables directly from the gamemode when the GM exists only on the server. 😅
I am using servertravel... but... how do I remember stuff between travels? 🤔
If I recall correctly, player state has an event you can override.
EventOnSwapPlayerController is an event that happens when a player controller arrives (via servertravel) to a new gamemode 👀
that could be my ticket
Make sure to use ServerTravel as Seamless Travel
OnSwapPlayerControllers is in the GameMode to go from old to new PC
PlayerState has something similar, OnCopyProperties
That's even better. It makes more sense to store my data in the playerState than the PC. Thx ❤️
Hello everyone. I'm learning UE networking and I wanted to create simple mechanism of players interacting with an actor. I created Interactable component which I'm adding to the Actor. It has collision sphere to detect overlaps with player characters. On OnOverlapBegin and End I print simple message with name of the character overlapping. Problem is, that these events fire twice and they print two player character names even if the second one is not overlapping. Anyone ever encountered such behaviour?
can anyone help with this widget? i can only see the points changing on the character that dies not on all of them
the int is set to replicate tho
is it posible to add like a feature where players get to chose their user name?
I'm spawning characters with a default AI controller and possessing them with ACharacter::SpawnDefaultController, but when I call server RPCs on them that talk to the controller I get "no owning connection for actor" -- what am I missing?
nvm
aicontroller doesn't create a net connection so I can't call RPCs on the character
Trying to make RTS and i want to have 1v1 where each player have own army
but how can i make that player can only select building/army that is on his side
RTS is super super ambitious if that's where you're starting from
just check what team the actor is on when you try to select it
not the first but yeah
I mean if you're starting from "how do I store the team on a unit and check it before doing a selection"
setting like integer (indicating side) and then checking if unit/building have the same int?
set this int as tag or something
or just a property
property?
you gotta do the tutorials
yeah 😛
this is essentially what I'm doing
ok got it
so for most events, like a weapon firing for example
is the best way to do it (to save network bandwidth) for all clients to execute the sound effects +annimations locally
and then each client will then make an rpc to the server
and then that server will tell all the other clients what client fired
err I guess that would just it happen on the client side two times, idk what I'm saying
Why on earth would you try to do anything that involves multiplayer if you don't even know what a property is o.O
but what about things that are both, things that are gamplay important and visually
(that can't be broken up)
I'm just thinking of things that can't be broken up
like a gunshot
everybody needs to know about it but it also has a sound
but if you are making a multicast event would that not double the information for the first client
if it was executed locally and then also sent as an rpc that the server then broadcasted to everyone
ah, ok
hmm, I've seen tutorials where they do a multicast event from a client replicated to server call, but maybe they got it wrong too
well in any case thanks for clarifying to me
I'd assume you would want some type of prediction though in a bigger type game right
at least I'd assume things like that are implemented in AAA games to get netcode right and prevent people from cheating
basic client prediction
tell the server you want to shoot, then do it anyway
if the server comes back with a reject then undo what you changed on the client
or if it doesn't come back at all
basic client prediction ends up being pretty complicated
you should look at using the gameplay ability system
client prediction is built in
In this Unreal Fest Europe 2019 presentation, Matt Edmonds of Splash Damage Games takes a qualitative look at the Gameplay Abilities System (GAS) to help decide if it’s right for your team or project. Then, he switches gears to deliver some quantitative examples to help drive the workflow home.
Learn more about Unreal Engine at http://www.unrea...
@echo pasture
the server shouldn't replicate anything but the shot and consequences
nothing sound or graphics related
Where is AGameModeBase::InitNewPlayer() called in the process of connecting a player to a server? I want to set the team variables and stuff based on Options in the URL so is this the spot?
@unkempt wing Login()
Bit of a strange question: Say you are able to control two hands in game and swing them back and forth. When they reach a certain velocity and collide with each other they make a noise. These hand positions are RPC'd and replicated, but since the RPC frequency needs to be manageable, the other clients will not have accurate hand velocities or collision data. Would it be best to let the client RPC an event itself for its own collision at correct velocity which will then multicast on the server? Or should the RPC set some sort of CollidedServerTime variable that will play the sound on rep at some predicted time? I'm a little concerned that the multicast could take a while to reach the clients and the hands won't be close when the sound plays.
Question on Replication. We've currently got physics based object interaction. How would we best go about replicating physics objects reliably if object position is critical?
but if someone shoots, would you not want information on the sound of the shot location to be transmitted to the server, so that it can tell all the clients where the sound should be played?
also yeah that gameplay ability systems looks pretty cool, I was just moreso asking in general but it looks really nice
You can just play the sound based on a shot location which will be replicated anyway. The same goes for particle effects etc.
how does passing an array or struct by ref work through an RPC?
void ClientPassThings(TArray<FThing> const& ThingsPassed)
{
//Do stuff...
}
void SomeFunction()
{
TArray<FThing> Things;
//Fill struct...
ClientPassThings(Things);
}
would this actually work?
Yes
awesome thanks
It still would be copied though in order to send it over network, but with passing by value it would be copied twice AFAIK
good to know, i wanted to pass by ref anyway but wasn't sure how that worked for sending over the network (since with objects you can't send pointers to non-replicated objects obviously, they wont exist on the receiving end)
like @empty axle said, you're sending info about events that happened to the other clients and they're simulating those events in their world. The sounds and animations are made by their simulations; if you're sending that info from the server your concerns are smeared around way too much
what does the server care about a sound?
if someone has a piano you don't send them an MP3 of middle C you just tell them to press middle C
(GEngine->GetNetMode(GetWorld()) == NM_Client) ? TEXT("[Client] ") I'm using this in a macro to label console output; what should I use to differentiate between two clients running from the editor?
ooh nice find, thanks
I'm spawning this pawn after the player state is initialized on the server, but in onrep_playerstate all the properties are uninitialized; what event should I be looking for to be clued in when there's actually player state on the client to look at?
and then I'm setting a replicated property in the gamemode after spawning the pawn and its onrep isn't being called lol
so far I think I've spent 80% of my time in ue4 on basically this issue in different forms
GameMode is never replicated so that would be why you don't get an OnRep there
It's server-side only
I'm spawning the actor and setting in gamemode, onrep is on the client
I spawn the actor, set its owner to the player controller, then set properties and they don't get replicated
CPP or BP?
cpp
Have you added the properties to GetLifetimeReplicatedProps?
If you check the logs you'll see warnings about that 😄
there aren't any!
Normally it's something like replicated property 'x' not in replication list or something like that
nothin 😦
it likes to see me suffer
I put a sticky note on my monitor it's all good
now if I can just get the abilities to replicate I'll have done something with my week
Are you using GAS?
I think abilities only replicate to the owner.. can't remember off the top of my head
yeah I'm giving them successfully and I can apply effects and change attributes but the abilities never show up at the owner as activatable
I think I'm stretching their idea of ownership as thin as I can and getting burned for it
Might be better off asking in #gameplay-ability-system - there's a couple of pretty comprehensive samples there now too
thanks
Yeah well Ownership in networking sense is going to be whoever owns the ability component
yeah it should all be good to go as far as I can tell
Gamemode exists only serverside... right? (I read this on the EXI bible)
So.. setting gamemode variables to replicate is useless since gamemode itself is never replicated... right?
Then why the Unreal engine video sets everything to replicate? https://www.youtube.com/watch?v=D6QtvPrqNLg

there are some unspeakable things happening in unreal engine videos
eldritch horror stuff? 😨
Apparently, worse
Hi everyone, how i can find those replication settings for gameplaydebugger replicator and worldsetting replication?
In a BP project I have a RepNotify variable; when changed from the "server" and on client if fires correctly.. I don't see this firing on a dedicated server instance (again in C++ I know it's wont' fire, but I can't find any reference to a BP project - will it be the same? i.e. not fire?)
clients cant write variables and expect to replicate them to the server
clients need to RPC to ask the server to change a variable
@soft shell ☝️
Replication is always from server to clients. Never the other way arround.
Clients can call RPC (remote procedure calls) on the server. Server changes values. Values replicate
(BTW: by repeating this to you I found the bug in my code. I was trying to set a playerstate value from the client and expected it to work
)
How is PlayerState's EventCopyProperty supposed to work?
it only does stuff on the listenserver and the clients don't do anything.
I tried creating an rpc and chaining it into eventcopyproperty, and then creatin an rpc to call another rpc because I am going insane and nothing works.
I am testing as standalone with one listenserver (because I know that servertravel doesn't work in editor.) I have my seamless travel on and the listenserver is getting the values but client don't
It's only ever called on the Server
I believe for Seamless travel you might have to use OverrideWith.. but I can never remember which way around it is
can you explain a bit more? I am trying to transfer some player data between servertravels. I only found the SwapPlayerController and this event and I can't make it work with neither 😢
oh OverrideWith is an event... trying that...
nope, not working either 😦
Ok, internet is with me. Nobody managed to make server travel work.
Best I can find: store serverside a map with the players steamid or name or something and then look it up to replicate back.
Are you travelling outside of the editor first of all? Seamless travel IIRC doesn't work in editor at all
I am testing as standalone with one listenserver (because I know that servertravel doesn't work in editor.) I have my seamless travel on and the listenserver is getting the values but client don't
I am testing standalone 😦
A few things to note is that you don't need any of those RPC's
You can do the property copying straight out of 'CopyProperties' or 'OverrideWith'
Okay found the answer - CopyProperties is post-seamless-travel
the problem isn't the travel
OverrideWith is when the player joins a server they recently left and they want to get their old data/PS back
Couldn't remember which way around it was
"picked character" is selected via UI... so it excecutes locally... so the server never sees that the playerstate picked a character... so it never travels 
I am so sorry for making you waste your time 
one day I will be a master of unreal networking...
probably the day unreal engine 6 lands 
does anyone know how to make a listen server setup that hides peoples ips
kinda like how among us just connects to a game code
and the browser shows all open games
that depends on your server subsystem
you either code your own or ride on steam
the default one can only hook up to local servers
ok i think ill use the steam subsystem
so if i ride on the steam subsystem i can hide ips and make it secure?
I think they would still know the host ip but I might be wrong
players should never comunicate with eachother
so you shouldn't bleed any IP adress 🤔
well yea
well, if you have a listen server then you know that ip 😛
but I dont think they would be able to not show the host ip
because u cant just accept packets from the entire internet
even if you don't show the host ip, you can follow your packages down the rabbit hole and find the ip 😛
and the host will know everyone's IPs
it has to, to be able to send the data over the internet 😛

but by now there pretty cheap
deploying a dedicated server and setting up the escalation and stuff is a thing
I use playfab
I didn't know playfab hosted dedicated servers 
yea we were able to get 90 hz tick rate on there standard thing max players 😅
probably amazon gamelift is even better because it scales dynamically based on the number of players instead of a fixed price
i need your help
i need solution to matchmaking, for example i want to join two players in one room ( only one player vs other player )
how it possible
either one of those two creates the server and hosts the game (listenserver)
or
you have a dedicated server for those players.
and then you still need a coordinator or something so they can find eachother 😛
how it possible, can you explain more
my server is already running on amazon
i want to join two players, so only two players can play together
so each player can join room, or another player can join room
is listen server easy to implement?
I'm having some issues with "Set Timer By Events" not going off on the gamemode. I create one for my inital round start timer. Then after my round has finished and it's determined that a team won, I go through the process all over again, Works great the first time, doesn't work at all the subsequent times.
When a player dies, a function executes on the game mode to check and verify if all the players on one team are dead, if so it returns that the round is over. If the round is over, a "Start Round" event is called. It despawns the current actors, respawns everyone in the starting areas and then sets a timer by event for an "Open Gates" event that basically lets the players out. An event is then kicked off on the player controllers with the time remaining in that timer so that the player controllers can create a timer client-side that feeds the countdown widget. No matter what I do, the second time around, the timer is never active when it comes time to tell the clients to display the countdown. It's like it's not getting set. Everything else after that node executes, but it's like the timer isn't being properly generated for some reason
non-looping. Just a "Set Timer By Event", that sets a Timer Handle variable. No Start Delay. 10 Seconds is the value pumped in for the timer.
is it hardcoded ort do you have a varable inputb for time, and if so does it have a good value?
variable but the variable has a default value of 10 and I don't change it yet at all
no clearing or invalidation?
Sorry, I do clear and invalidate the Timer Variable prior to trying to set it again
that is not necessary
Initially, I was not doing that. I added it just to see if there was some kind of strange thing happening. I will pull it back out
settimer will go over whatever that handle is running
it should not cause this
but my trust in blueprints never was
Yeah its just very strange behavior. I've worked with similar routines many times with no issues
i'm quite confident that the flow is solid. So I was just curious if anyone else had seen this kind of behavior
especially considering that god awful behavior they have for initial start delay
yeah I avoid that like the plague lol
in c++ SetTimer(Handle, Delegate, Interval, bLooping, InitialDelay)
Interval 10 and InitialDelay 5 means it will fire after 5 seconds
then every 10 seconds
in BP, they add initial start delay to the Interval for some reason
so its 15 for first one, then every 10
its terrible
they can't
because they would break every project that chose to hack around that
if they did
oh you're right lol
had to go look cuz I knew I was doing that somewhere. And I did have to subtract the interval when wiring in the start delay
i can't even begin to imagine why they made it that way
Yeah that doesn't make much sense at all
I need to call ServerTravel once my players have completed selecting their loadouts in a specific level but I need to have a new gamemode, playerstate, playercontroller, etc. How can I pass the loadout data over to the new level/new gamemode?
I cannot for the life of me figure out why this isn't firing...
Every single bit of code executes after the "Set Timer By Event" node, but Open Spawn Gates never fires and my timer variable is never set with a valid timer. It's like the Set Timer is failing.
This is a Gamemode BP, btw.
so you're binding a timer to an event that calls a delegate?
Is that a no-no?
Not exactly, it's just much nicer to do in cpp; you don't need a separate event for that.
Anyways, what happens if you set initial delay to a non zero value?
I will try that. One moment
same behavior. The OpenSpawnGates event never fires and my "StartTimer" variable is never set.
or at least isn't set to a 5 second timer anyway
the node does execute
Got it... sorry I'm REALLY DUMB
Note to others... when calling "Destroy Actor" from the gamemode blueprint... make sure you plug in the actor you're trying to destroy... and dont forget and leave it as "self" like me... 🙂
ServerTest never runs; what else do I need to satisfy to enable RPCs on an actor?
or how can I view debug output from the underlying system to see where it's stopping?
this is an ACharacter with bReplicates and bAlwaysRelevant set and it does replicate movement from the server to the client
where is servertest?
to be able to call an RPC you have to own the thing that is RPCing. for example, you can't call a gamestate RPC from a client because the client doesn't own the gamestate. You need an RPC in your controller or controlled pawn (stuff the client owns).
if you need a function from gamestate or gamemode, let your controller or pawn rpc call it for you
@graceful loom ☝️
TIL: Gamemode can commit sudoku
so this is a character that's owned by a playercontroller
that doesn't really line up with anything you said so I'm not sure how to interpret
the playercontroller is calling a function on the client object which calls its own server RPC member function
the client object being a character that's owned by that player controller
it's spawned on the server and automatically replicates to the client where this then happens
the character has a good net connection
and is trying to execute the rpc
it passes the checks for "does this function exist on both parties"
it gets a good actor channel
I am reading the docs on how RPC work on cpp (I am a blueprint summer child)
do you have your Validate function and marked the rpc with the WithValidation thingy? 🤔
no but I haven't had to use that to use RPCs before
I added it and it's not called
oh, you are using InternalProcessRemoteFunction instead of just calling the RPC 😬
You are waaaaaaay out of my punching league 😓
no
I'm showing you the code that's running when I call the RPC
just to point out that it appears to be working
I found the insights tool so maybe that will help
I'm creating a cpp project now to see if I can RPC from cpp 🤣
lol don't spend too much time on it
nah, I will have to get back to cpp sooner or later. I can't be a blueprints child forever 😛
GOOOOTEM!
My vscode says everything should be crashing and burning and the imports are all wrong but unreal compiles it anyway
lol yeah
you need visual studio with visual assist if you want intellisense to work
it works in VS but it's so slow it'll constantly tell you everything you're doing is broken
vscode I can't imagine would ever wrok
work
Can someone point me in the general direction of Spectating in multiplayer? Can all of the characters have a spectator camera on them? And then when a player dies I can just set their view to that camera or what way is that typically accomplished. Don't need to get too incredibly detailed, I just need a nudge in the right direction for the most accepted and efficient way to do that
ok, I have a pawn, in the .h file I have:
UFUNCTION(Server, unreliable, WithValidation)
void RPC_WhoIsThis();
then, the cpp
void AMyRPCPawn::RPC_WhoIsThis_Implementation()
{
if (HasAuthority())
{
GEngine->AddOnScreenDebugMessage(-1, 500.f, FColor::White, TEXT("Server!"));
}else
{
GEngine->AddOnScreenDebugMessage(-1, 500.f, FColor::White, TEXT("Client!"));
}
}
bool AMyRPCPawn::RPC_WhoIsThis_Validate()
{
return true;
}
(crazy, the original RPC_WhoIsThis doesn't exists directly, only via the _Implementation thingy)
Finally, I call it inside beginPlay like this:
void AMyRPCPawn::BeginPlay()
{
Super::BeginPlay();
// only the client invokes the rpc...
if (!HasAuthority())
{
RPC_WhoIsThis();
}
}
Bam. it just prints Server!
That's an RPC baby!
are you possessing it?
I just spawn a special pawn for spectating and possess that
@graceful loom but I want the camera to be attached to other players. I don't want them to be able to freely move around
you make the pawn do whatever you want
that's exactly what I'm doing, the pawn has a springarm and camera and orbit controls and I attach its transform to the player its following
you're just resetting your location every tick then?
to match the player you're spectating?
as a component?
Err, there's an attachactortoactor or something like that. I'm on mobile :D
ah okay. i'll look into that. I did this a long time ago and it seemed like I was attaching more like you're talking about
https://docs.unrealengine.com/en-US/API/Runtime/Engine/GameFramework/AActor/AttachToActor/index.html
Attaches the RootComponent of this Actor to the RootComponent of the supplied actor, optionally at a named socket.
nice. I'll look into that. Thanks!
yeah that's what I'm using
though I want to find a solution that has some slop in it
so the camera chases more than attaches
camera lag?
but I haven't messed with it because #multiplayer
camera lag doesn't affect the scenecomponent root
not that I've noticed
Maybe just lerp position on tick
I'm using lag for orbit and zoom and it's attached pretty tightly
Instead of hard attaching
yeah I have lerp chase to switch targets I just haven't put it together for attach yet
too busy having RPCs not fire lol
hm speaking of moving actors, I'm driving this character with aicontroller movetolocation and it's smooth on the client who didn't initiate the move, but jerky on the client who did
at least I have intellisense in vscode working. Slow as molasses but working 😛
am I missing some extra movementcomponent options for prediction?
Prediction? For AI? 🤔
you trying to do local client moving on network but using navmesh?
How do you mean "initiate the move" exactly? Wouldn't that be on the server?
yes a server RPC calls AIController::MoveToLocation
we did that in work project
so client moves locally, no delay waiting for a server rpc and then client moving once server says 😄
hm I don't need any client involvement really
it's not realtime so a delay is fine
I can animate around it
can you gif this jerkiness?
is there any reason to do if(Role == Role_Authority) in a SERVER RPC?
Well im trying to implement a multiplayer inventory correctly, so i have an AddItem that is marked UFUNCTION(Server)
But the Client calls that function
is there anyway for the CLient to cheat this?
hm actually you know what I think I know the issue one sec
@potent cradle we have local client moving on navmesh overrode a lot of the CMC and PlayerController to achieve, then we force the players character to be autonomous, was quite involved, but means client can click and move without any input delay
@clear salmon server RPC will only invoke on server
server should always check that what the client sent them is sane
I have my post-it at the office but there is a command to see the server corrections. You can use that to see if you are actually rubberbanding 🤔
p.netShowCorrections
thataone
Interesting. Why would there be a delay in the normal circumstance?
rpc to server then the server needs to start moving the client via replication
100ms ping would be a small delay
before your character started moving
clumsy is great for creating all kinds of crappy network conditions: https://jagt.github.io/clumsy/download
we just have a guy with a crappy laptop in america host
all kinds of issues crop up 😄
but yeah we test locally with clumsy
I am still at the run client and server on my machine and read frantically the EXi guide phase 😅
i pretty much know most of UE4's networking stuff
only thing that is still tricky is dealing with replication race issues
If I allow my game to get modded, how safe would it be for players to download those mods? Like is there a way to sandbox the mods so they don't have internet access or have the ability to install nefarious things?
best to ask that on the UE4 modding forum tbh
If we are talking nefarious... I can put my evil code in the installer of the mod 😛
I meant like via steam
that is not corrections
do you have your Skeletal mesh component set as replicated?
the player pawn with the camera is replicated so I thought it was that rubberbanding but I ensured that it's attached on both client and server
1s
yup
still jerks
Is the Camera attached to the Mesh or the Capsule?
I used AttachToActor
ah yeah if its on the capsule, it would jerk
is that bidirectional?
as the mesh is interpolated
Attach it to the Mesh
1: turn of skeletal mesh replication. 2: attach camera to mesh
skeletal mesh replication will cause its position to fight with the CMC
@graceful loom when the cmc moves the simulated proxies, it interpolates the mesh
the capsule just jumps
hence why you see that issue
on the "set owner and then try to RPC" my cpp-fu is not strong enough.
I can't find how to get a controller reference serverside 😦
not sure what you mean
you mean set the owner of an actor to a specific player?
normally you know at the time via some reference path
I'm using AGameModeBase::HandleStartingNewPlayer(APlayerController*)
so he's responding to my ongoing issue; I'm using SetOwner on a character that isn't possessed by the playercontroller and trying to call server RPCs on it
the client is doing everything it can to send the call out but the server isn't running it
it has a good connection and channel and builds the call and writes it; rn I'm trying to get insights to work to look at the server side network
@graceful loom but its possessed by an ai controller right?
right
I believe it is let me check
oof nope one sec
you son of a
you solved 4 days of problems for me
fixed my ability system and rpcs in one shot
that sounds wrong... 
if player owns the AI_Controller coudn't he fuck it up and mess with the AI?
@meager spade where's your patreon you won a bounty
can multiple players own the aicontroller? do you swap it? only one player owns it at a time? (like a master?)

multiple children one owner
now that I can go back to implementing gameplay I feel like I don't know what to do with myself
so im looking for some way to do basically struct inheritance for my ability system. I want to send parameters from the client to the server for the server to use in performing an ability. However, I know struct inheritance isn't a thing that's usable for blueprints, and dataassets aren't supposed to be written to, only read from. I basically just want a "FAbilityParam" struct that I can pass into the UseAbility RPC, and then I can subclass that FAbilityParam into different parameter types. On the server the ability can just cast the generic parameter struct into the subclass it actually uses.
How am I supposed to be doing this kind of thing?
right now my solution is just a generic struct with an enum variable (ParamType), a float variable, a uobject pointer variable, a gameplaytag variable, and a string variable. then if i wanted to send something like the target location I would make 3 of these structs, with param types of TargetX, TargetY, TargetZ, and the floats set to represent the X/Y/Z of a vector, and the other fields would just be empty. It feels super hacky and like I'm missing the "correct" way to do this.
you want your RPC to recieve an ""abstract"" version of your struct and then parse it into the correct one?
I am not sure I am following the logic on paper 😬
Anyone know if using root motion blendspaces is recommend/bad in network games?
@frank birch yeah basically. i want the option to send (through this RPC) a struct that could contain a vector, or it could contain a list of gameplay tags, or it contain a pointer to an actor, or whatever, but nothing actually needs to know what it contains besides the ability that receives it on the server. like if I had FAbilityVectorParam that inherited from FAbilityParam, I could just send it as an FAbilityParam to the server, and then the ability could cast it back to FAbilityVectorParam to use it for a target location or something, instead of having separate RPCs for every possible combination of parameters an ability might need to activate or something like that
i'm not sure how GAS does it
but i'd imagine they have some kind of system for passing arbitrary data to an ability when activating it
im explaining it poorly, but if you could pass an object over RPC it'd basically be like having an abstract class and then just passing different subclasses of that class depending on what you need. except when you pass objects by RPC you just pass pointers which wont work unless the object is already replicated
A simple question I hope. Is it possible to create a session without a player controller? What I'm hoping to do is to allow 5 players to "ready-up" in a lobby and then have the server create the session and then all can join it.
I am coding exactly that. I have a lobby map, every player joins, sets up their stuff, servertravels with seamless travel, player states can send data forward (it's an event of playerstate, can't remember now), controllers can also be sent forward (in gamestate, an event called controllerswap).
Oh, I am on blueprints
Neat - so player state is not getting destroyed when swapping maps? (I thought it did)