Computer Science    
   
Table of contents
(Prev) DarkBASIC ProfessionalDarknet (Next)

DarkBASIC

DarkBASIC is a commercial game creation programming language released by The Game Creators. The language is a structured form of BASIC and is similar to AMOS on the Amiga. The purpose of the language is game creation using Microsoft's DirectX 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 allow a total novice to make playable games after following its tutorials.

Contents

DarkBASIC

DarkBASIC is a programming language that specializes in the creation of games. It can create both 2D and 3D games, providing function libraries that enable a game to be programmed with considerably less code than with a language such as C++ without such dedicated libraries. DarkBASIC consists of an IDE, Debugger and interpreter, and an engine built on DirectX 7. The compiler emitted Bytecode that is appended to an interpreter to create a stand alone executable.

It was first released in 2000 by DarkBasic Software Ltd (now The Game Creators Ltd.). In 2002, The Game Creators released an updated version called DarkBASIC Professional able to use newer versions of DirectX. The pre-Professional version is informally referred to as DarkBASIC Classic to distinguish between the products.

The current DarkBASIC Classic 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.

Screenshot of Dark Basic version 1.14


Features of DarkBASIC

Audio/VideoExtensionSave
WaveWAVYes
Windows MediaWMA
Mpeg Layer 2MP2
Mpeg Layer 3MP3
MIDI PlaybackMIDI
RMIRMI
Scream trackerS3M
Fast TrackerXT
Impule TrackerIT
SoundTrackerMOD
CD AudioCDA
2DExtensionSave
BitmapBMPYes
Run Length Encoded BMPRLE
Device Independent BitmapDIB
Portable Network GraphicsPNG
JPEGJPGYes
DirectDraw SurfaceDDS
TargaTGA
PCXPCX
PhotoShopPSD
Tagged Interchange FormatTIFF
3DExtensionSave
3D Studio3DS
DirectXX 
Dark Basic ObjectDBOYes

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 support became available in an expansion pack.

Display

Input/Output

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

Video and Audio

  • Video Animation Control
  • Audio Control

2D

  • Super-Fast 2D blitting
  • Mirror, Stretch, Blur and Fade
  • Screen-Sized and animated sprites
  • Transparency
  • Fast pixel perfect Collision
  • 2D Drawing Functions

3D

  • Landscape Terraforming
  • Built-in 3D Primitives
  • Polygon Collision Detection
  • Full Model Manipulation
  • Model Animation
  • Ambient lighting
  • Directional Lighting
  • Texture filtering
  • Alpha blending
  • Fogging

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. 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 Structs in C. 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 with an embedded string resource detailing the routines implemented in the dll.[1] At compile time the compiler bundles the relevant plugin dlls into the executable.[2]

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.[3] to integration with physics engines[4] or accessing a Database.

DarkGDK

Formerly known as Dark Game SDK, DarkGDK is the DarkBASIC Professional engine packaged up for use with Visual C++ or Microsoft .NET. It has been publicized as released with Visual C++ 2008, and is specially designed with IntelliSense for this edition. The DarkGDK can be used with Visual C++ 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 programming language. Like DarkGDK, PureGDK supports many of the same features and runs on DirectX 9.[5] 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.

Sample code

Hello world[6]

 PRINT "Hello world."WAIT KEYEND 

Simple Rotating Cube[7]

 REM 3D rotating cube demoSYNC RATE 60MAKE OBJECT CUBE 1,100DO XROTATE OBJECT 1,WRAPVALUE(OBJECT ANGLE X(1)+0.3) YROTATE OBJECT 1,WRAPVALUE(OBJECT ANGLE Y(1)+0.5) SYNCLOOPEND 

Rotating Cube in DarkGDK[8]

 #include "DarkGDK.h"void DarkGDK ( void ){ // set sync on and sync rate to 60 frames per second dbSyncOn   ( ); dbSyncRate ( 60 ); // make a cube 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 windowOpenWindow(0,0,0,640,480,"DarkB asic Professional - PureGDK",#PB_Window_SystemMenu|#PB_Wi ndow_ScreenCentered); Initialize the PureGDK screen as a child of window ID 0OpenDBWnd(WindowID(0),0,0,640,480); Set the sync rate to 60 frames per seconddbSyncRate(60); Make a cubedbMakeObjectCube(1,3); Loop until the escape key is pressed or the window is closedRepeat  dbXRotateObject(1,dbObjectAngleX(1)+0 .3)  dbYRotateObject(1,dbObjectAngleY(1)+0 .5)  dbSync()Until WindowEvent()=#PB_Event_CloseWindow Or dbKeyState(#VK_ESCAPE) 

See also

References

  1. ^ "Third Party Commands SDK". Developer.thegamecreators.com. http://developer.thegamecreators.com/ ?f=t03/index. Retrieved 2012-12-10.
  2. ^ "Darkbasic pro and classic exe format information". Winch.pinkbile.com. 2008-05-11. http://winch.pinkbile.com/wiki/index. php/Main/DbproExeFormat. Retrieved 2012-12-10.
  3. ^ "Matrix1Utils plugins collection". Forum.thegamecreators.com. http://forum.thegamecreators.com/?m=f orum_view&t=85209&b=18. Retrieved 2012-12-10.
  4. ^ NewtonDBPro - Newton Game Dynamics plugin.
  5. ^ "DarkGDK - Game Developer's Toolkit". Puregdk.com. http://puregdk.com. Retrieved 2012-12-10.
  6. ^ Darkbasic Professional user manual
  7. ^ "darkBASIC codebase". Thegamecreators.com. http://www.thegamecreators.com/?m=cod ebase. Retrieved 2012-12-10.
  8. ^ Dark Game SDK user manual

External links

(Prev) DarkBASIC ProfessionalDarknet (Next)