How I created a mobile online game from a traditional card game
Tags: android, ios, php, python
Published: 2020-08-11 09:38:14

# 🎥 Trailer video
https://drive.google.com/file/d/18Fp9bgSJ4kSVdzrQxuxn7ZPeIiGbQmy4/view?usp=drivesdk
Note: Contrary to what is indicated in the video, the game is not available in the Play store/App store

- - -

Hello everyone, I am a french high school student passionate about programming, and in this post I will introduce you to Boursicocotte, a mobile game that I recently developed with Godot Engine. 

It is the porting of a card game on mobile and online, to play it remotely. Initially I was just making this game to play with my friends, but I thought that it would be interesting to show it to the developers community. 


# 🃏 The original game
The original name of the game is Kuhhandel, and it was invented by the German Rüdiger Koltze. It is an auction game in the theme of the farm, from 3 to 5 players, which gives a very important place to bluff and strategy. The goal is to get as many animal families as possible, either by winning them at auction, or by stealing them from opponents with cunning. I'm not going to go back over the rules, but you can find them at this link: [http://www.gamecabinet.com/rules/Kuhhandel.html](http://www.gamecabinet.com/rules/Kuhhandel.html) . I really liked it when I played it for the first time and I had the idea of ​​programming it so that I could play it remotely with my friends!


# 🖥️ The port
As mentioned earlier, this is a card game; and it is very fun in view of its simplicity: the cards are limited to 4 animals per species (10 species) and money cards of values ​​from 0 to 500. As for the "gameplay", it is turn-based with 2 possible actions per turn: auction or animal claim. It is therefore at first sight fairly simple to program.

I also specified that the game is online: here I opted for the centralized server solution (rather than peer-to-peer) for several reasons: speed of requests, simplification of the code, simpler troubleshooting in case of problem in game. The code on the server side is quite simple: I'm not trying to make an ultra-advanced code if it's just for playing with friends. In addition, in terms of how the code is made, first of all it is in PHP, and the data is provided in the form of JSON code. There too I opted for this solution (and not a higher level API, with function calls for example) for several reasons: simpler synchronization of clients when restarting the game, simpler code on the server side, etc.

As you can imagine, most of the work is done on the client side (written in GDScript which is similar to Python, on the Godot game engine). In fact, communications with the servers are made via 2 HTTP Request objects: one which continually collects information of the game to synchronize the client, and the other which takes care of sending data. This solution is obviously not perfect (the server cannot support thousands of players) but it is more than enough for normal use.


# 🎮 Visuals and release
I am not a graphic designer, and so much the better since this game does not require a lot of visual elements, only the design of the UI that I realized with an open source pack (credited in the game), an icon free for commercial use and a logo made on powerpoint.


# ✅ Conclusion
Originally this game was supposed to remain for personal use, but I am thinking of the eventuality of editing it. If you are interested or know a mobile game editing company which could be, don't hesitate to contact me via private message. You can also contact me if you want a copy of the game just to try it!

Thanks for reading, greetings form France!