TRAE connects Douyin mini-game tools: an author's 30-level match game, refined with Codex

The author builds Kitty Convenience Store with TRAE and Douyin Developer Tools, then uses Codex to refine its art and expand it into five chapters and 30 levels, with cat orders and collectible decorations. The guide covers AppID, debugging and phone previews, without formal publication.

The AI mini-game ecosystem is taking shape faster.
In early November, Kimi introduced a dedicated offering for the game industry, able to operate professional software such as Unity, Unreal Engine and Blender to help teams make playable prototypes.
A few days ago, Tencent's AI game-creation platform Youdianling launched a national AI game-creation competition with a prize pool of RMB 1 million.
A day later, ByteDance made its own move, officially connecting TRAE with Douyin mini-games.



It is easy to see that more people are making games with AI this year, with numbers growing on platforms including Steam and TapTap.
These players who want to make games themselves may be new users the big companies hope to attract. So I tried it too, making a matching mini-game called Kitty Convenience Store.
The game takes place in a convenience store run by cats. Tap snacks and drinks on the table and place three identical items into the shopping basket to clear them.



Coins earned by completing levels can buy decorations for the store. After several further rounds of changes, the game has 30 levels, and the cats have their own collection guide and favorite foods.
If you have a mini-game you want to make, try following the steps below. Later, I will also show how to continue improving the same game with other tools.
Step 1: download the software and install the plugins.

We need two applications on the computer: TRAE's China version and Douyin Developer Tools. Choose the installer matching your operating system.
TRAE helps write the game, while Douyin Developer Tools runs and debugs it. The latter includes a simulator for previewing how the game looks on a phone screen.
Next, open TRAE and search for Douyin in the plugin marketplace to find the two newly added plugins.

Install the Douyin Developer Tools plugin first, then return to the chat and enable it through the plugin selector. The other new plugin is Douyin Mini-Game Business Analytics, which can be installed as needed.
Step 2: apply for an AppID for your mini-game.
Open the Douyin mini-game developer platform and enter the console. I recommend scanning the registration QR code with your own Douyin account.

Individuals can register too. Follow the page prompts to select an individual developer identity and complete verification. Anyone preparing to create an independent game application must complete this step first.
Once registered, the console has entries for applications including mini-programs and mini-games. Choose mini-games, then click Create Mini-Game.
The page asks for the game name, development engine and contact information.

Kitty Convenience Store uses JavaScript and Canvas to draw its graphics, rather than a separate engine such as Unity or Cocos. When creating the application, choose the development option appropriate for this kind of native mini-game.
After creation, the dashboard also prompts you to add an icon, description and relevant qualifications. Fill these in as requested. This attempt only involves a development preview; it does not proceed through formal publication.

Once the application is created, click the new mini-game to enter its management page. Find and copy its AppID under Development Settings.
Think of it as the game's identity number on Douyin: it links the game files on your computer to the application you just created.
With the AppID ready, open the newly installed Douyin Developer Tools and sign in with an account that has development access to this mini-game.

When TRAE first calls the developer tools, the computer may display a client authorization request. Check that it identifies the TRAE instance you are using, then click Allow.
Step 3: tell TRAE what kind of game you want to make. First, think about the games you normally enjoy.
Kitty Convenience Store borrows the stacked matching-and-clearing gameplay of Catch the Goose: as items disappear from the table, it feels quite relaxing. I replaced them with convenience-store snacks and drinks, then designed orders for the cats visiting the shop.



Open TRAE and choose an empty folder as the working directory. Remember to enable the Douyin Developer Tools plugin you installed in the chat.
Writing a prompt does not require coding knowledge. The key is to explain clearly what a player will do in the game; you can plan everything before starting.
Remember to add your AppID before sending the prompt.

For the first version, make one complete level. Add more once it feels good to play.
In this attempt, TRAE first produced a three-level Kitty Convenience Store. The first version already included item matching, cat orders and power-ups, with graphics mainly drawn in code.
Although less polished than the version shown at the start, it already had a fairly complete flow for a mini-game intended to test the gameplay.



Step 4: play it on the computer first. Once the game is generated, tell TRAE in the chat to open the current mini-game project with Douyin Developer Tools, compile it and inspect the simulator display.
If this is the first connection between the applications, watch for the authorization request from the developer tools.
Once the game opens, do not rush to make the next one.
Play a round as a player would, and try operations you might otherwise overlook.

Some problems are not visible just by looking at the screen. During a later check, I found that rapidly tapping six identical items in succession could clear only three of them from the shopping basket.
When that happens, give AI the exact sequence of actions, let it reproduce and fix the issue, then test it again the same way.
Step 5: scan the code with your phone and try the game.

First handle account permissions. Even if the game runs correctly on the computer, a Douyin account on a phone cannot try it directly without test access.
Return to the Douyin open platform, enter the console and open your mini-game's details page.
Find Development Settings on the left and switch to Test Management; some interfaces call it Debug Management. Click Add Device at the upper right to display a QR code.

Open Douyin on the phone that will test the game, sign in to your account, scan this QR code and follow the prompts to join the test environment.
You can then confirm in the dashboard that the device was added successfully. Only after that do you generate the game's preview QR code.

Return to TRAE and type "Compile the current project and generate a preview QR code". AI can then call Douyin Developer Tools to perform the operation.
Scan the game's preview QR code with Douyin on your phone to enter the development-preview version. After changing game code or assets, remember to generate a new preview code and check the updated result.

Step 6: if the game is not good enough yet, switch to another agent to continue.
If you are familiar with Workbuddy, Codex or another local agent assistant, there is no need to remake the game.
The mini-game generated by TRAE is saved as project files on the computer, and Douyin Developer Tools also includes a built-in Skill.

Open Douyin Developer Tools, find the menu option for copying the Skill installation prompt, and send the copied content to your usual coding assistant.

The WeChat mini-game team also provides a similar official Skill. If you normally play more WeChat mini-games, you can try that toolkit too.

This time, I stayed with Douyin mini-games, switched to Codex, and continued improving the existing Kitty Convenience Store using the same Douyin Developer Tools.
The first thing I wanted to change was the graphics.
The first convenience-store version was already playable, but the products and cats were drawn in code and had relatively little detail.

I wanted a picture-book-style game, with individually drawn strawberry milk, cakes and cats, and even more appealing wooden store shelves.
Rather than asking Codex to change the interface immediately, I first had it generate a design mockup to preview the home screen, levels and gameplay interface.
After choosing a style I liked, I could have it make the assets, avoiding the discovery that I disliked the palette only after the whole game had been changed.

Once the mockup was approved, Codex used its built-in image-generation capability to create two scene backgrounds and transparent sprite sheets for products, cats and decorations.
For example, the image below contains 12 products. Each can be extracted separately and placed at different positions on the board. The cat shopkeeper also gained separate idle, waving and celebrating poses.
Art assets made this way can be embedded directly in the mini-game project.

The complete mockup is only a design reference. Buttons, scores, orders and characters are still controlled separately by the program.
When a player taps a product, the program can make its image fly into the shopping basket and play an animation after a match is cleared.
For assets requiring transparent backgrounds, such as characters and products, use PNG where possible. Store backgrounds can use JPEG. Then ask AI to compress the assets so the mini-game does not load too slowly.

The final game has five chapters, including Morning Grocery Store, Afternoon Bakery and Rainy-Day Coffee Corner, with six levels each. Chapters change the palette and product combinations, and introduce new cat customers.
Once the cat characters are in place, you can also add collection mechanics. I prepared six small pieces of furniture for the store. Purchased items are placed automatically, so the changes appear when you return to the home screen.
One interesting thing about making games is that something you find fun may feel completely different when someone else plays it.

Roblox has disclosed that creators of more than 80% of its top 100 games, ranked by hours played, already use AI during development.
One game made almost entirely with AI even entered the platform's top ten by concurrent players for a time.
As the barrier to making games falls, the number of games naturally grows.
ByteDance also happens to have Douyin, a platform with a large player audience. Creators now have both tools for making games and a channel through which players can discover them.
This article comes from the WeChat public account "Xiagu AI," by "Xiagu AI."
Related topics
After reading
Join the AINRK community
Read how to join the community and connect with people working in AI.




