Cat Chess (Planning My Next Game)

in #programminglast year (edited)

My project-6.png

Bit of a change of pace today because I need help with the mechanics of this to make sure it works out.

Yes, I am working on a game I currently call "Cat Chess"!

Ever since my wife and I got our first outdoor cats together, back in our first home as a couple, I have been fascinated with the unwritten (I presume) rules of Cat Chess. Now having 4 cats of our own who play an indoor version of the game, I have had further chances to study.

Casper and Tigger, our two lads, would go out into the culdesac which, by chance, looked a great deal like a chessboard.

Owning the Board

We would see them take up spots, then other cats would come out and also take up spots. The cats would move around trying to appear as if the other cats did not influence their movements, but we knew and they knew we knew.

It was all about using your line of sight and your own instincts and cunning to ensure you owned as much prime real estate as possible.

Screen Shot 2022-02-12 at 1.47.01 PM.png

Each cat had an imaginary bubble of space that was the area they were commanding at that moment, and the bubble followed the cat, bending around obstacles and encompassing prize possessions (eg. rotting mouse, chicken leg, a bowl of clean water, toy, etc).

If a cat made a move that ended too close to or crossed paths with another cat then

  • The First cat would move away, usually shrinking its territory.
  • The Second cat would back off again, restoring the status quo.
  • One cat would "get big" and one cat would back down.
  • There would be a short show of teeth/hissing/claws/strength, ending in one or both backing down.
  • or there would be a fight, with varying levels of outcome depending on the ferocity of the attack/defense.

As our boys were brothers, there were benefits to be had by teaming up, that the smaller, but mouthier brother (Casper) would take full advantage of. In most cases, the small one would start the fights with other cats and the bigger one would end them.

Objective Markers

In addition to the raw size of their territory, there were also objective markers that gave advantages or outright winning (though the game is never really over therefore winning is transitory).

One of the biggest advantages is having the high ground, as every Star Wars fan and cat knows.

Higher in elevation == Higher status.

But on the negative side, no cat wants to be in the wet patch.

And whoever rules the litter box, rules the house basically.

Nobody wants to be near the dog, as is tradition, but everyone wants to recharge their batteries in a nice sunny spot, especially a box or basket in a sunny spot. If you get to sleep on the human's bed? Well, that is just like being knighted right there.

Screen Shot 2022-02-12 at 2.11.06 PM.png

Any righteous cat needs at least 4 good naps otherwise they won't have enough energy for their main sleep of the day (note, not necessarily at night - especially if it is your turn for the 4 am run screaming around the house as if it is on fire!).

Books can be an obstacle, a shelf to get a small amount of elevation, or can be just fun to watch fall from the table after something (we don't know what) boops them with, say, a paw.

If you are forced (or fall) into bathtime, then that is you benched at least until you can dry yourself off with your little sandpaper tongue.

Those are the rules, what about the game?

As you might have guessed as I wrote about how custom data on the Hive blockchain works yesterday (custom JSON on the hive blockchain), I have been wanting to create a game for the Hive community for a while.

I chose a strategy-style game partly because it allows the blockchain to not be super real-time, and turn-based games suit that level of response time, but also because I am a tabletop strategy/RPG game fan!

As you can see in the graphic at the top of this article, your roster of cats will have attributes. You might be a mean, huge moggy, or a tiny but lightning-quick kitteh. Each will have its own advantages and disadvantages.

Playing on the blockchain will allow the "it never ends" nature to play out. While you sleep you might find your territory has been invaded, so you will need to fight to take it back, or perhaps you will form an alliance with the ginger beast next door to keep watch?

Hive Implementation

Using the Hive blockchain and custom JSON, we can have many players all on the same game board.

In a way, the Hive blockchain is a lot like a message queue. We can put our moves (Cat1 to square 10,10) onto the blockchain and the game can read them back, in order, while the player doesn't necessarily need to wait for any other players to make their move.

The blockchain itself will sort simultaneous-seeming moves into order, so the game can process in a first-come, first-served manner.

Things to Figure Out

Sounds simple enough but I have some things to consider ...

Ray Tracer

Working out a cat's territory and collisions is fairly straightforward, but I need objects and vertical height to be taken into account. Objects should block the view and also cut into the bubble of territory like a person-sized balloon pressed against a lamp post.

Inactive Players

As mentioned above, using the blockchain rather than a central database/memory array means the game will be turn-based, but that means players might have to wait while one of the users considers their move ...

Should a player not log off but be inactive for a period of time, should their cats go to sleep or should AI kick in?

How long should the game wait for instructions?

In the UI I can have a clock tick down until their time is up, perhaps that clock tick should call home to the game, and if the game isn't pinged in X seconds then the player forgoes their move or even they respawn back in bed?

What do you think?

Please let me know what you think about my ideas in the comments!


Sounds interesting. I'd have to play it to fully understand it I think, but I like the idea of it. The quirky cat idea is a good concept.

So how many people are all playing at once taking turns?

Regarding your questions at the end. I think you need some sort of time limit on moves in order to keep the game going. Like 12 hours maybe to allow a minimum of 2 moves per day. I think the amount of time will need to depend on how many people are actually playing at one time. I think people would get bored if the game never moves though, like if an opponent logs on once a week for instance.

Being able to take part in multiple games simultaneously would be good as well. Like online chess where you can play 10 games, against multiple opponents so you are always able to play.

Just my thoughts. I don't fully understand it yet though so take that with a grain of salt.

Yeah not sure if it should be one open world or if you should start a unique game that a few people can join

I see. Yeah I guess it would depend on the dynamics of the game. You can always just experiment with different options to see what works and tweak as you go. Good luck!

Regardless I’ll learn a lot, so it won’t be time wasted 🤓

There are some play-by-post type of game like this on Hive but they are not fully automated.

I would be really interested in helping this move along.
Reach out to me in discord sometime if you want to talk about it.

Awesome thank you :)

We're looking forward to welcome it here on hive. The project will brings a good potential to the blockchain

I hope so, not looking to make money from the game, just hoping to learn a lot and maybe be able to then help other programmers learn from my experience :D

Okay that's definitely good idea. Giving people opportunity to learn from your experience, that is so kind