The file game.project contains all project wide settings. It must stay in the root folder of the project and must be named game.project. The first thing the engine does when starting up and launching your game is look for this file.
Every setting in the file belongs to a category. When you open the file Defold presents all settings grouped by category.
Below are all the available settings, arranged by section. Some settings are not yet exposed in the settings editor (these are marked “hidden setting” below), but can be set manually by right clicking game.project and selecting Open With ▸ Text Editor.
The title of the application.
The version of the application.
When checked, the engine will write a log file log.txt in the project root. When running on iOS, the log file can be accessed through iTunes and the Apps tab and the File Sharing section. On Android, the file is stored in the app’s external storage. When running the dmengine development app, you can view the log with:
$ adb shell cat /mnt/sdcard/Android/data/com.defold.dmengine/files/log.txt
Specify the minimum log level for the logging system. Only logs at or above this level will be shown.
Enables compression of archives when bundling. Note that this currently applies to all platforms except Android where the apk already contains all data compressed.
A list of URLs to the project Library URLs. Refer to the Libraries manual for more information.
custom_resources
Custom resources are bundled in the main game archive using the Custom Resources field in game.project.
The Custom Resources field should contain a comma separated list of resources that will be included in the main game archive. If directories are specified, all files and directories in that directory are recursively included. You can read the files using sys.load_resource()
.
Loading custom resources is covered in more detail in the File Access manual.
bundle_resources
Bundle resources are additional files and folders located as a part of your application bundle using the Bundle Resources field in game.project.
The Bundle Resources field should contain a comma separated list of directories containing resource files and folders that should be copied as-is into the resulting package when bundling. The directories must be specified with an absolute path from the project root, for example /res
. The resource directory must contain subfolders named by platform
, or architecture-platform
.
Supported platforms are ios
, android
, osx
, win32
, linux
, web
, switch
A subfolder named common
is also allowed, containing resource files common for all platforms. Example:
res
├── win32
│ └── mywin32file.txt
├── common
│ └── mycommonfile.txt
└── android
├── myandroidfile.txt
└── res
└── xml
└── filepaths.xml
You can use sys.get_application_path()
to get the path to where the application is stored. Use this application base path to create the final absolute path to the files you need access to. Once you have the absolute path of these files you can use the io.*
and os.*
functions to access the files.
Loading bundle resources is covered in more detail in the File Access manual.
bundle_exclude_resources
A comma separated list of resources that should not be included in the bundle.
That is, they’re removed from the result of the collection of the bundle_resources
step.
File reference of the collection to use for starting the application, /logic/main.collection
by default.
Which render setup file to use, which defines the render pipeline, /builtins/render/default.render
by default.
A space separated list of directories that should be shared from your project via library sharing. Refer to the Libraries manual for more information.
Check to share a single Lua state between all script types, unchecked by default.
Allow the engine to continue running while the application window is iconified (desktop platforms only), false
by default.
The update frequency of the fixed_update(self, dt)
lifecycle function. In Hertz. 60 by default.
If the time step becomes too large during a single frame, it will be capped to this max value. Seconds. 0.5 by default.
The width in pixels of the application window, 960
by default.
The height in pixels of the application window, 640
by default.
Creates a high dpi back buffer on displays that support it. Typically the game will render in double the resolution than what is set in the Width and Height settings, which will still be the logical resolution used in scripts and properties.
How many samples to use for super sampling anti-aliasing. It sets the GLFW_FSAA_SAMPLES window hint. It is 0
by default, which means that anti-aliasing is turned off.
Check if the application should start full screen. If unchecked, the application runs windowed.
The desired frame rate in Hertz. Set to 0 for variable frame rate. A value larger than 0 will result in a fixed frame rate capped at runtime towards the actual frame rate (which means that you cannot update the game loop twice in an engine frame). Use sys.set_update_frequency(hz)
to change this value at runtime.
This setting also works in headless builds.
This integer value controls how the application deals with vsync. 0 disables vsync, and the default value is 1. When using an OpenGL adapter, this value sets the number of frames the window should update between buffer swaps. For Vulkan, there is no built-in concept of swap interval, the value instead controls if vsync should be enabled or not.
Specifies which display profiles file to use, /builtins/render/default.display_profilesc
by default. Learn more in the GUI Layouts manual.
Check if the app should dynamically switch between portrait and landscape on device rotation. Note that the development app does not currently respect this setting.
Clear color red channel, used by the render script and when the window is created.
Clear color green channel, used by the render script and when the window is created.
Clear color blue channel, used by the render script and when the window is created.
Clear color alpha channel, used by the render script and when the window is created.
Which type of physics to use, 2D
(default) or 3D
.
World gravity along y-axis, -10
by default (natural gravity)
Check if physics should be visualized for debugging.
Alpha component value for visualized physics, 0
–1
. The value is 0.9
by default.
Max number of concurrent physics worlds, 4
by default. If you load more than 4 worlds simultaneously through collection proxies you need to increase this value. Be aware that each physics world allocates a fair amount of memory.
World gravity along x-axis, 0
by default.
World gravity along z-axis, 0
by default.
Tells the physics engine how to scale the physics worlds in relation to the game world for numerical precision, 0.01
–1.0
. If the value is set to 0.02
, it means that the physics engine will view 50 units as 1 meter ($1 / 0.02$). The default value is 1.0
.
Check if the physics engine should apply the transform of a game object to any attached collision object components. This can be used to move, scale and rotate collision shapes, even those that are dynamic. true
by default.
Check if the physics engine should use fixed and framerate independent updates. Use this setting in combination with the fixed_update(self, dt)
lifecycle function and the engine.fixed_update_frequency
project setting to interact with the physics engine at regular intervals. For new projects the recommended setting is true
. false
by default
How big to draw unit objects in physics, like triads and normals, 30
by default.
How many collisions that will be reported back to the scripts, 64
by default.
How many contact points that will be reported back to the scripts, 128
by default.
Ignore contact impulses with values less than this setting, 0.0
by default.
The max number of 2d ray cast requests per frame. 64
by default.
The max number of 3d ray cast requests per frame. 128
by default.
The maximum number of overlapping physics triggers. 16
by default.
Specifies which filtering to use for minification filtering, linear
by default.
Specifies which filtering to use for magnification filtering, linear
by default.
The max number of render calls, 1024
by default.
The number of characters pre-allocated in the text rendering buffer, i.e. the number of characters that can be displayed each frame, 8192
by default.
The maximum number of debug vertices. Used for physics shape rendering among other things, 10000
by default.
The texture profiles file to use for this project, /builtins/graphics/default.texture_profiles
by default.
Verify the return value after each graphics call and report any errors in the log.
Compile and output SPIR-V shaders for use with Metal or Vulkan.
Seconds to wait before a held down input should start repeating itself, 0.5
by default.
Seconds to wait between each repetition of a held down input, 0.2
by default.
File reference of the gamepads config file, which maps gamepad signals to OS, /builtins/input/default.gamepads
by default.
File reference of the input config file, which maps hardware inputs to actions, /input/game.input_binding
by default.
Check to make the engine receive accelerator input events each frame. Disabling accelerometer input may give some performance benefit, checked by default.
If checked, a HTTP cache is enabled for faster loading of resources over the network to the running engine on device, unset by default.
Where to find the project build data, in URI format.
The max number of resources that can be loaded at the same time, 1024
by default.
The HTTP timeout in seconds. Set to 0
to disable timeout, which is the default.
The number of worker threads for the HTTP service.
Check to enable the HTTP cache for network requests (using http.request()
. The HTTP cache will store the response associated with a request and reuse the stored response for subsequent requests. The HTTP cache supports the ETag
and Cache-Control: max-age
HTTP response headers.
File containing SSL root certificates to use when verifying the certificate chain during SSL handshakes.
Max number of game object instances in a collection, 1024
by default. (See information about component max count optimizations).
Max number of game objects in the input stack, 16
by default.
Global gain (volume), 0
–1
, The value is 1
by default.
Max number of sound resources, i.e the number of unique sound files at runtime, 128
by default.
(Currently not used) Max number of concurrent sound buffers, 32
by default.
(Currently not used) Max number of concurrently playing sounds, 16
by default.
Max number of concurrent sound instances, i.e. actual sounds played at the same time. 256
by default.
If checked, the sound system will use threads for sound playback to reduce risk of stutter when the main thread is under heavy load. Checked by default.
Max number of sprites per collection, 128
by default. (See information about component max count optimizations).
Check to allow sprites to appear unaligned with respect to pixels, checked by default.
Max number of tile maps per collection, 16
by default. (See information about component max count optimizations).
Max number of concurrent visible tiles per collection, 2048
by default.
Max number of spine model components, 128
by default. (See information about component max count optimizations).
Max number of mesh components per collection, 128
by default. (See information about component max count optimizations).
Max number of model components per collection, 128
by default. (See information about component max count optimizations).
Max number of GUI components, 64
by default. (See information about component max count optimizations).
The max number of concurrent emitters, 64
by default.
The max number of concurrent particles, 1024
by default.
The max number of active animations in gui, 1024
by default.
Max number of labels, 64
by default. (See information about component max count optimizations).
Check to allow labels to appear unaligned with respect to pixels, checked by default.
The max number of concurrent emitters, 64
by default. (See information about component max count optimizations).
The max number of concurrent particles, 1024
by default.
Max number of collection proxies, 8
by default. (See information about component max count optimizations).
Max number of collection factories, 128
by default. (See information about component max count optimizations).
Max number of game object factories, 128
by default. (See information about component max count optimizations).
Image file (.png) to use as application icon at given width and height dimensions W
× H
.
Storyboard file (.storyboard). Learn more about how to create one in the iOS manual.
(iOS 6 and earlier) Check if your icons are pre-rendered. If this is unchecked the icons will get a glossy highlight added automatically.
The bundle identifier lets iOS recognize any updates to your app. Your bundle ID must be registered with Apple and be unique to your app. You cannot use the same identifier for both iOS and macOS apps. Must consist of two or more segments separated by a dot. Each segment must start with a letter. Each segment must only consist of alphanumeric letters, the underscore or hyphen (-) character (see CFBundleIdentifier
)
The bundle short name (15 characters) (see CFBundleName
).
The bundle version, either a number or x.y.z. (see CFBundleVersion
)
If specified, use this info.plist file when bundling your app.
The Apple Privacy Manifest for the application. The field will default to /builtins/manifests/ios/PrivacyInfo.xcprivacy
.
If specified, the entitlements in the supplied provisioning profile (.entitlements, .xcent, .plist) will be merged with the entitlements from the provisioning profile supplied when bundling the application.
If checked the Custom Entitlements will replace the ones in the provisioning profile when bundling. Must be used in combination with the Custom Entitlements setting above.
The language used if the application doesn’t have user’s preferred language in Localizations
list (see CFBundleDevelopmentRegion
). Use the two-letter ISO 639-1 standard if preferred language is available there or the three-letter ISO 639-2.
This field contains comma-separated strings identifying the language name or ISO language designator of the supported localizations (see CFBundleLocalizations
).
Image file (.png) to use as application icon at given width and height dimensions W
× H
.
Image files (.png) to be used as custom push notification icon on Android. The icons will automatically be used for both local or remote push notifications. If not set the application icon will be used by default.
Specifies which payload JSON field should be used as notification title. Leaving this setting empty makes the pushes default to the application name as title.
Specifies which payload JSON field should be used as notification text. If left empty, the text in the field alert
is used, just as on iOS.
An integer value indicating the version of the app. Increase the value for each subsequent update.
Package identifier. Must consist of two or more segments separated by a dot. Each segment must start with a letter. Each segment must only consist of alphanumeric letters or the underscore character.
Google Cloud Messaging Sender Id. Set this to the string assigned by Google to enable push notifications.
If set, use the specified Android manifest XML file when bundling.
Specifies which store to use. Valid options are Amazon
and GooglePlay
, GooglePlay
by default.
Specifies which method to use to get keyboard input on Android devices. Valid options are KeyEvent
(old method) and HiddenInputField
(new). KeyEvent
by default.
If set, hides the navigation and status bars and lets your app capture all touch events on the screen.
Whether or not the application can be debugged using tools such as GAPID or Android Studio. This will set the android:debuggable
flag in the Android manifest (official documentation).
Specifies whether the package installer extracts native libraries from the APK to the file system. If set to false
, your native libraries are stored uncompressed in the APK. Although your APK might be larger, your application loads faster because the libraries load directly from the APK at runtime. This will set the android:extractNativeLibs
flag in the Android Manifest (official documentation). true
by default.
Image file (.png) to use as application icon on macOS.
If set, use the specified info.plist file when bundling.
The Apple Privacy Manifest for the application. The field will default to /builtins/manifests/osx/PrivacyInfo.xcprivacy
.
The bundle identifier lets macOS recognize updates to your app. Your bundle ID must be registered with Apple and be unique to your app. You cannot use the same identifier for both iOS and macOS apps. Must consist of two or more segments separated by a dot. Each segment must start with a letter. Each segment must only consist of alphanumeric letters, the underscore or hyphen (-) character.
The language used if the application doesn’t have user’s preferred language in Localizations
list (see CFBundleDevelopmentRegion). Use the two-letter ISO 639-1 standard if preferred language is available there or the three-letter ISO 639-2.
This field contains comma-separated strings identifying the language name or ISO language designator of the supported localizations (see CFBundleLocalizations).
Image file (.ico) to use as application icon on Windows. Read more about how to create a .ico file in the Windows manual.
Specifies which store to use. Valid options are None
and Gameroom
, None
by default.
Heap size (number of megabytes) for Emscripten to use. By default this value is 256MB.
Use the specified template HTML file when bundling. By default /builtins/manifests/web/engine_template.html
.
Use the specified theme CSS file when bundling. By default /builtins/manifests/web/light_theme.css
.
If set, use the specified splash image on startup when bundling instead of Defold logo.
When bundling for HTML5 game data is split up into one or more archive data files. When the engine starts the game, these archive files are read into memory. Use this setting to specify the location of the data, archive
by default.
Suffix to be appended to the archive files. Useful to, for instance, force non-cached content from a CDN (?version2
for example).
List of arguments that will be passed to the engine.
Enables Fullscreen Button in index.html
file. By default true
.
Enables Made With Defold link in index.html
file. By default true
.
When enabled this option will print information about the engine and engine version in the browser console (using console.log()
) when the engine starts.
Specifies which method to use to scale the game canvas. By default Downscale Fit
.
The number of attempts to download a file when the engine starts (see Retry Time
).
The number of seconds to wait between attempts to download a file when the download failed (see Retry Count
).
Check to automatically finish IAP transactions. If unchecked, you need to explicitly call iap.finish()
after a successful transaction, checked by default.
If set, use the specified private key file when bundling live update content. If no key file is set, a key is generated.
If set, use the specified public key file when bundling live update content. If no key file is set, a key is generated.
If set, use the app manifest to customize the engine build. This allows you to remove unused parts from the engine to decrease the final binary size. Learn how to exclude unused feature in the application manifest manual.
If checked, enable CPU profiling in release versions of the builds. Normally, you can only access profiling information in debug builds.
The format of the settings file is simple text (INI format) and can be edited by any standard text editor. The format looks like this:
[category1]
setting1 = value
setting2 = value
[category2]
...
A real example is:
[bootstrap]
main_collection = /main/main.collectionc
which means that the setting main_collection belongs to the bootstrap category. Whenever a file reference is used, like the example above, the path needs to be appended with a ‘c’ character, which means you’re referencing the compiled version of the file. Also note that the folder containing game.project will be the project root, which is why there is an initial ‘/’ in the setting path.
When the engine starts, it is possible to provide config values from the command line that override the game.project settings:
# Specify a bootstrap collection
$ dmengine --config=bootstrap.main_collection=/my.collectionc
# Set two custom config values
$ dmengine --config=test.my_value=4711 --config=test2.my_value2=1234
Custom values can—just like any other config value—be read with sys.get_config()
:
local my_value = tonumber(sys.get_config("test.my_value"))
The game.project settings file contains many values specifying the maximum number of a certain resource that can exist at the same time, often counted per loaded collection (also called world). The Defold engine will use these max values to preallocate memory for this amount of memory to avoid dynamic allocations and memory fragmentation while the game is running.
The Defold data structures used to represent components and other resources are optimized to use as little memory as possible but care should still be taken when setting the values to avoid allocating more memory than is actually necessary.
To further optimize memory usage the Defold build process will analyse the content of the game and override the max counts if it is possible to know for certain the exact amount:
It is possible to define custom settings for the main project or for a native extension. Custom settings for the main project must be defined in a game.properties
file in the root of the project. For a native extension they should be defined in an ext.properties
file next to the ext.manifest
file.
The settings file uses the same INI format as game.project and property attributes are defined using a dot notation with a suffix:
[my_category]
my_property.private = 1
...
The default meta file that is always applied is available here
The following attributes are currently available:
// `type` - used for the value string parsing (only in bob.jar for now)
my_property.type = string // one of the following values: bool, string, number, integer, string_array, resource
// `help` - used as help tip in the editor (not used for now)
my_property.help = string
// `default` - value used as default if user didn't set value manually (only in bob.jar for now)
my_property.default = string
// `private` - private value used during the bundle process but will be removed from the bundle itself
my_property.private = 1 // boolean value 1 or 0
At the moment meta properties are used only in bob.jar
when bundling application, but later will be parsed by the editor and represented in the game.project viewer.
Did you spot an error or do you have a suggestion? Please let us know on GitHub!
GITHUB