Urgent.News

What's breaking now, across thousands of outlets.

Tech

How to run a city builder on 16 MHz

In the early days of computing, city building games like SimCity ran perfectly on CPUs with a meager 16 MHz clock speed. This may seem impossible to modern gamers who expect high performance from their hardware, but the secret lies in clever optimizations. The core of SimCity's simulation is the Simulate() function found in the s_sim.c source file.

This function handles all the simulation tasks like traffic, fire, power, and crime. Rather than running every update every frame, the game intelligently skips most of the simulation, calling certain update functions only at specific intervals. This is achieved by using a mod16 parameter that loops through values 0 to 15, determining which parts of the simulation run in each frame.

This optimization drastically increases the speed of the simulation without sacrificing much in terms of gameplay. The same principle of distributing work across multiple frames extends to other areas of game development, such as rendering. Assetto Corsa, for example, updates only a few cubemap faces per frame depending on the reflection quality setting.

By recognizing which parts of a program's work can be spread out over time, developers can achieve impressive performance on even the most limited hardware.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at larstofus.com →

More in Tech

The Boox Palma 2 Pro finally got me to stop reading on my phone

The $400 Boox Palma 2 Pro is a smartphone-sized e-reader designed for people who want to read books, articles, and documents on a small E Ink display.

  • Boox Palma 2 Pro costs $400, offering smartphone-sized e-ink display
  • Front-lit screen allows reading in complete darkness without eye strain
  • Device supports Google Play apps, providing diverse reading, research, and productivity options

More from Saturday 24 October →