Implementing chat integration in Hive Time

Scroll or press Space to continue...

Who am I?

My name is Cheese, and I wear many hats. The ones that are relevant today are:

You can find me on Twitter as @ValiantCheese or on irc.freenode.net as Cheeseness.

I've worked on some games you might have heard of


And others you might not have heard of

Today we'll be talking about Hive Time

Hive Time is a bee-themed management sim/base builder. You might like it.

A disclaimer

As always, every developer and every project has its own context and identity.

What's discussed here is not advice, but perspectives shared in the hopes that it can help you discover or navigate the best fit for your own work.

Chat integration in Hive Time

Today we'll be looking at the following aspects of "chat integration" and how it relates to Hive Time:

Inspirations

Hive Time's chat integration draws inspiration from the following games:

Inspirations - Hand of Fate 2

Hand of Fate 2's integration options focus on choice/outcome voting, but also allow endless mode bosses to be named after active chat users.

Inspirations - Overland

Overland's integration options focus primarily on presenting chat participants as survivors, but also allows voting on destinations.

Chat engagement

These features can be mapped along two axes.

Chat engagement - visualisation

These axes seem to have loosely inverted depth in many cases!

Implementation goals

For Hive Time, I wanted to have a mix of features that could provide value along both axes.

Implementation goals - visualisation

Chat bees decrease the passiveness of viewing. Event and gift voting affect gameplay, but an individual vote feels less impactful than a bee.

Implementation goals - further concerns

There were a few extra things I wanted to keep in mind for giving the best experiences for players and viewers.

Protocols

Most streaming platforms offer their own APIs. As a solo developer who doesn't want to be tied to one platform, an open standard makes more sense.

Protocols - IRC

IRC is an older protocol with a few advantages. The client protocol is defined in RFC 1459, and updated in RFC 2812.

Implementation

Hive Time's chat handler implements a partially functional IRC client, implementing 8 commands out of around 60.

It is also read only (so as to not need to bother with authentication).

Implementation - architecture

It's magic!

Implementation - architecture

It's not magic!

Implementation - voting

Gift options use numeric identifiers while event choices use alphabetical identifiers in case they happen concurrently.

Voting uses a # prefix so as to not be confused with commands (which use !).

Implementation - bee commands

Once a chat participant is assigned a bee, they may issue commands to adjust the size, shape, role, and hat of their bee.

Their non-command messages are automatically relayed in-game via speech bubbles coming from their bee.

Implementation - dev commands

A number of developer-only commands expose options for adjusting player population or resources, as well as triggering any event or effect content within the game.

Implementation - command definitions

To keep things scalable and easy to integrate, I wrote a structure for declaring commands that defines the expected format and function to be called.

!eat_me chat bee command definition:

	"eat_me": {"func": "resize_bee", "format": [], "default_values": [1.5], "pass_user": true}

!give dev command definition:

	"give": {"func": "give_resource", "format": [TYPE_INT, TYPE_STRING]}

Implementation - dev bees

As something special for my collaborators, I added unique bees, which will be used when the !spawn me command is invoked by a known dev.

Cutting room floor

There were a number of additional features/functionality I considered, but wasn't happy with or didn't have time for:

Further Reading

I've tried to write about, stream, or otherwise document every aspect of Hive Time's development. If you're hungry for more, read on.

Thanks for listening to me waffle about Hive Time's chat integration!

Hive Time and more can be found on my Itch.io page

More musings on development can be found on my Patreon page

More of my writing about games, and game-adjacent culture can be found at CheeseTalks.net

This presentation was created using Stack