If folks have questions or comments, can they please put them in the thread and not PM them to me! Thanks
Although for most people moving to 4.10 was relatively simple in comparison to other releases, for me personally it’s been a bit of a nightmare. I’m currently working on two Multiplayer titles that although ambitious aren’t doing anything outside the realms of a normal competitive multiplayer game. However, a lot of the time I find myself fighting issues purely because engine code hasn’t been fully tested in a Multiplayer environment, and having to come up with some pretty significant workarounds. One such example that has since been fixed was that you couldn’t change the pawn you possessed in Multiplayer - something that is pretty commonplace in a lot of MP games.
So really I’m just creating this thread to try and draw attention to some of the biggest issues I’ve been experiencing with Netcode both in 4.10 and below, in the hope that Multiplayers get’s the attention it deserves. I’ve linked a couple of the most major ones below but rather than just repeat myself, I really want to raise the issue for the need for a netcode hardening pass of some kind. As an example, here’s a couple of issues I’m hitting since 4.10:
Widgets Disappearing For Clients in Multiplayer
This is probably the most frustrating of the bunch and definitely surfaced in 4.10. Whenever a client changes the Pawn they possess in a Multiplayer game, any sort of persistent User Widget stops ticking and therefore drawing too. I am yet to figure out why this is, but brought it to Nicks attention on Slack who indicated it may be related to Widgets being “torn down and rebuilt” when a player changes a pawn. I imagine there’s a reason for this, but whatever it is, it doesn’t work at all in Multiplayer. My game has vehicles (pawns) that players can hop in and out of (via possession). All you need to do is add a widget to the screen via a HUD class and test it in MP, and they’ll stop working the minute I try to posses another object.
The workaround for this is god-awful. You have to force-tick the widget by calling it’s Tick function from another class, which completely voids the point of widgets not ticking when they’re not supposed to be rendered. Once the widget starts drawing again, it’s also ticking itself natively - so most of the time it’s double-ticking. Needless to say, this is less than desirable.
I’m trying to build a repro project for it, but it’s going to take a bit of setup because it’s Multiplayer. Nevertheless, answerhub post here: UMG Widgets stop ticking and/or drawing for Clients in Multiplayer - UE4 AnswerHub
Uint8 doesn’t trigger OnRep_ functions if value is Zero
This possibly occurs to multiple engine types and maybe even pre 4.10 - but I’ve been using uint8’s for serialization / quantization of values for replication but found that if the value is zero, they won’t trigger the Replicated Functions for clients. This doesn’t just affect me though, since a lot of engine types do this natively (such as FRotators for example in FRepMovement) and therefore there will be some bugs in engine code. Again, to most people they won’t be noticeable and there are workarounds, but this had me stumped literally for days and I feel like it’s an oversight in the Engine netcode.
It’s also worth mentioning this; There were a fair few changes to Replication in 4.10 and yet not a single one of them was documented. For someone working on two multiplayer-focused titles this has proven to been an absolute nightmare. New options for FRepMovement for example weren’t documented in the release notes despite being a pretty significant (and useful!) change. The only way to get around this was to compare relevant files on GitHub from version to version, which isn’t foolproof - or hope you run into them at some point anyway.
I realize most people aren’t doing Multiplayer and for the majority of projects these kinds of bugs won’t surface because I can’t imagine most people don’t have to be so conscious of bandwidth as I do - but it’s already taken a significant number of releases to fix some age-old netcode bugs (such as pawn possession for example), and it would be a shame if the netcode didn’t receive the same treatment as other areas of the engine. I personally would like to see some updates that really focuses on Multiplayer in the upcoming months. AFAIK, there’s nothing planned on the trello. Most importantly - I’d appreciate it if changes that may affect multiplayer are tested in that environment as well as non-multiplayer ones. MP is after all a first-class feature of the engine.
Many improvements to the engine could be made, a huge stack of changes and optimizations that Pete has made for Unreal Tournament being brought into the engine would be fantastic for example. ShooterGame and VehicleGame are fantastic resources that I can imagine took a lot of time and effort to put together. However, both are VERY old now (must be 2-3 years or more?) and neither scales very well past more than a handful of players. So on top of the engine improvements, a newer up-to-date MP example would also be a welcome gesture
@Community - feel free to post any weirdness you are experiencing in MP, and of course share thoughts on a MP hardening pass on the engine.
List of Features / Fixes / Improvements requested thus far.
- Fixes for above issues.
- Ability to Override replication of Private Properties in AActor (E.g., 'Owner, AttachmentReplication, RemoteRole etc.)
- Fix client disconnection/validation failure when strings are > 1024 chars.
- ‘Get Ping’ in BP always returns 9999](Multiplayer bugs becoming more prevalent - Harden & Improve Network / Multiplayer Support! - Feedback for Unreal Engine team - Unreal Engine Forums)
- Debug/Breakpoint for specific instances in PIE (Server, Client 1, Client 2 etc) in Visual Studio
- Support for Origin Rebasing in MP
- Documentation for Order-Of-Operations in Multiplayer