[Update] Dark Souls 2: Seamless Co-op - Stress testing, QoL, and world state networking patches
Hi everyone,
Since I've been working more on Dark Souls 2 this week. As I mentioned in my previous post, I've been working on stress testing the mod to make sure it can handle the conditions real users will be playing with.
In this post I'll be going over some of the progress I've made.
Stress Testing
When I test these mods before release, I usually do 10 or more playthroughs with my friends to check to see if the mod is behaving as it should be, and if there are any game-breaking bugs.
Although this is normally satisfactory, the same logic of "if it works with 3 players, it'll probably work with 4, etc." cannot be applied to Dark Souls II because of it's bizarre summon slot system locking certain phantom types out of the world depending on various character factors (such as covenant)
Thankfully, the mod appears stable with higher player counts, including players warping / disconnecting freely. There was one crash associated with a missing class in one of the functions I wrote to acquire player networking information in a thread-safe manner, however I fixed it relatively easily once it happened.
The other issue I encountered is that I did not account for a player sitting at a bonfire whilst another player was fighting a boss. This just caused the boss to reset to it's inactive state and the player inside the boss room could get a free kill. I have addressed this by disabling bonfire use when a player in the session is fighting a boss.
Spectating, enemy scaling, and other functions linked to player count also behaved correctly.
QoL
ALT GR
I noticed that pressing ALT GR on your keyboard during the name creation screen caused all other inputs to be dropped until you either tabbed out or pressed CTRL. Looking into it, it seems like Dark Souls II treats the ALT GR key as if you're holding down the CTRL button permanently (for text inputs).
I opted not to change this, because fixing it would require me doing a deep dive into the KatanaMainApp input system (which looks really long and boring) plus the benefit of fixing it is minimal and fixing the issue at runtime is easy. So although it isn't technically a QoL fix I'm just writing it here just in case other people encounter it and can fix it themselves.
Player frame update rate
A player frame update refers to a networking packet which contains information about a specific player - specifically how much health they have, where they are, and which way they are facing (as well as some other specific flags such as damage negation).
In the vanilla game, players will poll changes to their own player data at a rate of 15 frame per second. Only if any changes to the player's parameters have occurred in those frames then an update will be sent to the session to update their player character on other players screens.
In seamless co-op, I have changed it to poll changes at a rate of 60 frames per second. In addition to this, a full set of frame data is transferred about the player regardless of whether it has changed or not. This was originally done to fix a different bug that I created, however it has the upside of making network player movement feel more responsive at a cost of a small increase in networking traffic (about an extra 1KB/s)
World State Networking Patches
The world state packet is unique to Dark Souls II, and contains all of the information a client needs about the host world in order to connect.
It's a variable size packet, but at it's smallest it's around 33,440 bytes containing various structures of information such as summoned NPCs, enemy states, enemy positions, dropped items, event values, etc.
I've had the pleasure of completely mapping out and naming every single variable in all of the networking packets (to the best of my ability), and this one was by far the most fun to go over, mainly because of how many crashes and exploits could be inflicted by malforming various parts of this packet.
As I've said before -- although FromSoftware did a great job fixing the vulnerabilities for all of the networking packets that I sent to them in the document, some of them were overlooked such as:
MapItemPackCtrl (such as forcing items and crashing)
CharacterStatusPacketReceiver (changing hollow states)
NetNpcPhantomSync (out-of-bounds write up to 4456380 bytes)
These have been fixed in both Blue Acolyte and now in Seamless Co-op, so hopefully the disruption cheaters can have on the community is minimised. Even though I am confident in my fixes, seamless co-op will also automatically backup save files.
As always - thank you for your patience and a huge thank you to all of my supporters <
Take care,
Yui
