Age of Empires on Android (GameNative)
Play Age of Empires IV and Age of Empires II: Definitive Edition on an Android handheld with
GameNative. Both games need the patched CPU emulator (FEX) package
from this repo: without it AoE IV’s copy protection freezes the game within minutes, and AoE II DE does not start at
all. AoE IV also gets a patched graphics driver and three settings from here, together more than +40 % FPS over
the drivers in circulation.
|
Age of Empires IV |
Age of Empires II: DE |
| Plays |
A full 51-minute game against one A.I., to victory |
A 3-player skirmish against two Hardest A.I.s, 17 minutes |
| Speed |
58 to 60 FPS in the first minutes of a 1v1, about 47 FPS in the late-game benchmark |
60 FPS in that skirmish (the game’s own cap) |
| Controls |
The Thor’s controller, with the game’s own controller UI |
Touch screen as a touchpad, or a mouse |

Status
|
|
| Tested device |
AYN Thor (Snapdragon 8 Gen 2, Adreno 740, 16 GB RAM, Android 13), GameNative 1.2.1 |
| Age of Empires IV |
Anniversary Edition (Steam), build 16.3.11308. Main menu, tutorial, skirmish vs the A.I., a full 51-minute game to victory. The benchmarks below are automated and repeatable |
| Age of Empires II: DE |
Steam, build 101.103.54800.0, three civilization DLCs, no Enhanced Graphics Pack. Main menu, skirmish vs the A.I. |
| Not tested |
Multiplayer, the campaigns, other devices, GameNative 1.3.0. The full AoE IV game was played before the repo’s driver and the vkd3d-proton setting existed |
What you need
- An Android device with a Snapdragon / Adreno GPU and GameNative 1.2.1. Only the AYN Thor was tested; other
Snapdragon 8 Gen 2 devices are the most likely to work.
- The game on Steam, installed through GameNative.
- From the latest release:
fexcore-aoe4-perf7.wcp (900 KB), the patched FEX for AoE IV (v1.6.0, with patch 0017). For AoE II DE use
fexcore-aoe4-perf5.wcp from the same release: that is the package tested with AoE II.
- For AoE IV:
turnip-main-c78a9e9-ubwc.zip (2.7 MB), Mesa’s Turnip driver built from its 2026-10-08 main branch
with one patch (v1.5.0; GPU-DRIVER.md, UBWC.md).
Setup
1. Install the package and the driver
- Download
fexcore-aoe4-perf7.wcp
(AoE IV), fexcore-aoe4-perf5.wcp
(AoE II DE) and, for AoE IV, turnip-main-c78a9e9-ubwc.zip
on the device; they land in the Download folder.
- In GameNative: Menu → Settings → Contents Manager → Import .wcp from device, and pick the
.wcp.
They show up under the FEXCore type as aoe4-perf7 (32) and aoe4-perf5 (23).
- For AoE IV: Menu → Settings → Driver Manager → Import ZIP from device, and pick the driver zip.
2. Age of Empires IV: the container
Open the game in GameNative, tap the cog next to Play, then Edit container. Set:
| Tab |
Setting |
Value |
| General |
Container Variant |
bionic |
| General |
Wine Version |
proton-11.0-99-arm64ec-1 (see the note below) |
| General |
Executable Path |
RelicCardinal.exe |
| Graphics |
Graphics Driver / Version |
Wrapper / turnip-main-c78a9e9-ubwc |
| Graphics |
DX Wrapper |
VKD3D |
| Emulation |
64-bit Emulator |
FEXCore |
| Emulation |
FEXCore Version |
aoe4-perf7-32 |
| Environment |
add WINEDEBUG |
-all |
| Environment |
add FEX_EXP_SKIP_CALLRET_RESET |
1 |
| Environment |
add VKD3D_CONFIG |
no_staggered_submit |
| Environment |
add TU_UBWC_RGBA8_IGNORE_R32 |
1 |
| Environment |
add TU_UBWC_RGBA16F_INT |
1 |
| Environment |
add DXVK_CONFIG |
dxgi.customVendorId=1002 |
Then tap Save (top right). What the variables do: WINEDEBUG=-all stops Wine’s debug output even when
GameNative’s Wine debug setting is on; FEX_EXP_SKIP_CALLRET_RESET=1 turns on patch 0009 (on 2026-10-07, before the
later speed patches, it took a match from 8 to 23 to 30 FPS); VKD3D_CONFIG=no_staggered_submit stops vkd3d-proton
from holding each GPU submission until the previous one finished (+12 % FPS,
VKD3D-SUBMIT.md); the two TU_UBWC_ variables let the patched driver keep its
framebuffer compression on the game’s largest colour images (+1.5 FPS (+2.6 %), UBWC.md);
DXVK_CONFIG=dxgi.customVendorId=1002 makes the graphics adapter report AMD’s vendor ID, so the game reads a driver
version through AMD’s library and Proton’s ADL and stops showing its “unable to determine your video card’s installed
driver version” dialog (no FPS change, DRIVER-CHECK.md).
Why each setting: TUNING.md.
The screenshots are from v1.2.0 to v1.4.0: select aoe4-perf7-32, the driver turnip-main-c78a9e9-ubwc and add the two
TU_UBWC_ variables.
About the Wine version: the tested one is listed on the Thor as proton-11.0-99-arm64ec-1. It came from a
manual import, and research says it is the same build as GameNative’s official proton-11.0-1-arm64ec
(WINE-SOURCE.md). The official one was not run here; if you try it, please report back.
3. Age of Empires II: DE: the container
GameNative fills in a “known config” for this game. Keep its graphics settings (on the Thor Wrapper,
turnip_v26.0.0_R6, DXVK; for other GPUs see the note below) and change:
| Tab |
Setting |
Value |
| General |
Wine Version |
proton-11.0-1-arm64ec-1 (not 11.0-2; see the note below) |
| General |
Exec Arguments |
SKIPINTRO |
| Emulation |
FEXCore Version |
aoe4-perf5-23 |
| Environment |
add FEX_TSOENABLED |
0 (about 30 % more FPS in big battles; remove it if the game crashes) |
| Environment |
add FEX_EXP_SKIP_CALLRET_RESET |
1 |
| Environment |
add WINEDEBUG |
-all |
Then install the game’s own VC++ 2022 runtime into the container: run VC_redist.x64.exe and VC_redist.x86.exe
from _CommonRedist\vcredist\2022\ in the game folder. GameNative installs the runtimes 2005 to 2019 from that
folder, but not 2022. The tested setup had it, and a user reports that newer GameNative versions need it too.
- Wine version: the Thor ran
proton-11.0-99-arm64ec-1, a manual import that research says is the same build
as GameNative’s official proton-11.0-1-arm64ec-1 (WINE-SOURCE.md).
proton-11.0-2-arm64ec-1 was not tested; one report of a game stuck at the splash screen used it (with the
GameNative 1.3.0 test release).
- Other GPUs:
turnip_v26.0.0_R6 was tested only on the Thor’s Adreno 740. A user on a Galaxy S25 (Snapdragon
8 Elite) runs the game with the driver Turnip gen8 v30. On other GPUs, use the driver GameNative recommends for
yours.
- White flashing: if frames often come out almost white, change the environment variable
TU_DEBUG from
noconform (GameNative’s default) to noconform,noubwc. A user on an Honor Magic V2 (Adreno 740) fixed it this
way. noubwc turns off the driver’s framebuffer compression (UBWC). The Thor never showed the flashing, and which
driver the user had is not known.
- FEXCore preset: with
FEX_TSOENABLED=0 set, the preset makes little difference. GameNative applies the
container’s environment after the preset, so the variable wins, and FEX then turns its vector and memcpy TSO
options off too. What is left between the presets is x87 reduced precision (on from INTERMEDIATE up), which a
64-bit game seldom uses, multiblock (off only in STABILITY), and two more options in EXTREME. Read in the source
(GameNative’s FEXCorePresetManager, FEX 7d3090f), not measured.
- Box64 preset: FEXCore runs this 64-bit game with the ARM64EC Wine build, so the Box64 preset should not
affect it (not measured).
A user’s tuned setup (faster loading, a steady 40 FPS with a 40 FPS cap) is in
AOE2-DE.md, with the other details.
An optional AoE II test prerelease
adds the reviewed volatile-code changes from PR #36.
It includes a runtime variant without the optional logger and a research variant for diagnostics.
Host checks pass; Android game testing remains pending.
Use the comparison protocol before replacing a setup that works.
4. Device settings
- Display at 120 Hz (the Thor’s refresh-rate tile), set before the game starts. At 60 Hz a frame that misses
a refresh waits a whole extra 16.7 ms.
- AoE IV controller: in the game, Settings → Controls → input Gamepad. The game closes itself once after
that switch; start it again. The Thor’s controller works in its standard mode, with no remapping.
- Power: GameNative’s Power Control sets the CPU and GPU limits for the container at every start. The CPU needs
its full clocks (capped at about 2 GHz the late game ran at 27.8 FPS instead of 36), and the GPU held at its top
level gave about 2 FPS more in the late game. TUNING.md has the values.
5. Play
Tap Play. The first start takes a few minutes. In AoE IV a press of the A button skips each intro film and the title
screen.
What to expect
Age of Empires IV

One bar per frame (higher is slower), the same 60 s of the automated skirmish at each step: the protection fixes
alone, the speed patches with the Turnip v26.2.0 R4 driver, the repo’s Turnip driver, the vkd3d-proton setting, and
patch 0017. The whole path is in STORY.md.
The benchmark is an automated 1v1 skirmish in which the player does nothing and the camera turns: 90 s windows at
minutes 1 and 3, the game’s frame times read from Android’s compositor, display at 120 Hz
(TESTING.md).
| Setup |
FPS (two match minutes) |
median frame |
frames over 50 ms |
| Protection fixes only (2026-10-07, 60 Hz display; minutes 1 / 5) |
26.7 / 26.6 |
33.4 ms |
721 / 734 |
| The package, Turnip v26.2.0 R4 (v1.0.0 to v1.2.0, a hot Thor; minutes 1 / 5) |
42.1 / 42.1 |
25.3 ms |
2 / 2 |
| + the repo’s Turnip driver (v1.3.0) |
52.3 / 52.3 |
16.9 ms |
4 / 5 |
+ VKD3D_CONFIG=no_staggered_submit |
58.6 / 58.1 |
16.9 ms |
9 / 16 |
Patch 0017 (v1.4.0, the setup above) was measured against the previous package in the same session, after a change to
the benchmark’s thermal sampler: 58.3 / 57.8 FPS against 56.4 / 56.3 before and 56.6 / 56.5 after, and about a
fifth fewer frames of 25 ms (813 / 825 against 999 to 1,039 per window). Frames over 40 ms stayed within their spread.
The previous setup read 58.6 the day before and 56.4 in that session, so compare these numbers only with each other
(TRAPLESS-FAULTS.md).
The v1.5.0 driver with its two TU_UBWC_ variables, against the v1.3.0 driver, run alternately on 2026-10-09
(GameNative 1.3.0 test release, minute 1): 58.1 / 58.6 FPS without them, 60.1 / 59.6 with them, +1.5 FPS (+2.6 %)
(UBWC.md).
A real game is heavier than the idle benchmark. The late-game benchmark is the replay of a full 51-minute game
against one A.I., a 90 s window at minute 48 with the player’s own camera, the CPU at full clocks:
| Setup |
FPS at minute 48 |
frames over 50 ms |
| v1.2.0, Turnip v26.2.0 R4, GPU held at 680 MHz |
38.6 |
22 |
| v1.3.0, the repo’s Turnip driver |
46.1 |
15 |
+ VKD3D_CONFIG=no_staggered_submit (two runs) |
47.3 and 48.5 (47.0 at minute 46) |
86 and 57 (79 at minute 46) |
In the late game the variable gains little and makes the frame times uneven: about 60 to 90 frames of 50 ms or more
per 90 s window against 15 without it (VKD3D-SUBMIT.md). The late game was not
measured with patch 0017.
During that game, played before the repo’s driver existed, GameNative’s FPS counter read high 20s to low 30s, and
about 24 in the big late-game battles. The CPU runs hot in long sessions: the hottest CPU sensor read about 95 °C
during the tests, the GPU about 80 °C.
Age of Empires II: DE
| Situation |
FPS |
frames over 50 ms |
| 3-player skirmish (two Hardest A.I.s, Fast speed, map visible), 7 × 60 s over 17 minutes |
59.3 to 60.0 |
0 to 2 per window |
| Same game, camera on an A.I. base in the Imperial Age |
59.9 |
1 |
| The game’s Ranked Benchmark Test (8 players, big battles), battle part |
27 to 30 |
many; score 1114.8 |
The game did not go above 60 FPS, although the display ran at 120 Hz and the game’s own limit was 120. In the
benchmark the game’s main thread used 95 % of one core: the emulated CPU work limits it, not the GPU.
Known issues
Age of Empires IV
- Sometimes it stops while loading with “Failed to wait for DX12 fence (error 102)” in its log (several times on
2026-10-08, on every driver). Start it again; the next start worked each time.
- Do not stay long in GameNative’s Quick Menu during a match. It pauses the game; after a 24 s pause the game
exited once (a 9 s pause was fine).
- The “unable to determine your video card’s installed driver version” dialog is gone with
DXVK_CONFIG=dxgi.customVendorId=1002 (v1.6.0, DRIVER-CHECK.md). Without it
the game shows it at most once a day, and both buttons do the same; GameNative’s touch input did not reach them in
our tests, and the repo’s helper tools/probes/dlgclick clicks it from adb.
- Deleting a driver can switch the game to another one. GameNative’s Driver Manager resets every container whose
driver name contains the deleted name to its default driver: deleting the old
turnip-main-c78a9e9 also reset a
container on turnip-main-c78a9e9-ubwc (2026-10-12; AdrenotoolsManager.reloadContainers compares with
contains). The game then ran at about 50 FPS with the GPU busy 70 %. After deleting drivers, check the
container’s Graphics Driver Version.
- GameNative’s “Save Conflict” dialog asks which save to keep when the local and the cloud save both changed.
Pick the one from where you played last.
- Other graphics drivers: StevenMXZ’s Turnip v26.2.0 R4 and v26.3.0-R6 run the game at 41 FPS, purple-turnip
T30 about 2.5 FPS slower; Balemuni Apex v2 crashes the game after about two minutes
(TUNING.md, “Graphics drivers compared”).
- The game needs AVX. FEX provides it; hiding it makes the game refuse to start.
- Display mode: the option stored as
windowmode 1 gave a black screen; borderless works.
- End screen “Retrieving…”: after the 51-minute game the result panel said “Waiting to retrieve match results
from the server” for minutes. The game was not frozen, and the match then appeared in Match History.
Age of Empires II: DE
- The controller does nothing in the menus, and GameNative’s touch screen moves the cursor like a touchpad.
- A window frame: from the second start on, the game showed in a window with a title bar at 1272 × 694; the
first start was full screen. Not resolved.
- About every 5 minutes a frame of about 0.8 s, likely the game’s single-player autosave.
- Almost white frames (a user report, not seen on the Thor):
TU_DEBUG=noconform,noubwc fixed them, see
section 3.
How it works
Both games are Windows x86-64 programs. GameNative runs them with Wine (Windows compatibility), FEX (translates
x86 code to ARM on the fly), vkd3d-proton or DXVK (Direct3D on Vulkan) and a Turnip Vulkan driver for the
Adreno GPU. The patches change only the emulator, so it behaves more like Windows; the games and their protections
are not modified.
Age of Empires IV ships with Relic’s anti-tamper protection, Aegis. On a real PC it is invisible, but under
the emulator three things went wrong:
- A start-up check failed. The protection checks that Windows functions are not hooked. Wine’s ARM64EC
build lays out some function stubs (
jmp [addr], FF 25) in a way that looked like a hook, and the protection
stopped the game 2 to 3 minutes after the start. Patch 0007 rewrites those stubs into a form the check
accepts. (HOOK-CHECK.md)
- A watchdog fired. One protection thread runs a loop that must keep up with a time budget, and it raises
thousands of exceptions per second. Each exception cost about 111 to 130 µs under Wine (a round trip to the
wineserver), the loop fell behind, and 8 to 13 minutes in the protection froze the game. Patch 0010 lets
FEX resume from an exception directly: 2.5 µs. (WATCHDOG.md)
- It was slow. The protection runs some code one instruction at a time from a 16 MB scratch buffer. For FEX
every step was new code: a fault, a cache flush and a recompile, about 16,000 times per second, 44 % of the
game’s main thread. Patches 0012 to 0014 recognise that buffer and reuse translations instead of
recompiling: 26.7 → 43.7 FPS with 0012 and 0013; 0014 removed the periodic full recompile.
(INSTRUCTION-STEPPER.md)
Patch 0016 (v1.2.0) answers the game’s CPU-speed question from a short cache. The game asks for the MHz of every
core about 45 times per second, and Wine read two files per core for each answer: 11 % of the main thread in the
late game. (POWER-INFORMATION.md)
Patch 0017 (v1.4.0) delivers the protection’s exceptions without a host trap. The protection raises about 44,000
illegal-instruction exceptions per second; FEX turned each one into a host trap, Wine’s signal handler and two passes
through the exception dispatcher. FEX now raises the guest exception directly: about +1.5 FPS and a fifth fewer 25 ms
frames in the benchmark. (TRAPLESS-FAULTS.md)
The graphics driver (v1.3.0) is Mesa’s Turnip built from its 2026-10-08 main branch. The Turnip builds in
circulation waited for the GPU on every submit because of a kernel-driver quirk (fixed in Mesa that day), so the
game’s render thread spent about 10 ms per frame waiting: 41 → 52 FPS. (GPU-DRIVER.md)
The vkd3d-proton setting. GPU traces then showed the GPU working only 37 % of the time. Turnip offers one Vulkan
queue, so the game’s graphics, compute and copy queues all share it, and vkd3d-proton 2.14.1 then resolves fence
waits on the CPU and keeps one command buffer in flight per queue. VKD3D_CONFIG=no_staggered_submit turns that
off: 52 → 58 FPS. (VKD3D-SUBMIT.md)
Colour compression (v1.5.0). The GPU is now the limit, and memory traffic is a large part of its work.
vkd3d-proton gives the game’s typeless render targets a format list that the A740 driver cannot compress, so they had
no UBWC. A driver patch keeps UBWC for the two cases the game uses safely, behind two variables: +1.5 FPS (+2.6 %).
(UBWC.md)
Age of Empires II: DE (protected with Arxan) crashed about 1 s after the start with GameNative’s own FEX 2512,
inside code it decrypts at run time. Every FEX build from this repo fixes it. Plain upstream FEX-2610 gets past that
crash but exits before the menu, so this repo’s patches are still needed; which one was not narrowed down.
(AOE2-DE.md)
All patches in the package
All against FEX 7d3090f, in this order (patches/fex):
| Patch |
What it does |
| 0004 |
Reports the game’s own memory protection back to it, while FEX keeps its write traps |
| 0006 |
A raw x64 syscall returns registers like Windows does |
| 0007 |
Rewrites Wine’s FF 25 export stubs, in every process that runs x64 code, so the protection’s hook check passes |
| 0009 |
Skips a costly per-fault reset (on only with FEX_EXP_SKIP_CALLRET_RESET=1; 8 → 23 to 30 FPS on 2026-10-07, before 0012 to 0014) |
| 0010 |
Resumes x64 code after an exception without a wineserver round trip |
| 0012 |
Handles the protection’s one-instruction-at-a-time buffer without faults and recompiles |
| 0013 |
Larger code buffer (512 MB), so FEX clears its whole cache less often |
| 0014 |
Reuses compiled code when the protection decrypts the same code again |
| 0015 |
Fixes a FEX bug: a 32-bit value was loaded as 64 bits |
| 0016 |
Answers the game’s per-frame CPU-speed query from a 250 ms cache (v1.2.0) |
| 0017 |
Delivers the protection’s illegal-instruction exceptions (about 44,000 per second) without a host trap (v1.4.0) |
The package’s DLL is libarm64ecfex.dll, SHA-1 091ad9ef in aoe4-perf7 (v1.6.0; 7e707379 in aoe4-perf6 of v1.4.0 and
v1.5.0, whose 0017 reported execute faults as illegal instructions; b5e6e357 in aoe4-perf5, which stops at 0016). Since v1.1.0 the package leaves out patch 0002, which hid
FEX’s name from the game: the game runs the same without it. To build it yourself:
BUILDING.md and tools/make_fex_wcp.py. The driver:
tools/build_turnip.sh.
For contributors: testing without touching the device
The speed work was measured from a Mac over adb: tools/bench.py starts AoE IV, skips the
intros, starts a skirmish with the camera turning (controller input written to the Thor’s input device) and records
frame times from Android’s compositor, with temperatures; tools/replay.py does the late-game
window on a replay; tools/fpsgraph.py shows a live frame-time graph in a browser;
tools/agent.py reads memory and threads inside the game without console windows; the
tools/research/turnip_*.py scripts read the GPU traces. See TESTING.md.
Upstream
The fixes that belong in FEX or Wine were reported there on 2026-10-08: FEX pull request
#6021 (patch 0015, merged 2026-10-12, not yet in a FEX release) and
issues #6022 and
#6023; Wine bugs 60461,
60462 and 60463.
Patch 0017’s trap-less part followed on 2026-10-12 as pull request
#6034. Which patch is which: patches/fex.
The driver’s gain comes from Mesa merge request
!44838, already upstream.
The whole story
Getting here took about three days: what AoE IV’s protection checks, what was ruled out, and every measurement.
docs/STORY.md tells it in order, with the FPS of every step; CHANGELOG.md lists
the releases and their files. docs/README.md is the index of all the docs.
| Folder |
What is in it |
docs/how-it-works/ |
One page per fix: the problem, how it was found, the fix and its numbers |
docs/guides/ |
Settings, testing over adb, building the package and the driver, driving GameNative, AoE II DE |
docs/research/ |
Every measurement in date order, the working log, the experiment ledger, upstream reports, and the archived investigation notes |
patches/fex/ |
The FEX patches in the package |
patches/experiments/ |
Earlier Box64, Wine and GameNative patches that are not needed |
tools/ |
Test, install and build scripts (list); the Windows probes in tools/probes; one-off analysis scripts in tools/research |
The package and the driver are on the releases page.
This repo was called aoe4-gamenative until 2026-10-08; old links redirect here.
Credits and license
Built on GameNative, FEX-Emu,
Wine and Valve’s Proton (via GameNative/proton-wine),
vkd3d-proton and Mesa’s Turnip driver.
Tools and scripts are MIT (see LICENSE). Patches follow their project: FEX MIT, Box64 MIT, Wine
LGPL-2.1-or-later, GameNative GPL-3.0. You need your own copy of the game.
Age of Empires is a trademark of Microsoft. Not affiliated with Microsoft, Relic, World’s Edge, AYN or GameNative.
评论