Installation and building your first application

1. Installation

  1. First, install Lazarus and FPC (Pascal IDE and compiler). Go to the Lazarus website and download the latest release.

    Lazarus website

    Advanced: You can install FPC and Lazarus in other ways. You can install using FpcUpDeluxe. You can also install only FPC and use any Pascal code editor you like, like VS Code or Atom.

  2. Download the latest Castle Game Engine. Unpack the engine ZIP wherever you like.

  3. Inside the unpacked castle_game_engine, you will find a subdirectory bin. Run the castle-editor executable inside.

  4. Configure FPC and Lazarus locations in editor Preferences, if they have not been auto-detected correctly.

    Castle Game Engine Editor Preferences
  5. While you are there (Preferences dialog, default tab FPC and Lazarus) also click on the button "Register Lazarus Packages". This will make compilation of CGE applications using Lazarus go smoothly.

    Lazarus packages registration confirmation

2. Build and run your first application

  1. Create a new project in the Castle Game Engine Editor.

    Use any of the suggested New Project templates. These templates have been designed to show you most important features of our engine, along with the most advised way to use them.

    Castle Game Engine Editor New Project
  2. Compile and Run the project using the editor Run menu. Or just press F9.

    Note: First compilation of a new project needs to build the engine as well. Subsequent compilations will be lighting fast.

  3. That's it! The world is your oyster now :)

    Open and try numerous example projects from the engine examples subdirectory. Open them in the editor by Open Project and point at the example's CastleEngineManifest.xml file. Projects can also be compiled using Castle Game Engine command-line build tool.