Your first game starts here
Build OpenDBC, try a demo, then make it your own. Already have a DarkBASIC project? Start with a compatibility check.
1. Build OpenDBC
You need Git, CMake 3.24 or newer, Ninja and a C++20 compiler (Visual Studio 2022 or newer on Windows).
On Linux, also install the GStreamer development packages (libgstreamer1.0-dev and
libgstreamer-plugins-base1.0-dev on Debian and Ubuntu). CMake downloads the other
dependencies, so the first build needs an internet connection. On macOS, OpenDBC builds for Apple silicon.
git clone https://github.com/demonixis/open-dbc.git
cd open-dbc
cmake --preset default
cmake --build --preset default
From the repository folder, launch the Studio using the path for your system:
| System | Command |
|---|---|
| macOS | ./build/default/tools/studio/opendbc.app/Contents/MacOS/opendbc |
| Linux | ./build/default/tools/studio/opendbc |
| Windows (PowerShell) | .\build\default\tools\studio\opendbc.exe |
The examples below use opendbc for brevity. Replace it with the path above, or add that
executable's directory to your PATH. Run the test suite with ctest --preset default.
2. Play a demo
From the repository folder, try Frost Outpost:
opendbc run examples/dbc/demos/frost_outpost/frost_outpost.dba --dialect dbc
Or open the Studio, open that .dba file, choose Classic if prompted and press
F5. The demo's media files are already beside its source.
3. Write your first program
Create hello.dba, or download it:
print "Hello!"
wait keyopendbc run hello.dba --dialect dbc
You have text on screen. Next, add colour and movement, or jump to your first 3D scene.
Classic or Professional?
Both profiles use .dba source files. A .dbpro file is a Professional project
that describes its sources and settings.
- dbc DarkBASIC Classic: a straightforward starting point for 2D and 3D games. The beginner tutorials use this profile.
- dbpro DarkBASIC Professional: user-defined types, typed variables and arrays, vector maths, effects and additional engine commands. The Studio's New Project starts in this profile, the one its Scene view edits.
Choose explicitly with --dialect dbc or --dialect dbpro. Otherwise, OpenDBC
uses project settings, a unique nearby .dbpro descriptor or syntax that identifies a profile.
If the choice is ambiguous, the command line reports an error; the Studio asks you to choose.
Bring an existing project
- Keep a copy of the original project and its media together. For Professional, open the
.dbprodescriptor to preserve source order and the media root. - Check it before running:
opendbc check game.dba --dialect dbcfor Classic, oropendbc check game.dbpro --dialect dbprofor Professional. - Look up diagnostics in the command reference. A compatibility stub accepts the call but does not perform the original feature. See current support and limitations.
- Run the project and test its graphics, sound and controls. A successful compile does not verify media loading or guarantee the same behaviour as the original engine.
Useful commands
| Command | What it does |
|---|---|
opendbc | Opens the Studio |
opendbc run game.dba --dialect dbc | Runs a Classic program |
opendbc check game.dba --dialect dbc | Compiles and verifies without opening a window |
opendbc inspect game.dba --dialect dbc --json | Inspects the program and writes a JSON report without opening a window |
opendbc build game.dba --dialect dbc --output game.obc | Writes a program image |
opendbc run game.obc | Runs the compiled image without BASIC sources; media files are still needed |
opendbc export game.dba --dialect dbc --target desktop --output dist --unsigned | Packages a development build for the host operating system into the existing dist folder |
A .obc image works with the OpenDBC build that produced it; rebuild it after updating
OpenDBC. Exports bundle a separate runner and the project's assets. Without --unsigned, an
export is a distribution build, which needs signing on macOS and Windows. For signing and mobile targets, see Platforms.
Useful keys
| F5 / Shift+F5 | Run / stop (Studio) |
| F3 | Toggle the debug overlay while a program runs |
| F4 | Write the scene and renderer state to text files |
Where media files go
For a standalone source, a relative path such as load image "bricks.jpg", 1 starts in
that .dba file's folder. A DBPro project uses its configured media root.
For a compiled image, the default is the image's folder. Use --asset-root DIR to choose another
location. Paths accept / or \; Windows drive letters and network paths need
adapting on macOS and Linux.