DarkBASIC
Encyclopedia
DarkBASIC is a commercial game creation programming language released by The Game Creators
The Game Creators
The Game Creators, Ltd. is a British game development software company formed through a partnership between programmer Lee Bamber and Richard Vanner in 1999, located in Lancashire, England, United Kingdom. The company was formerly known as DarkBASIC Software Limited.The company primarily develops...

. The language is a structured form of BASIC and is similar to AMOS on the Amiga
Amiga
The Amiga is a family of personal computers that was sold by Commodore in the 1980s and 1990s. The first model was launched in 1985 as a high-end home computer and became popular for its graphical, audio and multi-tasking abilities...

. The purpose of the language is game creation using Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

's DirectX
DirectX
Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with Direct, such as Direct3D, DirectDraw, DirectMusic, DirectPlay,...

 from a BASIC programming language. It is faster and easier to use than comparable languages, but also less powerful. It is marketed on its ability to take a total novice and have them making games with its tutorials.

DarkBASIC

Darkbasic is a programming language that specializes in the creation of games. It can create both 2D and 3D games using a lot less code than the equivalent program would take by using more powerful languages such as C++ due to the included libraries. It is often referred to as DarkBASIC Classic to avoid confusion with DarkBASIC Professional
DarkBASIC Professional
DarkBASIC Professional is a BASIC dialect targeted specifically at 2D and 3D game development. It is available from software company The Game Creators and is an offshoot of their original DarkBASIC programming language...

. It consists of an IDE
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

, Debugger
Debugger
A debugger or debugging tool is a computer program that is used to test and debug other programs . The code to be examined might alternatively be running on an instruction set simulator , a technique that allows great power in its ability to halt when specific conditions are encountered but which...

 and interpreter, and an engine built on DirectX
DirectX
Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with Direct, such as Direct3D, DirectDraw, DirectMusic, DirectPlay,...

 7. The compiler emitted Bytecode
Bytecode
Bytecode, also known as p-code , is a term which has been used to denote various forms of instruction sets designed for efficient execution by a software interpreter as well as being suitable for further compilation into machine code...

 that is appended to an interpreter to create a stand alone executable.
The current version is 1.21, released on 14 August 2008. Since the introduction of Darkbasic Professional, The Game Creators have stated that there will be no further updates to the language, although it will still be sold.

Features of DarkBASIC

Audio/Video Extension Save
Wave WAV Yes
Windows Media WMA
Mpeg Layer 2 MP2
Mpeg Layer 3 MP3
MIDI Playback MIDI
RMI RMI
Scream tracker S3M
Fast Tracker XT
Impule Tracker IT
SoundTracker MOD
CD Audio CDA
2D Extension Save
Bitmap BMP Yes
Run Length Encoded BMP RLE
Device Independent Bitmap DIB
Portable Network Graphics PNG
JPEG JPG Yes
DirectDraw Surface DDS
Targa TGA
PCX PCX
PhotoShop PSD
Tagged Interchange Format TIFF
3D Extension Save
3D Studio 3DS
DirectX X
Dark Basic Object DBO Yes


DarkBASIC is a wide language which covers all areas of game development typical of its time, hence it also includes a wide range of file formats typically used in games. Extra features such as multiplayer and EAX
Environmental audio extensions
The environmental audio extensions are a number of digital signal processing presets for audio, present in Creative Technology's later Sound Blaster sound cards and the Creative NOMAD/Creative ZEN product lines...

 support became available in an expansion pack.

Display

  • Automated Double Buffering
    Double buffering
    In computer science, multiple buffering is the use of more than one buffer to hold a block of data, so that a "reader" will see a complete version of the data, rather than a partially-updated version of the data being created by a "writer"...

  • Full-Screen open
  • Gamma Control
    Gamma correction
    Gamma correction, gamma nonlinearity, gamma encoding, or often simply gamma, is the name of a nonlinear operation used to code and decode luminance or tristimulus values in video or still image systems...


Input/Output

  • Mouse, Keyboard and Gaming controller input.
  • Force-Feedback Control
  • System Handling
  • File Handling

2D

  • Super-Fast 2D blitting
  • Mirror, Stretch, Blur and Fade
  • Screen-Sized and animated sprites
    Sprite (computer graphics)
    In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...

  • Transparency
  • Fast pixel perfect Collision
  • 2D Drawing Functions

3D

  • Landscape Terraforming
  • Built-in 3D Primitives
  • Polygon
    Polygon (computer graphics)
    Polygons are used in computer graphics to compose images that are three-dimensional in appearance. Usually triangular, polygons arise when an object's surface is modeled, vertices are selected, and the object is rendered in a wire frame model. This is quicker to display than a shaded model; thus...

     Collision Detection
  • Full Model Manipulation
  • Model Animation
  • Ambient lighting
    Ambient lighting
    Ambient lighting can refer to:* Available light in an environment* Low-key lighting, a photographic technique using a single key light* A type of lighting in computer graphics...

  • Directional Lighting
  • Texture filtering
    Texture filtering
    In computer graphics, texture filtering or texture smoothing is the method used to determine the texture color for a texture mapped pixel, using the colors of nearby texels . Mathematically, texture filtering is a type of anti-aliasing, but it filters out high frequencies from the texture fill...

  • Alpha blending
  • Fogging
    Distance fog
    Distance fog is a technique used in 3D computer graphics to enhance the perception of distance by simulating fog.Because many of the shapes in graphical environments are relatively simple, and complex shadows are difficult to render, many graphics engines employ a "fog" gradient so objects further...


DarkBASIC Professional

Developed as a replacement for DarkBASIC. As with DarkBASIC it consisted of an IDE, debugger and compiler. Unlike DarkBASIC, the DarkBASIC Professional compiler outputs Machine Code
Machine code
Machine code or machine language is a system of impartible instructions executed directly by a computer's central processing unit. Each instruction performs a very specific task, typically either an operation on a unit of data Machine code or machine language is a system of impartible instructions...

. The engine originally used DirectX 8.1 but has been updated to use DirectX, 9.0c.
The language is essentially the same as DarkBASIC with a few additions. Notably types which allow combining simple data types into a composite data type similar to Struct
Struct
struct is a computer science term for a record that is used to store more than one value.struct is used in the following programming languages:* struct * struct vs. C++ classes...

s in C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

. Other features include the use of shaders, 3D maths commands and vertex editing commands.
The current version is 7.61 released 1st June 2011.

Plugin architecture

Plugins allow extra commands to be added to the language. Plugins are DLLs
Dynamic-link library
Dynamic-link library , or DLL, is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems...

 with an embedded string resource
Resource (Windows)
In Microsoft Windows, resources are read-only data embedded in EXE, DLL, CPL or MUI files.The Windows API provides for easy access to all applications' resources.-Types:...

 detailing the routines implemented in the dll. At compile time the compiler bundles the relevant plugin dlls into the executable.

Interestingly built-in commands are also implemented in the same way. This allows third party plugins access to built-in commands by calling the correct function in the relevant dll.

Currently available plugins provide a wide range of addition commands from language extensions and utility functions. to integration with physics engine
Physics engine
A physics engine is computer software that provides an approximate simulation of certain physical systems, such as rigid body dynamics , soft body dynamics, and fluid dynamics, of use in the domains of computer graphics, video games and film. Their main uses are in video games , in which case the...

s or accessing a Database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...

.

DarkGDK

Formerly known as Dark Game SDK, DarkGDK is the DarkBASIC Professional engine packaged up for use with Visual C++
Visual C++
Microsoft Visual C++ is a commercial , integrated development environment product from Microsoft for the C, C++, and C++/CLI programming languages...

 or Microsoft .NET. It has been publicized as released with Visual C++ 2008, and is specially designed with IntelliSense
IntelliSense
IntelliSense is Microsoft's implementation of autocompletion, best known for its use in the Microsoft Visual Studio integrated development environment...

 for this edition. The DarkGDK can be used with Visual C++
Visual C++
Microsoft Visual C++ is a commercial , integrated development environment product from Microsoft for the C, C++, and C++/CLI programming languages...

 and is available as a free download, Games created with DarkGDK can be distributed for free, however, in order to sell your game made with DarkGDK, you must purchase a license about 22€ EUR. DarkGDK.NET product is available for purchase and allows access to the DarkBASIC engine from C# and VB.NET.

PureGDK

PureGDK is an implementation of the DarkBASIC Professional engine for the PureBasic
PureBasic
PureBasic is a commercially distributed procedural computer programming language and integrated development environment based on BASIC and developed by Fantaisie Software for Windows 32/64-bit, Linux 32/64-bit, and Mac OS X. An Amiga version is available, although it has been discontinued and...

 programming language. Like DarkGDK, PureGDK supports many of the same features and runs on DirectX
DirectX
Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with Direct, such as Direct3D, DirectDraw, DirectMusic, DirectPlay,...

 9. An additional license for the commercial PureBasic language is required to use it.

The software comes in two editions: PureGDK Upgrade and PureGDK Complete. PureGDK Upgrade is designed to accommodate existing users of DarkBasic Professional by offering a low-cost upgrade path. PureGDK Complete is a stand-alone product for users who don't already own the engine by providing licenses for both DarkBasic Professional and PureGDK. Either solution still requires the user to own or purchase a license for PureBasic.

Simple Rotating Cube

 
REM 3D rotating cube demo

SYNC RATE 60

MAKE OBJECT CUBE 1,100

DO
XROTATE OBJECT 1,WRAPVALUE(OBJECT ANGLE X(1)+0.3)
YROTATE OBJECT 1,WRAPVALUE(OBJECT ANGLE Y(1)+0.5)
SYNC
LOOP
END

Rotating Cube in DarkGDK

 
  1. include "DarkGDK.h"


void DarkGDK ( void )
{
// set sync on and sync rate to 60 frames per second
dbSyncOn ;
dbSyncRate ( 60 );

// make a cube caca
dbMakeObjectCube ( 1, 10 );

// loop until the escape key is pressed
while ( !dbEscapeKey )
{
// Turn the cube left
dbTurnObjectLeft ( 1, 6 );
// update screen
dbSync ;
}
}

Rotating Cube in PureGDK

 
Open a PureBasic window
OpenWindow(0,0,0,640,480,"DarkBasic Professional - PureGDK",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)

Initialize the PureGDK screen as a child of window ID 0
OpenDBWnd(WindowID(0),0,0,640,480)

Set the sync rate to 60 frames per second
dbSyncRate(60)

Make a cube
dbMakeObjectCube(1,3)

Loop until the escape key is pressed or the window is closed
Repeat
dbXRotateObject(1,dbObjectAngleX(1)+0.3)
dbYRotateObject(1,dbObjectAngleY(1)+0.5)
dbSync
Until WindowEvent=#PB_Event_CloseWindow Or dbKeyState(#VK_ESCAPE)

See also

  • DarkBASIC Professional
    DarkBASIC Professional
    DarkBASIC Professional is a BASIC dialect targeted specifically at 2D and 3D game development. It is available from software company The Game Creators and is an offshoot of their original DarkBASIC programming language...

  • DarkMATTER
    DarkMatter (programming)
    -What Is DarkMatter?:DarkMatter is a collection of 3D models And Textures published by The Game Creators, primarily for use with the company's programming products: DarkBasic and DarkBasic Pro...

    , a set of models released by The Game Creators for use with DarkBASIC
  • FreeBASIC
    FreeBASIC
    FreeBASIC is a free/open source , 32-bit BASIC compiler for Microsoft Windows, protected-mode DOS , Linux, FreeBSD and Xbox....

  • Multimedia Fusion 2

External links

  • The Game Creators website - http://www.thegamecreators.com
  • The Game Creators' Forums - http://forum.thegamecreators.com/
  • WikiBooks - Learn how to Program DarkBASIC - http://en.wikibooks.org/wiki/DarkBASIC_Programming
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK