Skip to main content

Files a build produces

What each file cTurtle's tools create is, and whether you ship it, commit it or can delete it. Don't edit these files; rebuild them from your project.

FileWhat it isShip it?Commit it?
Game executableYour exported gameYesNo
bin/program.dll / .soCompiled code for aot_shared buildsYes, beside the executableNo
Web files (.html, .js, .wasm, .data)Your exported web gameYes, all fourNo
.ctbtPrecompiled BT bytecodeOnly if you run it with bt.programNo
.ctaotCompiled machine codeNo (it's inside the executable)No
.ctfontPacked fontYes (registered asset)Yes
.ktx2Pre-processed textureIncluded automaticallyNo
.ctbuild/Build cacheNoNo
*.ctgame-previousBackup during a build swapNoNo

A typical .gitignore:

.ctbuild/
.cturtle-studio/
.studio-native-build
build/
*.ctgame-previous

Packaged executable​

The game ctgame builds for Windows or Linux. Your scripts (or compiled code), assets and package.copy files are packed inside it, so it's usually the only file you ship (plus bin/program.* for aot_shared).

When the game runs, it unpacks its files into a temporary folder and removes it on exit. Don't save player data next to your game's assets; use a separate save location.

On Windows the icon is set from package.icon. On Linux the executable has no icon of its own; a PNG icon is used for the window.

Leftover temporary folders​

If the game crashes or is killed, its temporary folder (named cturtle-… in %TEMP% on Windows or /tmp on Linux) is left behind. It's safe to delete when the game isn't running.

AOT shared module​

For aot_shared builds, your compiled code is in bin/program.dll (Windows) or bin/program.so (Linux) next to the executable. Ship the bin folder with the executable. If the file is missing, renamed or from a different build, the game won't start.

Web output​

A web build writes four files named after the output page, for example index.html, index.js, index.wasm and index.data. Upload all four together, and serve them with cross-origin isolation headers. See Web builds.

.ctbt program​

Precompiled BT bytecode, made by ctbt artifact (and by ctgame for bytecode builds, packed into the game). Load one with bt.program. A .ctbt only works with the cTurtle version that built it; after updating cTurtle, rebuild it. If it uses natives from your own C code, it only runs in a game that includes that code.

.ctaot payload​

Machine code for aot_embedded builds. It's stored inside the executable, so you never ship it separately.

.ctfont package​

A font made from one or more TrueType files with ctfont-pack. Unlike the other files here, it's one of your project's assets: register it under fonts and commit it.

.ktx2 cooked texture​

When exporting, ctgame converts each registered PNG into a .ktx2 file (with its mipmaps) that loads faster. The .ktx2 files go into the exported game; you don't add them to your project.

.ctbuild build cache​

Build caches ctgame and Studio keep in your project folder. Don't commit it. Deleting it is safe; the next build just takes longer. Code navigation for your own C natives in Studio and bt-lsp comes from this folder too, so they show as unknown until you build again.

.ctgame-previous backup​

While a build or deploy swaps in a new output folder, the old one is kept as <folder>.ctgame-previous and removed when the swap succeeds. If you find one, a build was interrupted: check it, then delete it.

See also​