64bit vs 32bit

We want our games to be accessible to as many people as possible, and for this reason - as well as supporting the open source community - we make sure all our releases run on three platforms: Windows, Linux and OS X.

However, there's actually a bit more behind the scenes than just this, because every build on each platform needs to be either 32bit or 64bit. We'll try to explain the implications of this below, and our choices for each platform.

What 32bit vs 64bit really means

There are many 32bit architectures, but when we say "32 bit architecture", we are generally talking about Intel x86, based on the i386 architecture. However, we also use a number of extensions added in later revisions of the standard (as does almost everyone who builds game software these days), so really we're talking about the i686 architecture, and there are very few x86 computers still around today that don't support at least this standard.

When we talk about 64bit architecture, we are referring to amd64, also often referred to as x86_64 - the two terms are interchangeable. CPUs that support the amd64 standard are also universally capable of executing code compiled for i386, but they do perform somewhat faster in 64bit mode due to a number of factors, most notably the additional CPU registers made available by the amd64 standard. That means it's generally preferable to build for amd64 when possible.

64bit hardware is almost ubiquitous in modern desktop and laptop computers - the only notable exceptions are some older Atom processors that are still around in very low end netbooks. Unfortunately, the user's operating system also has to support 64bit in order for them to run 64bit software, and this is where it gets complicated - for a number of reasons, not all 64bit capable computers are currently running 64bit operating systems, even when they are capable of doing so.

Windows

On Windows, all 32bit programs run normally on 64bit Windows installs. Coupled with the fact that many Windows users are still using a 32bit OS, or lack the technical experience to determine whether their operating system is 32bit or 64bit, the logical conclusion for us is to build in 32bit on Windows. We also aim to release 64bit builds of each final game when finished, but in the interim while making frequent beta releases, there is no disadvantage to providing just 32bit Windows builds during the beta testing period of each game.

OS X

All modern OS X versions require an Intel processor, and all Mac computers with Intel processors are 64bit. All modern versions of OS X are therefore also 64bit capable, and hence all Mac computers that can run our games (or any modern software) are necessarily capable of running 64bit software. As a result, all our builds are 64bit on OS X. We have no plans to ever build in 32bit on OS X, as this will never be needed.

Linux

On Linux, this gets a bit more complicated. The vast majority of modern Linux desktop installs (by "modern" we mean in the last ten years) are 64bit. Because Linux has always been a free operating system, and almost all desktop and laptop CPUs have been 64bit-capable for over a decade now, it has always been easy for users to upgrade to a 64bit operating system.

Unfortunately, a 64bit Linux system is not capable of running 32bit software without additional configuration (using multilib etc), which is often too complicated a process for casual users. This is a problem frequently experienced by users of Steam on Linux.

Because upgrading to 64bit is trivial, free, and offers a performance advantage, we build in 64bit on Linux. However, there are still a very few users who use older systems and for whatever reason don't want to upgrade to a 64bit OS, so we also aim to make a 32bit Linux build before each final release; however, testing this is tricky for us because we don't have access to any real 32bit Linux desktop machines, and the number of users that need it is very small, so 64bit remains our higher priority.

If you are using a 32bit Linux install, we urge you to upgrade - of all mainstream processors made in the last ten years, only a few early Intel Atom CPUs do not support 64bit instructions; everyone else will see a performance improvement when switching to a 64bit OS on their 64bit hardware, and of course our games will work better too ;)

Performance Considerations

Earlier we mentioned that software built for 64bit is generally faster on the same cpu than it would be built for 32bit. This was a bit of a simplification - there are actually a lot of factors involved. Most games make heavy use of floating point processing, and these can come in single or double precision - 32bit or 64bit. While moving these around on a 64bit processor actually takes the same amount of work, vectorisation (when the processor runs the same calculation on multiple numbers in parallel) can take place with more single precision floats than double precision, so using 32bit floats is generally faster even on a 64bit CPU; however, the 64bit CPU has a lot more registers in which to store them and move them around, which makes a big difference to performance.

Another performance impact is that 64bit values take up more space in the cache and hence take longer to move around in memory and operate on, even if the CPU cost is the same as for 32bit values. The important thing is to be aware that you don't get processing of 64bit numbers "for free" at the same performance as 32bit numbers just because you're running on a 64bit platform - which is a common mistaken assumption among game programmers. However, 32bit operations running within a 64bit program will still often run faster than within the same program compiled for 32bit CPUs, mainly because of the extra registers mentioned above.

Conclusion

While 64bit support is slowly becoming ubiquitous, there are still enough outliers - especially in the Windows world - to mean that it's important for us to still support 32bit on some platforms, and in fact to prioritise it on Windows. However, as time goes on, we will be able to move towards a 64bit-only paradigm, and see performance improvements (especially on Windows) as a result.