🍵️

2021-05-31

Combat Mechanic Thoughts For Link-Based Game

Those of you reading this in geminispace probably know about the game AstroBotany already:

AstroBotany - the space gardener game!

It's a simple but surprisingly deep game. In essence each player has a plant. You can look at your plant and interact with it by following links: water it, fertilize it, shake it (it drops gold coins when you do, which you can use to buy fertilizer and postcards and stuff). You can visit the plants of others and water or fertilize those.

The mechanic is dead simple. With each page you visit all the possible actions to perform are presented as links to click, much like a classic choose-your-own-story in html format. Except it's dynamic instead of static. And multiplayer!

Lately I've been thinking about trying to build a multiplayer space exploration game in similar format; actions presented as links. This is simple to implement for most types of tasks, I guess:

The hard part is when the environment acts back. The player will only receive feedback when clicking a link, which means that an enemy can't just show up at any point and start firing. Encounters would have to be triggered by player actions, but that's easy enough.

It becomes a bit trickier when you want to play out a combat sequence. Especially if players should be able to cooperate. So how could we do this?

One way is to have some sort of turn based structure. This works very well when each player faces their own instance of the enemy, similar to how gym battles in Pokémon Go work. But what do we do when one player just... stops? Leaves their computer or loses connection or for some other reason stops sending requests to the server. My conclusion is that turn based resolution works best with one player vs the environment, but doesn't easily allow for several players to face the same environmental threat.

The method I've been thinking most about and quite started to like is this:

The downside here is of course that a player can enter combat, leave the computer, come back an hour later and try to do something only to learn that "Nope, you're dead!" I don't know if I consider this a bug or a feature. The fact that responses only need to be generated on request means that a combat doesn't take continuous CPU power to run. The current state based on timestamps and a chain of events is calculated when requested.

The one thing that really wouldn't work this way is player vs player combat. Imagine if player A enters a zone, starts mining and decides to leave the game to do that for an hour. Then player B enters the zone, finds A there and attacks. When would player A even find out? There'd be no warning, and no way to alert player A that something is occurring independent of their input. This is most definitely a feature from my perspective, however, because I'm not a big fan of player vs player action in online games. Games without that sort of antagonistic component tend to be friendlier.

So there we go. A full post about a tiny portion of mechanic for a game that doesn't even exist yet 😛️ Tell me what you think. I'm sure there's ample precedence out there for similar games that I don't know about.

-- CC0 Björn Wärmedal