The recent project I worked on was a mahjong game project. Since it was targeted at the Sichuan region, it involved the rules of Sichuan mahjong. The popular game modes include "Blood Battle to the End" and "Blood Flowing Like a River". The main difference between these two modes is that in the former, the remaining players continue to play after a player wins, until all players have won or it is a draw. In the latter, a player can continue to win after winning, until the end of the game. The results of the game are calculated based on the winning situation. Speaking of mahjong, in our area, playing mahjong mostly implies gambling, but there are also pure entertainment purposes. This is in stark contrast to the attitude towards mahjong in Sichuan and is influenced by regional characteristics and different cultures. Since I don't know how to play mahjong very well, I won't go into the specific rules of mahjong here.
When we first started this project, I believe that my team members were also confused because none of us knew how to play mahjong and didn't know where to start. We didn't even know which game engine to use for development. In the past, I had heard of game engines like Cocos2d-x and Unity3D, but what I heard was far from the actual development process. After analyzing the problems we faced, there were three main issues: not knowing how to play mahjong, having no experience in game development, and having a short development cycle and cross-platform requirements.
Since the game needed to run on Android and iOS, after discussing with my team members, we decided to use the same game development engine and collaborate on different modules. We would then merge the code of each module and compile the project for different platforms. This way, we could save development costs and time. The first choice that came to mind for a platform that could run on both Android and iOS was C++. So we chose Cocos2d-x as the game development engine for this project. We decided to first learn about Cocos2d-x and then determine if this solution would work.
As mentioned above, the first two issues were about not knowing how to play mahjong and not having experience in game development. The only solution to these problems was to learn. First, I needed to understand the types of mahjong and learn some basic rules, such as when to make a "Peng" or "Gang". Second, I had no experience in game development, but I thought back to when I first started learning Android development. I didn't know anything at the beginning, but I learned step by step. So I decided to learn some game development-related knowledge, at least enough to solve the problems in the project. The last issue was about development efficiency and approach. As long as we chose the right solution and managed the progress well, there shouldn't be any problems.
After a few days of preparation, I found that it would be difficult to develop a complete commercial project using Cocos2d-x in the short term. So I decided to use Cocos Creator, a game editor based on Cocos2d-x developed by the official Cocos team, for this project. Here is an overview of Cocos Creator from the official website:
Cocos Creator is a game development tool with content creation as its core. It is based on Cocos2d-x and features complete scripting, component-based development, and data-driven design.
Cocos Creator is an integrated, extensible, and customizable editor based on the open-source framework Cocos2d-x. It introduces component-based programming and data-driven architecture for the first time in the Cocos series of products. This greatly simplifies scene editing, UI design, resource management, game debugging and preview, and multi-platform publishing in the Cocos2d-x development workflow, making it the best choice for team collaboration using Cocos2d-x.
Currently, I am trying to learn how to use Cocos Creator to build the game interface. Overall, I find it quite convenient and easy to get started with. The best thing about Cocos Creator is its strong adaptability. Adding constraints to complex interfaces can make the layout hierarchy more complex and may cause interface lag. I recommend adding constraints to general interfaces, but not to overly complex ones. However, this is just my personal opinion. I still recommend adding constraints, as they are beneficial for adapting to different screen states. By the way, I would like to complain about the documentation of Cocos Creator. I personally think it needs improvement. Many things can only be solved through answers from Cocos forum users. Of course, we shouldn't expect too much, as Cocos Creator is still being continuously improved. If you are interested in learning game development, I recommend starting with Cocos Creator.
That's all for today. In the future articles, I plan to record how to develop simple scenes using Cocos Creator, mainly in the form of case studies. On one hand, it serves as my learning record, and on the other hand, I hope others can understand it. To prevent myself from slacking off, I hereby declare that I will publish at least 10 articles related to Cocos Creator.