Skip to content

Quick source code introduction

Érico Porto edited this page May 30, 2022 · 4 revisions

Quick source code introduction

This text should briefly introduce you to where are some things in the AGS codebase. It doesn't aim at being complete, but mainly informative to help get familiar with the location of some things. Please make sure you have read the README and used the Engine and Editor to get familiar with some concepts.

The AGS engine is written in C++ and uses C and C++ libraries. The AGS Editor is written in C#, with few parts in C++ in the Native library.

Directories quick look

main components

  • Common: has components that are shared between native parts of the Editor and the Engine, and are expected to be available to the command line Tools. They have a close relationship with the binary data formats that the Editor and the Tools have to generate and that the Engine knows how to read.
  • Editor: the AGS Editor, contains both the rules of the current project format as the graphical editor used to create AGS games.
  • Engine: the runtime capable of running ags games, it has to be able to interface and output graphics and sound for the biggest amount of platforms as possible.
  • Compiler: the ags compiler capable of transform AGS Script into AGS bytecode.
  • Tools: AGS command-line tools to read game project files and transform them in files that are used to build a binary AGS game.
  • Plugins: Plugins that were often used in the past were ported to be able to play old games.
  • libsrc: libraries shared across different projects in the repository.

platform specifics

  • Windows: Windows building instructions and code for the Editor installer.
  • debian: Linux building instructions and debian packaging files.
  • OSX: MacOS building instructions and specific files for shipping an .app game build.
  • Android: Android building instructions and project files.
  • iOS: iOS building instructions and project files.
  • Emscripten : The Web port of AGS, with build instructions, the HTML parts and how to debug
  • PSP: discontinued files to build the PSP port of the engine.

IDE and building

  • Solutions: Visual Studio project files for the different parts of the codebase.
  • CMake: CMake modules used for building AGS.
  • Script: diverse scripts to help to package an AGS release.
  • ci: Dockerfiles used in continuous integration to create the environments to build AGS.

History of the codebase

When Adventure Game Studio was originally open-sourced, it contained few files, that had tens of thousands of lines of source code each. Many things in the project tree today are just historical, remain of early refactoring attempts.

Diagram

Most of the code is in the Editor, Common and Engine directories. This diagram may help visualizing some blocks of code.

AC referenced several times in the source, means "Adventure Creator", the original 1997 name of AGS.

IDE

AGS development on Windows can be done in Visual Studio, by loading project files in the Solutions directory, more details here.

If you are using CLion or other IDE that can load CMake files as a project, just load the base CMakeLists.txt.

See the platform-specific information mentioned in the README for more information on other IDEs and systems.

Continuous Integration

AGS current has automated builds in a continuous integration system, if you want to use it too, after you fork, make sure you install the Cirrus-CI APP on GitHub Marketplace. After installing it, the repository should automatically build on every commit push on your account in Cirrus CI. We use Google Container Registry (gcr.io) for storing our CI built docker images.