IllustratorsLeak
Extremelyd1
Extremelyd1

patreon


HKMP Future developments

This post is going to be a bit shorter than usual and will not focus on recent developments of HKMP. Rather I will discuss some technical details for the future of HKMP.

Let's get started with talking about an issue that has taken a backseat for a while, but is due a solution. The current connection protocol of HKMP does not handle unexpected behaviour very well. What this means is that when a client tries to connect to a server, but the connection fails for an unknown reason, it might happen that the server will keep sending packets to the client while never formally accepting or rejecting the connection. On the client-side this puts the HKMP mod in a sort of limbo state. The connection will never succeed or fail, never inform the user about it and softlock the connection menu. Subsequently, it requires the user to restart their game entirely to be able to attempt a connection again. 

I only recently started tracking this issue after updating the public servers with a new version. Players that were using the old version while trying to connect to the new version would run into this exact issue. The packets they were sending were technically correct, but the server would never respond to connection attempts, because there was a version mismatch. And instead of informing the user about it, a lot of players would become stuck connecting. The solution for this issue is fairly straightforward: on both sides of the connection we can keep track of how long it takes for the connection to be accepted. If it takes too long, we simply stop sending packets, which will terminate the connection. In that same vein, there has been a suggestion for keeping track of network protocol version and send the protocol version with the initial connection. That way there is feedback to the user if they attempt to connect with an older (or newer) version of their HKMP mod to a server.

The API is also going to receive some additions and changes in the future. Although there have been few requests for the API, I still think there is a lot to be improved on. First of all, there has been a mod released named "HKMP.ModDiff" that inspects the mods that clients have installed and informs them of mismatches with what the server expects. For example, when playing a specific gamemode like the Battle Royale mod (such as the recent video by fireb0rn), the "HKMP.ModDiff" will notify players that they need to have the BR mod installed. The way this mod currently interacts with the HKMP API is that it allow connection in all cases, but if it spots that a client does not have the correct mods installed, it will issue a kick for the given player. This approach definitely works, but feels a bit crude and unoptimized in my opinion. What the HKMP API can benefit from in this case, is a way for addon to add data to the initial connection and have authority over when player connections are accepted or rejected.

Secondly, as suggested by Mulhima (and perhaps a few others), HKMP should offer addons a way to modify the server settings, like whether PvP is enabled, whether skins are allowed and the damage that the nail and abilities do. In a lot of gamemode addons, this feature is highly useful. It allows the addon to directly set the settings that it is best played on, without requiring manual input by the server host.

Unfortunately, that is it for this post. Due to personal circumstances and time constraints, I haven't been able to put much time into HKMP. Luckily, HKMP and the API are in a good state right now and other developers are still working on new addons to play with HKMP.


More Creators