Landing on the Moon with Large Language Models

Requirements Gathering


Here, we prompt the large language model for requirements for the software. We already have a high-level idea of what we want — that is, the lunar lander game. We will ask the model to generate a list of functional and non-functional requirements for the classic Lunar Lander game where a player controls the descent of the Lunar Lander. In the requirements, we will include the possibility of controlling the Lunar Lander programmatically with an AI.

Please generate a list of functional and non-functional requirements for the classic Lunar Lander game where a player controls the descent of the Lunar Lander. In the requirements, include the possibility of controlling the Lunar Lander programmatically with an AI.

Certainly! Here is a list of functional and non-functional requirements for the classic Lunar Lander game, including the possibility of AI control:

Model output

The output from the large language model, when formatted using markdown, is as follows.

Functional Requirements

  1. User Interface

    • The game must provide a graphical user interface (GUI) to display the Lunar Lander, the lunar surface, and relevant status information (e.g., altitude, velocity, fuel level).
    • The game must provide controls for the player to adjust the thrust and direction of the Lunar Lander manually.
    • The game must display a “Game Over” screen when the Lunar Lander crashes or lands successfully.
  2. Game Mechanics

    • The game must simulate gravity, causing the Lunar Lander to accelerate downwards.
    • The game must allow the player to control the thrust of the Lunar Lander to counteract gravity.
    • The game must simulate fuel consumption based on the thrust used by the player.
    • The game must detect collisions with the lunar surface and determine whether the landing is successful or results in a crash.
  3. AI Control

    • The game must provide an option to control the Lunar Lander programmatically using an AI.
    • The AI must be able to access the same controls as a human player (thrust and direction).
    • The AI must be able to read the same status information available to the player (e.g., altitude, velocity, fuel level).
  4. Scoring and Feedback

    • The game must keep track of the player’s score based on landing success, fuel efficiency, and time taken.
    • The game must provide feedback to the player on their performance after each attempt.
  5. Configuration Options

    • The game must allow players to configure difficulty levels (e.g., gravity strength, initial fuel amount).
    • The game must allow players to toggle between manual and AI control.

Non-Functional Requirements

  1. Performance

    • The game must run smoothly on the target platform without noticeable lag or delays.
    • The game must handle real-time updates to the Lunar Lander’s position and status.
  2. Usability

    • The game must have an intuitive and easy-to-use interface for both manual and AI control.
    • The game must provide clear instructions and feedback to help players understand how to control the Lunar Lander.
  3. Reliability

    • The game must be reliable and free of critical bugs that could disrupt gameplay.
    • The game must handle edge cases gracefully, such as running out of fuel or extreme velocities.
  4. Compatibility

    • The game must be compatible with the target operating systems and hardware configurations.
    • The game must support different screen resolutions and aspect ratios.
  5. Extensibility

    • The game must be designed in a modular way to allow for future enhancements, such as additional levels or new AI algorithms.
    • The game must provide a well-documented API for integrating custom AI controllers.
  6. Maintainability

    • The game’s codebase must be well-documented and follow best practices to facilitate maintenance and updates.
    • The game must include automated tests to ensure the correctness of critical game mechanics and AI behavior.
  7. Security

    • The game must ensure that any external AI code integrated into the game does not compromise the security or integrity of the game.
  8. Scalability

    • The game must be able to handle multiple instances running simultaneously without performance degradation, especially if deployed in a multi-user environment.

By addressing both functional and non-functional requirements, this list ensures that the Lunar Lander game is not only enjoyable and challenging but also robust, maintainable, and extendable for future enhancements.

Reflections

The majority of the requirements generated by the model are relevant and align with what we would expect for a Lunar Lander game. There are also aspects that we do not necessarily need for our game, such as the security requirements, which are more relevant for online games or games that interact with external systems, and the scalability requirements, which are not really relevant as we are building a single-player game.

Continuing to application design, we pick the following four functional requirements to focus on:

Functional requirements

  1. User Interface

    • The game must provide a graphical user interface (GUI) to display the Lunar Lander, the lunar surface, and relevant status information (e.g., altitude, velocity, fuel level).
    • The game must provide controls for the player to adjust the thrust and direction of the Lunar Lander manually.
    • The game must display a “Game Over” screen when the Lunar Lander crashes or lands successfully.
  2. Game Mechanics

    • The game must simulate gravity, causing the Lunar Lander to accelerate downwards.
    • The game must allow the player to control the thrust of the Lunar Lander to counteract gravity.
    • The game must simulate fuel consumption based on the thrust used by the player.
    • The game must detect collisions with the lunar surface and determine whether the landing is successful or results in a crash.
  3. AI Control

    • The game must provide an option to control the Lunar Lander programmatically using an AI.
    • The AI must be able to access the same controls as a human player (thrust and direction).
    • The AI must be able to read the same status information available to the player (e.g., altitude, velocity, fuel level).
  4. Scoring and Feedback

    • The game must keep track of the player’s score based on landing success, fuel efficiency, and time taken.
    • The game must provide feedback to the player on their performance after each attempt.