Original Age of Empires 2 dev talks about its usage of assembly code

Age of Empires II’s heavy use of hand‑written x86 assembly in its rendering core—reportedly yielding around a 10× speedup over C++ in 1999—serves as a springboard to revisit how game engines once relied on low‑level optimization for performance. Commenters contrast that era with modern compilers, SIMD intrinsics, specialized libraries, and hardware video decoding, noting where assembly still wins and where it has been made largely obsolete. Alongside technical war stories (from DirectDraw blitting to VTune tuning) runs a vein of nostalgia for 1990s game development culture, from Usenet and IRC exchanges to in‑person lunch conversations that shaped major titles.

Role of Assembly in AoE2 and 1990s Game Development

  • AoE2 reportedly gained ~10x faster sprite drawing by rewriting the drawing core in assembly.
  • In the late 90s it was common to write hot paths in assembly and keep the C/C++ version under #ifdef for portability.
  • Back then, some compilers—especially for SIMD—generated very inefficient code, making hand-tuned assembly clearly superior.
  • Today, commenters say compilers are much better; assembly wins mostly in narrow cases (manual vectorization, careful register use, exploiting domain-specific guarantees).

SIMD, Intrinsics, and Performance Tuning

  • Video decoding and similar workloads still use large amounts of assembly or SIMD intrinsics, with order-of-magnitude speedups reported.
  • Modern languages and runtimes expose explicit SIMD APIs because auto-vectorization is limited.
  • Tools mentioned: superoptimizers (e.g., one LLVM-based project), VTune, IACA, uiCA, llvm-mca. These help analyze pipelines, stalls, and scheduling.
  • Several anecdotes describe painstaking hand-optimization that ends up slower than compiler output, but also rare wins of 2–10x that justify the effort.

Graphics Pipelines: DirectDraw, Textures, and Formats

  • AoE2 likely used DirectX/DirectDraw for presenting pixels, with custom code for visibility, sprite transforms, mirroring, stippling, etc.
  • DirectDraw offered hardware-accelerated blits in simple cases, but with spotty driver support and overhead for small sprites.
  • Discussion touches on cache-friendly texture layouts (block/textured “swizzling”), mipmapping, and classic demoscene resources on roto-zoomers.
  • One commenter notes naive SLP sprite rendering is very slow, so AoE2’s optimizations make sense.

Codebases, Toolchains, and Security

  • Historical note: a major Pascal/Delphi compiler was said to be mostly assembly, later rewritten because it became unmaintainable.
  • AoE2: Definitive Edition reportedly ships with an executable packer that decrypts code at runtime, leaving pages RWX, which is criticized as insecure.

Patching Philosophy and Modern Game Updates

  • Older dev culture reportedly viewed needing a patch as a failure; patches were rare and distributed via magazines.
  • This is contrasted with modern large rebalancing patches (tens of GB), though some argue online games and evolving balance justify ongoing updates.

Community, Communication, and Nostalgia

  • Debate over whether in-person lunches produced better technical cross-pollination than today’s Discord/Slack/IRC.
  • Some see modern online communication as vastly richer; others lament fragmentation, lack of public indexing, and shallow chat dynamics.
  • Thread also notes AoE2’s active competitive scene, LAN tournaments, and strong nostalgia for both the game and 90s dev culture.