Game Development 15 min read

Design and Implementation of Taobao Dou Dizhu Endgame Mode

The article describes the design and implementation of Taobao Dou Dizhu’s new single‑player endgame mode, which generates daily unique puzzles with a guaranteed single solution, manages activity triggers, Redis caching, AI interaction, fault tolerance, consistency, and reward idempotency, boosting user retention during promotions.

DaTaobao Tech
DaTaobao Tech
DaTaobao Tech
Design and Implementation of Taobao Dou Dizhu Endgame Mode

Taobao Dou Dizhu, a self‑developed card game on the Taobao platform, introduced a new "endgame" (残局) mode to increase user engagement and game time. This article details the end‑to‑end design and implementation of that mode.

The endgame mode differs from the classic mode: it is a single‑player match against AI, shows both players' hands, and guarantees a unique winning path for the player. The system must generate daily unique puzzles, ensure only one solution exists, and avoid duplicate puzzles within a 30‑day window.

System workflow includes activity trigger, daily puzzle acquisition, player‑AI match, and settlement with reward distribution. Activity triggers are controlled by two feature flags (global and new‑user) and consider user fatigue.

Technical modules :

Activity logic – validates user eligibility and presents the endgame UI.

Puzzle generation – uses a bloom‑filter‑like partitioning (31 daily buckets) to avoid repeats.

Cache design – two Redis caches store the ten‑day puzzle set and the current puzzle state, with versioning to handle concurrent updates.

AI interaction – HTTP requests replace socket pushes; AI response time is limited to 1‑5 seconds.

Fault tolerance – multi‑layer backup (graph‑DB lookup, internal fallback algorithm, and finally a “give‑points” fallback) plus monitoring and alerting for latency and error rates.

Consistency handling – versioned updates, order fields, and MQ‑based retry for cache writes.

Reward idempotency – ensures users receive a single reward per completed puzzle.

Additional considerations include handling network failures on the client side, ensuring cache consistency across two Redis entries, and logging detailed game data for downstream analysis of difficulty and distribution strategies.

The implementation achieved higher user retention during the Double‑Eleven promotion, with positive feedback on the challenging yet rewarding puzzle experience.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backend ArchitectureAIcachingfault tolerance
DaTaobao Tech
Written by

DaTaobao Tech

Official account of DaTaobao Technology

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.