From assembler to C++: which programming languages were used at different stages of the development of the gaming industry
There has been a big discussion on Reddit about programming languages that have been used to develop video games at various times. Users recalled games written in BASIC, the era of assembler and the transition to C++, and also shared stories from their own practice.Assembly language was used in the 80s and early 90s.
As an example, the first three parts of Sonic The Hedgehog, Super Mario, as well as a number of other projects of that era can be cited.
However, as Raidenkyu noticed, different syntax was used for different platforms depending on the processor types. 68000 — for Sega Genesis, 6502 — for NES, 65816 — for SNES.
Some users noted that some early games were written in BASIC. Most of them were not commercially successful or were not sold at all, but there were exceptions. For example, the Commodore 64 version of Sid Meier’s Pirates was primarily written in BASIC.
Some commercial games in the 80s were still written in BASIC. At that time, single developers copied them onto cassettes and sold them in local computer stores. As far as I remember, the first version of the original Ultima was written in Applesoft BASIC. about games written in BASIC
According to the codethulu user, games for the first PlayStation, Nintendo 64 and other consoles of that generation have already been written in C. Over time, C++ became widespread and became one of the standards in the gaming market.
philbgarner user noticed that PC game developers were among the first to switch to C and C++ languages, since personal computers were less dependent on memory limitations. He also stressed that at that time a hybrid approach was often used: low-level programming languages like assembler were used to create graphics, and game logic was written in C/C++.
I came across such hybrid programming at one of the computer architecture classes. We wrote parts of the program in assembler that used low—level hardware (for example, setting a frequency multiplier and linking the generator output signal to an internal speaker to generate tones), and other parts in C++ (for example, song generation). about using a hybrid approach
SanityInAnarchy user noted that many famous video games from the 90s used both assembler and byte code. As an example, he cited Quake, in which low—level elements were written in assembler, and high-level game logic was written in QuakeC, a special language developed by John Carmack in 1996.
Despite the fact that mass development in assembler is a thing of the past, some developers still used this language in the late 90s and early noughties. For example, Chris Sawyer completely wrote RollerCoaster Tycoon in x86 assembler.
Naughty Dog at the dawn of the PlayStation 2 wrote its own dialect of the Lisp language — Game Oriented Assembly Lisp (GOAL). It was first used to develop Jak and Daxter: The Precursor Legacy. Over time, the studio abandoned GOAL, but sometimes used it for scripts in the PlayStation 3 era — for example, in the first The Last of Us.
BillyTenderness found it funny that today C++ has turned, in fact, into a low-level language. It is often used for graphics and physics, and scripting languages like Blueprint and Lua are used for game logic.
One of the users noted that he had never heard of the use of scripting languages in this way. However, many examples of using this approach were given in the comments.
In the games of the Civilization series, Lua is used to create game logic (Python was used for this purpose in the fourth part). According to the user Noxime, for this reason, the moves in the last stages of the game traditionally become so slow.
For these purposes, Lua is also used in Metal Gear Solid V. Also in the noughties, developers often used their own scripting languages to create game logic.
According to Putnam3145, scripting languages are 5-10 times slower, but computers are getting faster, and therefore scripting parts are no longer a bottleneck. The only question is optimization.
When talking about programming languages, it is impossible not to mention Java. In the early noughties, it was used for various games, including the browser-based MMORPG RuneScape. However, the main application of Java in the era before smartphones was mobile games.
Around the noughties, J2ME (a subset of the Java platform) was used to develop mobile games — for example, for Nokia 3410. Such code was compiled into byte code, which was then interpreted into machine code on the phone. Therefore, developers had to make several modifications for different platforms. about mobile development in the 2000s
Filisoft user noted that mobile games for Symbian and Blackberry were written in C/C++. Some devices were powerful enough to pull out individual 3D elements, and therefore a package of such titles could reach several hundred kilobytes. For comparison, Java projects had much stricter size limits — for example, 48 KB. Therefore, developers had to compress their games a lot.
However, with the release of the iPhone and the spread of smartphones, Java as a language for mobile development, in fact, died. Today, C# (Unity) and C++ (Unreal Engine and some proprietary engines) are often used.