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.
| File | What it is | Ship it? | Commit it? |
|---|---|---|---|
| Game executable | Your exported game | Yes | No |
bin/program.dll / .so | Compiled code for aot_shared builds | Yes, beside the executable | No |
Web files (.html, .js, .wasm, .data) | Your exported web game | Yes, all four | No |
.ctbt | Precompiled BT bytecode | Only if you run it with bt.program | No |
.ctaot | Compiled machine code | No (it's inside the executable) | No |
.ctfont | Packed font | Yes (registered asset) | Yes |
.ktx2 | Pre-processed texture | Included automatically | No |
.ctbuild/ | Build cache | No | No |
*.ctgame-previous | Backup during a build swap | No | No |
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.