IllustratorsLeak
Extremelyd1
Extremelyd1

patreon


HKMP API development details

Current development of HKMP focuses on implementing an API for interacting with HKMP and its networking. Read the rest of the post to get an insight in the development of the API!

The idea of the API is to expose internal workings of HKMP to so-called "addons". Addons are divided in two parts "client addons" and "server addons". Addons are similar to mods in that they are assemblies that are loaded and can interact with another codebase. In our case, client and server addons are loaded separately by the client-side and server-side of HKMP and can then interact with their respective APIs (namely the client API and server API).

The reason for having a divide between client and server addons is that the standalone server has no notion of the game code, but it may still be interesting to have a server addon that solely interacts with the server-side. An example of this is an addon that provides a spectator mode. This addon only needs to interact with the server-side to prevent certain players from seeing spectators, but allow spectators to still see everyone else.

Addons that require networking are allowed a channel over which they can communicate with the respective counter-part using the existing HKMP networking. This means that to make use of networking you need to develop both a client and a server addon. These addons can then communicate with each other to relay important information.

An example of an addon that is both client and server-side is an addon that implements a game-mode for Tag. This is the addon that is also being developed as an integration test of the current implementation of the API. The networking that Tag uses is to communicate game-mode related information: a request to start a game, when a player is tagged, when the game is ended and who the winner is, etc. The client addon of Tag is responsible for equipping the player with the appropriate charms when the game starts (depending on whether they are a tagger or not), joining the correct team and setting the correct skin. And the server addon of Tag is responsible for choosing who the initial taggers are, who is left not tagged yet and when the game should end.

The HKMP API when finished should be able to facilitate all kinds of fun game-modes, client-side improvements, interaction with other mods for multiplayer and much more.

If you have any questions regarding the API, feel free to shoot me a message on Patreon or add me as a friend on Discord. I'll also be able to provide you with a development version of the API and the corresponding Tag addon to test it out with friends.


More Creators