Introduction

Hexatak is an online multiplayer isometric board game, up to 4 players, made in C++ with SFML.
The game was made by 6 developers and 3 artists in around 4 months.

Here’s what I did

Networking

SFML only had a basic system for sending packets. I made an abstraction resulting in two classes, a Client and Server class, each with events for received packets, client connections / disconnections etc. This made handling multiple clients and adding packets a lot easier, for example:

class Packet
{
public:
    // Serialize packet data to be sent
    virtual void Serialize(sf::Packet& _packet) {}

    // Deserialize received packet data
    virtual void Deserialize(sf::Packet& _packet) {}

    // Handle packet-specific logic
    virtual void Handle() {}

    // Identifier for each packet type
    virtual int GetPacketID() { return -1; }

    virtual std::unique_ptr<Packet> Clone() { return nullptr; }
};

Broadcasting packets is just as easy:

const Hexagon& hex = map.GetHexagon(i, j);
HexPacket packet(i, j, hex.type, hex.hexVariant, hex.prop.type, hex.prop.pos);
onlineData.server->Broadcast(packet);

ImGui

Since I ported Stellar to C++, I had the ability to include ImGui to create small tools that made debugging a lot easier!
The first example is in the lobby where we linked client IDs to card slots so when a player gets disconnected and reconnects, they find an available card slot. Hexatak Lobby debug tool

The other example is in game where we’d kick a player or give ourselves coins to find bugs. Hexatak InGame debug tool

Conclusion

I enjoyed making the different systems for the game and I learned a lot about networking!
I’m not going to lie though, making it work was a chore. I had to account for a lot of edge cases to make it work, but the result was worth it.
The game worked well enough for us to be playing it on our computers during lunch break for a few weeks after we were done with the project!