Game Oriented Assembly Lisp Explained

Paradigms:Multi-paradigm
Family:Lisp
Designer:Andy Gavin
Developer:Naughty Dog
Latest Release Version:3
Typing:Dynamic, latent, strong
Scope:Lexical
Programming Language:Allegro Common Lisp
Platform:PlayStation 2, PlayStation Portable, PlayStation 3
License:Proprietary
Influenced By:Lisp, Scheme,
Game Oriented Object Lisp (GOOL)

Game Oriented Assembly Lisp (GOAL, also known as Game Object Assembly Lisp) is a programming language, a dialect of the language Lisp, made for video games developed by Andy Gavin and the Jak and Daxter team at the company Naughty Dog.

It was written using Allegro Common Lisp and used in the development of the entire Jak and Daxter series of games (excluding Daxter and ).

Design

GOAL's syntax resembles the Lisp dialect Scheme, though with many idiosyncratic object-oriented programming features such as classes, inheritance, and virtual functions.[1] GOAL encourages an imperative programming style: programs tend to consist of a sequence of events to be executed rather than the functional programming style of functions to be evaluated recursively. This is a diversion from Scheme, which allows such side effects but does not encourage imperative style.

GOAL does not run in an interpreter, but instead is compiled directly into PlayStation 2 machine code to execute. It offers limited facilities for garbage collection, relying extensively on runtime support. It offers dynamic memory allocation primitives designed to make it well-suited to running in constant memory on a video game console. GOAL has extensive support for inlined assembly language code using a special rlet form, allowing programs to freely mix assembly and higher-level constructs within one function.

The GOAL compiler is implemented in Allegro Common Lisp. It supports a long term compiling listener session which gives the compiler knowledge about the state of the compiled and thus running program, including the symbol table. This, in addition to dynamic linking, allows a function to be edited, recompiled, uploaded, and inserted into a running game without having to restart. The process is similar to the edit and continue feature offered by some C++ compilers, but allows programs to replace arbitrary amounts of code (even up to entire object files), and does not interrupt the running game with the debugger. This feature was used to implement code and to enable level streaming in the Jak and Daxter games.

Uses

GOAL's first use was for the game . The predecessor language, Game Oriented Object Lisp (GOOL), was also developed by Andy Gavin for Crash Bandicoot.

Since Naughty Dog no longer employs GOAL's primary development and maintenance engineer, and they were under pressure from their new parent company, Sony, to share technology between studios, Naughty Dog transitioned away from Lisp:[2]

However, they have since resumed using it for scripting on some PlayStation 3 games, including The Last of Us.[3]

OpenGOAL

A community project, OpenGOAL, started in 2020 with the goal of porting GOAL to x86-64 by decompiling existing , Jak II, Jak 3 and, tentatively, assets and recompiling them natively.[4] It includes a GOAL compiler written in C++ as well as a read–eval–print loop to enable a similar workflow to Naughty Dog's original implementation. By November 2023, the OpenGOAL team had produced ports for the first two games 100% completable on Windows and Linux computers,[5] [6] with a Jak 3 port in development .[7] [8]

External links

Notes and References

  1. Web site: [Sweng-gamedev] Higher Level Languages (Was: Next Gen Multiplatform Load Balancing) ]. Shumaker . Scott . 11 Aug 2005 . Midnight Ryder Technologies: sweng-gamedev mailinglist . https://web.archive.org/web/20070412155710/http://lists.midnightryder.com/pipermail/sweng-gamedev-midnightryder.com/2005-August/003804.html . 2007-04-12 . 2019-04-20.
  2. Web site: [Sweng-gamedev] Higher Level Languages (Was: Next Gen Multiplatform Load Balancing ]. Shumaker . Scott . 2005-08-08 . Midnight Ryder Technologies: sweng-gamedev mailinglist . https://web.archive.org/web/20070720142546/http://lists.midnightryder.com/pipermail/sweng-gamedev-midnightryder.com/2005-August/003789.html . dead . 2007-07-20 . 2019-04-20 .
  3. Anthony Newman . 2017-10-28 . Unsynced: The Last of Us Melee System . Videotape . en . https://ghostarchive.org/varchive/youtube/20211214/Ox2H3kUQByo . 2021-12-14 . live. 2017-11-05 . 37 . Game Developer's Conference .
  4. Web site: OpenGOAL . OpenGOAL . October 23, 2022 . https://web.archive.org/web/20221213192328/https://opengoal.dev/ . December 13, 2022 . live .
  5. Web site: Jak and Daxter OPENGOAL 100% Playthrough! . OutrageousJosh . June 22, 2022 . . May 16, 2024.
  6. Web site: Progress Report - October 2023 . OpenGOAL . October 30, 2023 . May 16, 2024 . https://web.archive.org/web/20240516042644/https://opengoal.dev/blog/progress-report-oct-2023/ . May 16, 2024 . live .
  7. Web site: Progress Report - April 2024 . OpenGOAL . April 30, 2024 . May 16, 2024 . https://web.archive.org/web/20240516044101/https://opengoal.dev/blog/progress-report-apr-2024/ . May 16, 2024 . live .
  8. Web site: Progress . OpenGOAL . May 16, 2024 . https://web.archive.org/web/20240212010054/https://opengoal.dev/progress/jak3/ . February 12, 2024 . live .