CASTLE-ENGINE(1)

โœจ NAME โœจ

castle-engine โ€” build and package Castle Game Engine programs ๐Ÿฐ๐Ÿ’–


๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay bestie so castle-engine is literally the build-and-package bestie for your Castle Game Engine programs. it does the whole glow-up pipeline: compiling, packaging, installing, running, the works. periodt.

๐ŸŽ€ how you actually call it

run it with your current directory set to your project, like this:

castle-engine [OPTIONS]... COMMAND

๐Ÿ‘‘ the commands (aka the main characters)

  • create PROJECT-NAME โ€” makes you a brand new project based on one of the existing templates. it creates a subdirectory called PROJECT-NAME inside whatever directory you gave as --project-parent-dir, and by default that's just the current directory. new project, who dis ๐Ÿ’…
  • compile โ€” compiles your project. by default it builds for your current OS / current CPU (linux / x86_64). wanna build for a different OS / CPU? hit it with --os / --cpu. or use --target to build for a whole collection of OS / CPU combos (like "iOS" or "Android"), slay.
  • package โ€” packages your app into the best archive format for the given operating system (OS) / processor (CPU) / target. the OS, CPU and "target" can be changed exactly like at compile.
  • install โ€” installs the app that your previous package call made. super useful when the OS is "android" โ€” it installs the apk package that the previous package call created for Android. great for quick testing of your app on a device plugged in through USB ๐Ÿ”Œ
  • run โ€” runs the app. on some platforms you gotta install it first (e.g. Android, where we install and run on a device over USB), so run the install command before. on other platforms (e.g. standalone Windows, Linux, macOS...) it just runs the last compiled app, so just compile first. easy.
  • package-source โ€” packages up the source code of the app. cute.
  • clean โ€” cleans the leftover files from compilation and packaging. heads up: it does not remove the final packaging output.
  • simple-compile โ€” compiles the Object Pascal file (unit/program/library) you pass as a parameter. this does not handle Castle Game Engine projects defined by CastleEngineManifest.xml files. it merely calls fpc with proper command-line options for units/programs/libraries using our engine. only use this instead of compile if there's some good reason you don't wanna use CastleEngineManifest.xml for your project.
  • auto-generate-textures โ€” creates GPU-compressed versions of textures, for the textures mentioned in <auto_compressed_textures> inside the file data/material_properties.xml. โœจ
  • auto-generate-clean โ€” clears the auto_compressed subdirectories, which should only contain the output created by the auto-generate-textures target.
  • generate-program โ€” generates the files you need to edit and run this project in Lazarus: lpr, lpi, castleautogenerated unit. depends on game_units being defined in the CastleEngineManifest.xml.
  • editor โ€” runs Castle Game Engine Editor inside this project, with any project-specific components. main character energy fr.
  • editor-rebuild-if-needed โ€” internal. it's the 1st part of the editor command. ๐Ÿคซ
  • editor-run [--wait-for-process-exit PROCESS-ID] โ€” internal. it's the 2nd part of the editor command.
  • output โ€” spits out some project info (from the manifest). the next parameter decides which info:
executable-name name pascal-name search-paths version version-code
  • output-environment โ€” spits out some environment info (independent of any project). the next parameter decides which info:
fpc-exe fpc-standard-units-path
  • cache โ€” creates a cache to speed up future compilations. future you says thank you ๐Ÿซถ
  • cache-clean โ€” removes the cache directory. bye bye ๐Ÿ‘‹
  • create-manifest โ€” (Deprecated) creates a simple CastleEngineManifest.xml with guessed values.

๐Ÿ’– OPTIONS ๐Ÿ’–

  • -h / --help โ€” print this help message and exit.
  • -v / --version โ€” print the version number and exit.
  • -V / --verbose โ€” verbose mode. the output contains e.g. a list of packaged files. nosy mode: ON ๐Ÿ”
  • --mode=debug|release โ€” compilation mode, used by the compile and package commands. also the packaging mode on some platforms (right now, Android). default is "release".
  • --assume-compiled โ€” do not automatically do clean and compile before package. instead, assume that the compiled executable for the given OS/CPU/mode is already present in the package directory. trust fall ๐Ÿค
  • --fast โ€” do not clean before package. recompile only what changed. faster for development, but it cannot guarantee that everything is recompiled in a release mode. โš ๏ธ speed vs. certainty, bestie.
  • --plugin โ€” compile/package/install a browser NPAPI plugin. DEPRECATED. ๐Ÿ’€
  • --fpc-version-iphone-simulator VERSION โ€” when compiling for iPhone Simulator, we pass -V<VERSION> to the fpc command-line. this is necessary if you use the official "FPC for iOS" package (see the "Getting Started - iOS.rtf" inside the "FPC for iOS" dmg for explanation). you can set this to "auto" (this is the default) to auto-detect it based on the regular FPC version. or you can set it to a particular version, like "3.0.5". or you can set it to empty "" to avoid passing any -V<VERSION> (suitable for FPC 3.1.1).
  • --compiler-option=PARAM โ€” extra parameter for the fpc command line. for example --compiler-option=-dUSE_MOUSE will add -dUSE_MOUSE. you can use this parameter multiple times. stack 'em up ๐Ÿงš
  • --output=DIR โ€” where to place the output executables, packages, and the "castle-engine-output" directory with temporary generated files.
  • --project=DIR โ€” where to search for the project (CastleEngineManifest.xml file). by default we search in the current directory. the argument can either be a directory, or a filename of a CastleEngineManifest.xml file.
  • --package-format=FORMAT โ€” use with the package command to customize the result. available FORMAT values:
    • default (platform specific; on most platforms creates a zip/tar.gz archive; on Android creates APK; on iOS creates Xcode project)
    • zip (pack all files into zip)
    • tar.gz (pack all files into tar.gz)
    • directory (put all files into a new subdirectory)
    • android-apk (only on Android: create APK)
    • android-app-bundle (only on Android: create AAB)
    • ios-archive-ad-hoc (only on iOS: archive using "ad-hoc" method to IPA file)
    • ios-archive-development (only on iOS: archive using "development" method)
    • ios-archive-app-store (only on iOS: distributes the application to the TestFlight and the AppStore)
  • --package-name-no-version โ€” use with the package command. the resulting file/directory name will not contain the version number.
  • --update-only-code โ€” use with the package command. makes the packaging faster, as you guarantee that only the Pascal code has changed since last packaging (so you did not change e.g. data/ or CastleEngineManifest.xml). pinky promise edition ๐Ÿค™
  • --ios-simulator โ€” use with the package command when --target=iOS. allows to run the project on the iOS simulator.
  • --all โ€” use with the auto-generate-clean command. indicates to clean everything auto-generated. by default we only clean unused files from "auto_generated" directories.
  • --manifest-name=AlternativeManifest.xml โ€” search for and use the given "AlternativeManifest.xml" file instead of the standard "CastleEngineManifest.xml". useful if you need to maintain completely different project configurations for any reason. so valid, lowkey genius.
  • --wait-for-process-exit=PROCESS-ID โ€” internal, useful with "editor-run".
  • --gui-errors โ€” show errors as GUI boxes. on Unix, requires "zenity" installed.
  • --compiler=COMPILER โ€” select compiler: "autodetect", "fpc", "delphi".
  • --guid-from-name โ€” use with the generate-program command. will generate a stable GUID (in Delphi DPROJ) from the project's qualified name.
  • --windows-robust-pipes โ€” only on Windows (ignored on other systems): force using a less performant, but more robust, way to run child processes with "passthrough", like for castle-engine run. useful to run castle-engine run from PowerShell, outside of the CGE editor.
  • --target=<target> โ€” the target system for which we build/package. available <target> values:
    • "custom" (default): build for a single OS and CPU combination, determined by the --os and --cpu options. these options, in turn, by default indicate the current (host) OS/CPU.
    • "ios": build for all the platforms necessary for iOS applications. this includes both 32-bit and 64-bit iOS devices and iPhoneSimulator.
    • "android": build for all the platforms necessary for Android applications. this includes both 32-bit and 64-bit Android devices.
    • "nintendo-switch": build an application for Nintendo Switch. ๐ŸŽฎ
  • --os=<os> โ€” set the target operating system for which we build/package. this is ignored if you used --target=<target>, with <target> being something else than "custom". available <os> values:
linux go32v2 win32 os2 freebsd beos netbsd amiga atari solaris qnx
netware openbsd wdosx palmos macosclassic (classic MacOS, that ended with
MacOS 9)
darwin (modern macOS 10.x, caled also Mac OS X) emx watcom
morphos netwlibc win64 wince gba nds embedded symbian haiku
iphonesim aix java android nativent msdos wii aros dragonfly
win16 ios
  • --cpu=<cpu> โ€” set the target processor for which we build/package. this is ignored if you used --target=<target>, with <target> being something else than "custom". available <cpu> values:
i386   m68k powerpc sparc x86_64 arm powerpc64 avr armeb mips mipsel jvm
i8086 aarch64 (64-bit ARM) sparc64

๐Ÿฆ‹ DEFAULTS ๐Ÿฆ‹

android.compile_sdk_version = 34 android.min_sdk_version = 21
android.target_sdk_version = 34

๐Ÿ“– full documentation

full documentation lives on https://castle-engine.io/build_tool โ€” go read it, iykyk โœจ


๐ŸŒˆ deets

castle-engine version 7.0-alpha.3. using Castle Game Engine ( https://castle-engine.io/ ) version 7.0-alpha.3. compiled with FPC 3.2.2. platform: Desktop, OS: Linux, CPU: x86_64 (code compiled for 64-bit architecture).


and that's the whole page bestie ๐Ÿ’– this was Castle Game Engine, April 2026 โ€” go build something iconic with it, no cap. ๐Ÿฐ๐Ÿ‘‘๐Ÿ’…

๐Ÿ“ฆ where this page comes from