Sunday, May 30, 2021

Testing a new desktop’s computational power with a video game

With each passing year, we depend more and more upon computational simulations for our research work at PVL. Recently, we decided to acquire a new workstation to increase our capacity. This week, Charissa Campbell writes about her efforts to test-drive the new machine using a piece of software that would challenge its simulation capabilities: the video game Stellaris.

by Charissa Campbell

Now that I am fully back to work, several projects have come up that may test the capabilities of the current laptop that I’m using. To help,  I was able to request a PC desktop with lots of processing powers that should be able to handle anything. As a grad student, money is tight in most situations so getting a brand new piece of hardware is a luxury. I was quite excited to see how well this computer performed and decided to look into a suitable test.

My partner and I have had our gaming computers for several years so they are getting on the slower side. We had the idea to test a specific game with the new desktop that is notorious for being slow to run on average gaming PCs because of the nature of the game. The chosen game, Stellaris, is a 4X RTS (Real Time Strategy) grand strategy game where you guide your customizable civilization in a randomized galaxy. It is also notorious for creating a universe so populated it slows to a crawl on the old hardware when nearing the end of the game due to the heavy CPU load.

Stellaris is set in a galaxy that is populated with hundreds of star systems with their own planets. Each empire has a unique species and has a randomly placed starting star system where the goal is to explore the nearby cosmos. You are free to expand your empire while also researching new technology or ancient alien artifacts. This also includes colonizing any habitable planets you come across, assuming you get there first. You can make new friends or enemies across the galaxy with the ultimate goal of surviving an extra-galactic invasion that happens near the end of the game.

To play the game, you can choose and/or design any type of civilization with whatever traits you’d like. Species range from humans to plants to robots and more. You can customize even further by choosing specific traits such as Adaptive (habitability +10%), Strong (army damage + 20%, worker output +5%), Industrious (minerals +15%), and many more. Certain traits can be useful depending on how you want to play the game: do you want to explore, complete science objectives or try taking over the entire galaxy?

At the beginning of the game, each empire has one planet with a handful of "Pops," the unit of people. Over time, as each empire expands, more and more people populate habitable planets and eventually space-borne habitats and ring-worlds. Each Pop is assigned a job based on planetary building to produce the resources needed for their empire. Each job output is affected by a multitude of modifiers from either the job type itself or the Pop working it. Since each modifier needs to be checked first before it can calculate the actual output, it means that there are a lot of calculations going on behind the scenes every month in game. Since these calculations need to be done for each individual Pop, the time it takes the computer to do this adds up. This can make average PCs slow down significantly between the start and end of the game. The gaming PCs we have in our house add several minutes to the computation time once the end game nears. However, this computer has more RAM and a much better processor and video card so it should be able to handle these tasks more quickly. 

The game we set up has 1000 stars in our galaxy, each with their own set of planets. You can also adjust how many habitable planets you encounter. We maxed it to 5x to encourage a higher population to really test the computer. For this run, we went with the United Nations of Earth. They are a peaceful, democratic civilization with the goal of making friends and building a community that can be beneficial to all.


Starting in our own solar system on Earth, you can expand further by terraforming Mars or by being bold and colonizing a nearby star system. Alpha Centauri is nearby with the possibility of habitable planets so it seemed like a suitable choice. In order to colonize, you must send a science ship to survey the nearby system to find any habitable planets, resources or any alien anomalies. Depending on your civilization you may want to concentrate on exploiting mining resources or studying the science from various anomalies detected by your science ship. Once a habitable planet was found within Alpha Centauri’s system, a colony ship was sent to claim it for the United Nations of Earth (see image below).

After this point you are free to keep exploring and claiming more star systems for yourself but you must also consider your own population. With few exceptions, the majority of all resources are produced by your Pops; Therefore you always want to get as many as you can working where you want to fuel your empire. So to keep expanding means to grow the number of Pops in your empire and have worlds for them to live on. While this is manageable for most computers when you have only a couple dozen in each empire, by the endgame your own empire can reach numbers in the thousands, let alone all the other empires of similar sizes in the galaxy.

To determine how well the new computer runs Stellaris, we ran the same game on both machines and timed how long a month would take over the course of the game. We started at year 2200 and timed a month every 20 years until end game at 2400. We expected the new computer to outperform the old one and when compared to each other in the figure below, the new (white) computer has a better processor and significantly more RAM compared to the old (black) computer.

Shown in the figure below, the results were graphed with each other to easily compare computational power. At the start of the game (year 2200), both computers had similar timing for one in-game month. Since the majority of the civilizations were still in the beginning stage, population was low so minimal computational power is needed. Over time, population grew, and more computational power was needed. The two computers diverge significantly with the duration of one in-game month at year 2400 was doubled. Compared to the beginning of the game, the old computer sees a difference of 13 seconds while the new computer only has a difference of 4 seconds. Such a short difference must mean the new computer can definitely handle the majority, if not all of what I’ll throw at it during the rest of my PhD. A before and after of the game has been included at the bottom. 

Figure: Graph of the computational time for one in-game month between the start and end game. Blue shows the old computer, which has a large difference of 13 seconds. Orange shows the new computer and only differs by 4 seconds because of its better processor and more RAM. This is promising for any heavy computational research our group will perform.

Before: The galaxy at the starting stage of our game. The different colours represent different civilizations and you can see all the star systems which are represented by the white dots connected by blue hyperlanes. Any dots not in the coloured blobs are free to be claimed by nearby civilizations. Our civilization, the United Nations of Earth, is located near the top shown by a red arrow. 

After: This is what our galaxy looks like at the end stage of our game. The civilizations have greatly expanded with most star systems claimed. You can see the United Nations of Earth still at the top but they have significantly expanded (red circle).