← All episodes
What can you do with AI? · Episode 2

Artificial intelligence inside the app: free, on the phone, with no internet.

AstrArch

AstrArch

Space strategy · iOS and Android

AstrArch is a space strategy game for iOS and Android. The name joins "astro" and the Greek -arch, ruler: you are the sovereign of the stars. You lead your civilization across a galaxy of star systems, among rival empires, independent peoples, alliances, wars and mercenaries.

Compared with the first episode there are two new challenges: 3D scenes and above all artificial intelligence inside the app. As always the code was written by AI, in Kotlin Multiplatform; I acted as the director.

KMP iOS Android Apple Intelligence Gemini Nano

The LinkedIn post →

40star systems in the largest galaxy
11civilizations, each with its own leader
4different ways to win
100%dialogue AI on the phone
3D
First steps in 3D graphics
  • Star systems with planets orbiting their star, lit by its light
  • Planet surfaces generated in code: oceans, deserts, volcanoes, ice, gas giants
  • A living scene: rotate it, zoom it, tap a planet or a fleet and give orders
  • Native 3D engines on each platform, SceneKit on iPhone and Filament on Android, driven by one shared codebase
AI that decides
The other civilizations play on their own
  • Each rival civilization has a character: aggressive, diplomatic, mercantile, expansionist
  • It weighs strength and relations, expands, forms alliances, declares war, hires mercenaries
  • It requests an audience with the player when it has something to propose, or to complain about
  • An advisor analyses the game, learns from events and suggests what to do
AI that talks
On-device models
  • You talk to the leaders in natural language: ask the terms of an alliance, negotiate a ceasefire
  • The answers are written by the model already on the phone: Apple Intelligence on iPhone, Gemini Nano on Android
  • No cloud, no cost for players, no data leaving the device
  • It works even offline
The model talks, the game engine decides.

The AI understands what you ask and writes the reply in the leader's character, but agreements, wars and victories are settled by the game rules. So the game stays consistent even when the model gets a sentence wrong: replies that contradict the outcome are discarded and replaced with pre-written lines.

iPhone with Apple Intelligence
  • iPhone 15 Pro and 15 Pro Max
  • The whole iPhone 16 range, including 16e
  • The whole iPhone 17 range and iPhone Air
  • iOS 26 with Apple Intelligence turned on
Android with Gemini Nano
  • Google Pixel 9, 10 and 11
  • Samsung Galaxy S25 and S26, Galaxy Z Fold7 and Z Flip7 and later
  • Recent models from OnePlus, Xiaomi, OPPO, vivo, Honor, Motorola and others
  • Full, up-to-date list: Google ML Kit GenAI
Claude
Code, 3D and rules

All the Kotlin Multiplatform code: game engine, strategic AI, 3D scenes on SceneKit and Filament, galaxy map, the instructions for the on-device models, and the planet surfaces and galaxy animation generated in code.

Gemini
Faces and images

The portraits of the ten leaders and the advisor, the app icon and the banner of this episode.

Apple Intelligence
Dialogue on iPhone

Apple's Foundation Models writes the leaders' and the advisor's replies, directly on the phone.

Gemini Nano
Dialogue on Android

The same job on Android, through the ML Kit GenAI Prompt API, with Google's model built into the phone.