AutoChess Game
- Utilità
-
Yu Zhang
I am a senior practitioner in Fintech industry.
And I have done a lot of academic research on financial markets.
From 2012, I work as a Quant.
Forex, stock and futures are my main trading varieties.
I can use MQL4, MQL5, C++, MySql, and Python. - Versione: 1.0
- Attivazioni: 20
This AutoChess sandbox game is a standalone 3D animated strategy game developed entirely in MQL5. Below is the comprehensive guide to game rules, input parameters, core mechanics, and operations.
⚙️ System Input Parameters
When loading the script in MT5, you can configure the following options in the "Inputs" panel:
| Parameter Name | Default | Description & Details | | :--- | :---: | :--- | | Language | LANG_ENG | Language Option. Choose between "English (LANG_ENG)" or "Chinese (LANG_CHN)". Default is English. | | BattleSpeed | 3 | Battle Speed Multiplier. Adjusts the gameplay, animation, and movement speed during the auto-battle phase (1x to 5x, default 3). | | MaxShopLevel | 20 | Max Shop Level Limit. The maximum level the shop can reach. Unit count deployed on the board cannot exceed this level. | | CombineCount | 3 | Upgrade Materials Cost. The number of identical同名 units required to upgrade to the next star level (default 3 for "3-in-1"). | | MaxHeroStar | 10 | Max Hero Star Limit. Limits the maximum star level a hero can achieve. Ultimate scaling increases infinitely based on star level. | | WinExpBonus | 2 | Victory Exp Bonus. Extra experience points gained for the player's level upon winning a combat round (default 2). | | LadderPlayerCount | 100 | Total Ladder Players. The number of simulated AI contestants in the background survival process (default 100). | | UIScale | 60 | UI Cell Scale. Pixel size of the board and shop cards (supports 50 to 80 pixels adaptive scaling, default 60). |
🎮 Core Gameplay & Rules
1. Game Phase Loop
The game loops continuously between two core phases. Upon game failure (HP drops to 0), the script does NOT automatically uninstall, allowing players to view rankings and synergies until manually uninstalled:
- Preparation Phase (Prepare Phase): Players can buy units from the shop, rearrange unit positions, deploy/retract units, manage inventory, and equip or unequip items.
- Combat Phase (Battle Phase): Triggered by clicking "Start Battle". Allied units automatically seek, move to, and attack enemy monsters in real-time according to their ranges.
2. Population & Shop Level Separation
This game implements a separate Shop Level and Player Level mechanic:
- Shop Level: Dictates the probability of rolling higher-tier (quality) heroes in the shop. Shop level is upgraded exclusively by clicking the "Buy Exp (4g)" button at the cost of 4g gold.
- Player Level & Exp: Restricts the maximum number of deployed units on the board (Max Units = Player Level). Player level increases automatically each round and gains additional exp via WinExpBonus on victories.
3. Star Upgrades & Item Protection
- Star Upgrade: When identical units of the same star level on the board/bench reach the CombineCount , they automatically synthesize into a higher-tier unit (up to MaxHeroStar stars).
- Item Protection: When units are consumed during star upgrades, all equipped items on them are automatically unequipped and returned to the inventory, ensuring zero item loss.
4. Inventory System & Selling Items
- Inventory Capacity: Features a 12-slot inventory system.
- Equip & Unequip:
- Select an item in the inventory, then click a friendly hero on the board to equip it. Each hero has 3 item slots.
- Select a hero, then click "Unequip" to return all their items back to the inventory without any loss.
- Real-time Item Preview: Clicking any item in the inventory displays its detailed status, stats, and effects (e.g., Greatsword shows "+25 Attack/AP") at the top HUD.
- Sell Items: Selecting an item activates the red "Sell(2g)" button. Clicking it sells the item instantly for 2g gold.
5. 100-Player Survival Ladder Simulation
- Simulates up to 100 AI players in the background.
- At the end of each round, AI contestants lose HP based on background battle results, updated in real-time using a bubble-sort algorithm.
- The scoreboard on the right displays the top 8 surviving players and their current HP.
6. Dynamic Ultimate Growth Popup
- Select any hero and click "Ult Details" to display their skill growth.
- The pop-up height and lines adapt dynamically based on the MaxHeroStar parameter, showcasing values from 1-Star (Base) to MaxHeroStar-Star (Max).
- The popup highlights the hero's current star level in green while rendering other levels in muted gray. Click the popup background to close.
7. Bilingual Internationalization (Localization)
- Fully supports English and Chinese. Toggle the Language parameter (default LANG_ENG for English, or LANG_CHN for Chinese) to change the entire UI.
- All buttons, popups, floaters, floating combat text, shop slots, and system prints dynamically translate in real-time.
🧬 Hero Codex & Ultimates
Each hero has unique synergies (Race & Class) and a scaling ultimate ability:
- 🪓 Axe (Orc / Warrior)
- Ultimate: Culling Blade —— Deals physical damage to the target. Instantly executes the target if their HP is below the threshold.
- 🏹 Drow Ranger (Demon / Hunter)
- Ultimate: Freezing Arrow Rain —— Fires frozen arrows over an area, dealing physical damage and freezing targets.
- ⚔️ Juggernaut (Orc / Warrior)
- Ultimate: Omnislash —— Becomes invulnerable, slicing random enemies on the board multiple times.
- ❄️ Crystal Maiden (Human / Mage)
- Ultimate: Freezing Field —— Blasts the entire screen with an icy explosion, dealing damage and freezing all enemies.
- 🐺 Lycan (Beast / Warrior)
- Ultimate: Shapeshift —— Restores full HP and transforms into a wolf, scaling up AP/Attack multiplier significantly.
- 😈 Shadow Fiend (Demon / Mage)
- Ultimate: Requiem of Souls —— Explodes the area within 2 cells, dealing high dark magic damage.
- 🚢 Kunkka (Human / Warrior)
- Ultimate: Ghostship —— Summons a ghostship, dealing magic damage and stunning enemies within 2 cells.
- 🔥 Doom (Demon / Warrior)
- Ultimate: Doom —— Curses a single target, silences, and stuns it while dealing high damage over time.
- 🐙 Tidehunter (Element / Warrior)
- Ultimate: Ravage —— Slams the ground, knocking up and stunning all enemies on the board while dealing moderate pierce damage.
- 🌀 Enigma (Element / Mage)
- Ultimate: Midnight Pulse —— Summons a void void, dealing pure damage based on targets' max HP ratio.
Have fun in the MQL5 AutoChess sandbox!

