HKMP update and proximity chat
Added 2022-03-16 12:57:00 +0000 UTCRecently, I released version 2.0.1 of HKMP, which included the API and the chat and command features I talked about in the last post. Shortly after, I got around to fixing a few of bugs that were introduced in that version and some bugs that were long overdue for some fixing. This was HKMP v2.0.2 and is now the latest stable release that seems to be running quite well. In this post, I'll go over some of the bugs that got fixed, the background for those bugs and I'll give you all early access to the proximity voice chat addon I have been developing.
One of the bugs that has been around for a while, but got noticed relatively recently was that spells (namely Vengeful Spirit, Shade Soul, Howling Wraiths and Abyss Shriek) seemed to not work correctly after disconnecting from a server and casting Descending Dark once. Luckily, the reproduction steps of this bug were simple. It would happen every time after disconnecting and casting Descending Dark. What I try to do while developing HKMP is to impact the game code as little as possible and focus on only reading/hooking certain parts of the code to transmit relevant information. The animation manager, the component that handles all the animations (such as spells in this case) for other players, is no exception to this concept. It relies on hooking existing animation methods and send the corresponding data to the server. This is what intially made this bug stand out, by performing an action in-game, other spells would be affected and not function properly anymore. When I put all this together, searching for the bug become a lot easier. It came down to looking at what parts of HKMP were modifying existing behaviour of Hollow Knight. And indeed, I made a mistake when hooking an animation event in the Hollow Knight by overriding an existing handler for it. This existing handler was only used for Descending Dark and by overriding it, broke the handling of other spells.
Another bug that I didn't get around to fixing until now, was that the animation for Cyclone Slash stuck around if the player casting it would enter water or acid before the end of the animation. In the early days of HKMP, this would happen very often. The reason is that the way Hollow Knight handles the player and its animation is very distributed throughout the code. A normal scenario would be that a player executes Cyclone Slash and the animation "cyclone slash start" (not exactly its name, but you get the gist) would play. Then when the player finishes executing their Cyclone Slash, another animation would play: "cyclone slash end". And this makes it very easy for HKMP to just hook it and inform the server of the start and end of the Cyclone Slash. Now the issue in a lot of these cases arises when the player gets interrupted during the Cyclone Slash. In this specific example, entering water or acid will completely skip the "cyclone slash end" animation and immediately begin the "water enter" animation. HKMP will no longer send that the player has stopped executing the Cyclone Slash and now the server thinks that the player is casually swimming while spinning around with their nail. There exist a lot of these so-called edge cases in HKMP animation handling and this will probably not be the end of it, but the solution is to simply check when the player enters water if they were doing a Cyclone Slash and cancel it.
Now let's talk about HKMP proximity voice chat. During play-testing of the HKMP Tag mod, people made the remark that it would be fun to have proximity voice chat. To be able to only hear your fellow players if they were close to you in Hollow Knight. Not only did I like the idea a lot, we were also in the midst of planning a large-scale HKMP Tag event (~25 players), which would be extremely chaotic given that all players would be in the same Discord voice channel. Proximity voice chat would be a great solution to this problem, we could have a large amount of players without cluttering the voice communication simply because players could spread out in-game. And of course it would also result in some interesting shenanigan when getting chased by a tagged player. And while the idea was interesting, the execution could go two ways: either I developed voice chat natively in HKMP, which would be an incredible amount of work or I used existing voice chat programs that supported positional audio. Naturally, since we were already planning the event and I don't have that much free time on my hands, I opted for the latter option. Therefore, in order to use proximity voice chat for HKMP, everyone playing needed to use the voice client called Mumble (https://www.mumble.info).
In the attachment of this post I have included the proximity voice chat addon for HKMP. You can use the latest HKMP version (v2.0.2) from Scarab and drop the HKMPProximityChat.dll in the "Mods/HKMP" folder. As mentioned earlier, this addon requires players to use Mumble, which requires some setup to get working. The following steps should help you setup the necessary settings to get everything working:
- Download and install Mumble from https://www.mumble.info/.
- Open Mumble and go through the audio configuration. If you accidentally close it, it is also accessible through "Configure > Audio Wizard".
- In Mumble, open "Configure > Settings".
- In "Audio Output > Positional Audio", do the following:
- Check "Enable"
- Set "Minimum Distance" to "1.0m"
- Set "Maximum Distance" to "15.0m"
- Set "Minimum Volume" to "0%"
- Set "Bloom" to "50%"
- Still in the settings, in "Plugins > Options", check "Link to Game and Transmit Position"
- In "Plugins > Plugins", scroll down the list until you find "Link", then check all three boxes next to it.
- Close the settings and click "Server > Connect..."
- Then in the pop-up click "Add New..." and in then enter the following info:
- Address: "51.178.38.45"
- Port: "64738"
- Now you should be able to connect with the Mumble server
- Once you are in Hollow Knight and have connected to an HKMP server, you will see that in the chat to the left the message "Link (HKMP) linked" appears.
The proximity chat addon has a single key-bind that will toggle your ability to use proximity chat, if you need to talk to everyone for example. The key-bind for this is CTRL+1.
I have also included the latest version of HKMP Tag in the attachments. The HKMPTag.dll can also be placed in the "Mods/HKMP" folder. And as always, if you have questions or are unsure about anything, feel free to ask in the Patreon channel in Discord or send me a message directly on Patreon!