r/learnprogramming • u/combustaoinstantanea • 18h ago
Solved Which programming languages were used for developing games in the PS2?
I'm not really sure if this is the proper sub for asking this question, so sorry in advance. When I was playing Silent Hill 2 I got curious about what programming language (Or languages) were used for that game, and in the broader Sixth Generation of consoles. Couldn't really find a clear answer for this online, so if anyone knows something about this topic I would be thankful.
Edit: Wow this gained a bit more attention than I expected. Thanks to everyone who answered! Really informative stuff. Ngl at first I was just asking out of curiosity but now I might actually try creating a PS2 homebrew someday, who knows.
75
u/nathan123uk 18h ago
PS1 games were written in C, I imagine most PS2 games would be C or C++
20
u/tarix76 10h ago edited 8h ago
PS2 games were still largely using C but some brave studios also used C++. The PS2 compiler for C++ was buggy enough that our studio had a modifed version to fix bugs we were seeing.
Using assembly for VU1/VU0 was required, there was no real compiler for them although late in the generation some people had bespoke tools.
The beauty of the machine was it's DMA controller and using the GS was a nice dance of DMAing code and data to the VU1 which then crunched it and kicked it to the GS. You also had to make sure the textures you needed were ready otherwise your beautiful world turned into graphical vomit.
The processors had tiny amounts of memory, the main RAM was slow, and the DVD drive was slow relative to the amount of RAM so constantly streaming things around was required.
The simple version is DVD to RAM then CPU builds the scene, then DMA to VU1 and the graphics RAM, and finally VU1 doing the projection and clipping and kicking it to the GS. The reality, especially for open world games, was doing this and keeping everything running at 90% usage which was non-trivial.
I am extremely biased but I think the PS2 was probably the last great hardware ever made for cosoles. (PS3 made some huge mistakes that kept it from becoming the hardware king.)
5
u/Comprehensive_Mud803 14h ago
C and C++, mostly. Probably bits of Assembly sparkles on top where needed.
5
u/ooqq 8h ago edited 30m ago
You have to mentally frame yourself in the era. I know some since I'm fascinated with the ps2.
In that ps2 age even internet was a very minor thing, if some forums and communities have arisrn, they were far and between. That should prepare you to realize that if you were meant to work in isolation, to turn everything into an artisan craft. Most of tech progress arise around few hubs, tokyo game studios, sf game studios, the ces and the siggraph, and i'm not covinced that japan had an open policy of discuss technical matters outside your company
For languages, expect C89 (ps1), C99 (somewhat halfway the ps2 life and cpp98 if any, copious amounts of assembler and specially Lisp for anything custom which were many, Jak and Daxter 1 runs in a complete custom VM made from scratch with its own derived lisp language also made from scratch called GOAL. J&D1 case is hardly unique, custom tooling was everywhere and rampant. In that day you had to really bring your best game and machines were not abstracted, you had to do it yourself, but machines let you full access to the hardware unrestricted. You need to have any official devkit (ps2 Tool) because you had no ps2 emulator and you were incapable of debug your results without one. Pipelines and toolings were usually also custom, with completely made up formats, compression, transformations etc.
Bear in mind that lots of games from that era have their sources lost. In most cases there was no source version control, and Silent Hill 3, or FF10 just printed the source on paper that were eventually discarded. It was a one time endeavour that ended as soon the game was released. Not even the 3d models, cinematics footage survived. No dlc's, no update patches. FF11, as sucessful it was, was finally terminated by 2016 because square was unable to find and replace more Tool ps2 units for development in the aftermarket, and most new people in the studio found indecypherable to use the original asset pipeline.
The downside of it is that technical manuals had lots of revisions, were lacking, official SDKs were not modern tooling, official sony compiler was the only way to build a game and were buggy as hell, expect to patch the tooling yourself, nothing was batteries included. 3dMax was king. But I saw screenshots of Shadow of The Collosus begin made in Lightwave 7.5.
Codewarrior was also a thing. And if you ever poke your nose on classic games modding, reverse enginneering means untangle complete custom everythings. GT4 have it's own VM, it's own scripting, it's own compression algos, it's own savegame encryption, etc. And since it's the ps2, don't get me started on the VU's, which were the door to performance and were nothing but plain custom assembler. The VU compiler didnt appeared until 2004, more than halfway the lifespan of the system (ps3 launch on 2006), were developed by some dudes not affilliated to sony, run on windows NT and only accepts C89.
It's also reasonable that any moderately good engine made big buck, with such landscape, renderware success is a no brainer, but even so, if you fire san andreas on the ps2, renderware logo doesn't even appear since it was so heavily customized it lost the rights to announce itself. Half-life also ran over the quake2 engine modified to the brim, and was also ported to the ps2, but idk what engine runs on console, in such ports where you basically demaking the game, lots of times mean to rebuild the game from the ground up to target the lesser architecture, look for a video that explain the development of titanfall in the x360 or resident evil 2 for the n64
4
u/Comprehensive_Mud803 14h ago
Unreal Engine 2 and other engines existed, but most games were made from scratch using the provided SDK libraries and in-house libraries
3
u/deathreaver3356 8h ago
The Jak and Daxter games were made with a specialized version of Lisp.
2
u/lainwindforeskin2007 11h ago
mostly C and C++ from what i've seen