OpenDBC
Menu

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:

SystemCommand
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:

hello.dbaDownload
print "Hello!"
wait key
opendbc 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.

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

  1. Keep a copy of the original project and its media together. For Professional, open the .dbpro descriptor to preserve source order and the media root.
  2. Check it before running: opendbc check game.dba --dialect dbc for Classic, or opendbc check game.dbpro --dialect dbpro for Professional.
  3. 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.
  4. 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

CommandWhat it does
opendbcOpens the Studio
opendbc run game.dba --dialect dbcRuns a Classic program
opendbc check game.dba --dialect dbcCompiles and verifies without opening a window
opendbc inspect game.dba --dialect dbc --jsonInspects the program and writes a JSON report without opening a window
opendbc build game.dba --dialect dbc --output game.obcWrites a program image
opendbc run game.obcRuns the compiled image without BASIC sources; media files are still needed
opendbc export game.dba --dialect dbc --target desktop --output dist --unsignedPackages 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+F5Run / stop (Studio)
F3Toggle the debug overlay while a program runs
F4Write 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.

Make something with the tutorials Find a command