News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

PlayBASIC

Started by kevin, August 08, 2003, 08:11:47 PM

Previous topic - Next topic

kevin





PlayBASIC is a programming language focusing upon the development of graphical 2D games.  While still heavily in development, the compiler has recently reached a mature state.  This language focuses on bringing a powerful command set to the users finger tips.

 The core design of the gfx engine is a first 2D languages.  Unlike other basic languages focusing upon gaming, PlayBASIC aims at producing a set of inbuilt commands and functions for the rapid development of complex 2D games.  This focus covers features from custom mapping, built in depth  and environmental controls to intelligent sprite command set.  Allowing you to spend more time creating, than scratching your head learning techniques.


Currently supported/In development features of PlayBASIC  ALPHA V2.21 are

Language Data Types:

* True Constants (Integer, Float, String, + Inbuilt Predefines)
* Global/Local & Static scope
* Integer, Floats & String Variables
* User Defined Types
* Integer(), Floating point#() and string$() Arrays
* User Defined Type Arrays
* Array Pointers (references) (pass arrays to functions/Sub by pointer.)
* Array Element Indexes (pointers to elements in arrays)



Language Core:

* Optional Forced Variable Declaration ( Pre-declare your variables)
* User Defined Functions.
* User Defined Protected Subroutines (i.e. Sub routine with parameters passing & encapsulated local scope)
* All the popular loop control structures. For/Next, Repeat/Until, While / EndWhile, Do/Loop. As well as optimized conditional loop structures such as Do/DecLoop
* Various none conditional control changes. Goto, Gosub, Exit, ExitFor, ExitDO, ExitRepeat, ExitWhile, Continue
* Conditional ON GOTO / ON GOSUB. (Featuring Jump Table Support)
* Embedded Data statements.
* Various inbuilt Array Manager Functions. If you want more power over your arrays, you'll love these..)
* SELECT/CASE statements with unary constant and dynamic case support. (Added 30,Jan,2004)


String and Math Support:

* Standard math operations. Add, Sub, Mult, Div, Powers.
* Binary Operations AND, OR, XOR, NOT, ROL, ROR
* Supported Bases Hex, Dec, Binary & Octal
* Math Functions INT(),FLOAT(),RND(),RNDRange(),Neg(),RoundUP(),RoundDown()
* Math Functions ABS(),EXP(),inc,dec,Cos().Sin().Tan(),CosRadius(),SinRadius()
* Math Functions CosNewValue(),SinNewValue(),Acos(),ASin(),ATan(),ATanFull(),SQRT(),Mod(),WrapValue()
* Swap, SwapIfLower,SwapIfHigher
* String Functions.. ASC(),VAL(),BIN$(),Hex$(),Str$(),Chr$(), Len(),Left$(),Right$(), Mid$(),trim$(),lower$()
* String Functions.. upper$(), AutoCaps$(string$), Insert$(),Make$(),Flip$(),Replace$(),Instring$(),Pad$()

* and more.



Compile Time:

* Full Hex, Binary and octal Parser support.
* Complete pre-evaluation of any constant expressions.
* Conditional compile time #IF / #IfDEF/ #IFNDEF / #ELSE / #ENDIF.
* Custom AutoCounter for incremental constant assignments



GFX Engine:

*Extremely fast 2D Blitter.
*2D Cameras/World Buffers - (Handles Draw Order, scene Clipping, gfx caches.. Multi camera available..  A First in 2D languages )
*Sprite Engine. (Z support, Rotation, Alpha Blending, Scaling.. Itelligent Collision and more)
*2D Tile Map Engine
*2D Vector Art (Dot, Line,Box,Circle,Ellipses.. All Supporting up to 7 different drawing modes)
*Vector Shapes (Draw custom polygon shapes, from Convex, Concave to Complex polygons)
*Images  (Includes effects like blur/fade/gray scale/ light)
*True Type and built in Bitmap Font Support


For all the most up to date information on PlayBASIC status / release dates/beta testing, check the forums or the home page.

Visit:

PLAYBASIC.com

PlayBASIC Documentation Online



kevin

#1
Update

 Added some example source codes and pictures of the current alpha version of play basic to play basic home page.


500 Sprite Tech Demo
 
 After only recently adding Sprite and image commands to PlayBASIC, here's the type of performance it's already capable of..  

 Demo Information:
 =================

  Sprite Size: 64*64
  Number of Sprites: 500
  Screen Size: 800 * 600
  Screen Depth: 16bit

 Performance:
 ============

  43 fps,  On Duron 800, Win Me, GF2mx 200.  


 Requirements
 ============

 NO 3D hardware
 Direct X 1.0 or above. Will run on all windows systems


 For run time pictures and the example (un opt'd) code check.   For the latest info, tech demos and future beta testing join the UW mailing list.

http://www.PlayBASIC.com


kevin

#2
Updated features of PlayBASIC Alpha V1.27)

Language Data Types:

* User Defined Type Structures
* User Defined Type Variables
* User Defined Type Arrays
* Type and Type Array Pointers (references) (pass arrays to functions/Sub by pointer.)



Language Core:

* Redim() resize arrays (Integer,Float,Strings or Types) real time.



Command Sets:

* DLL Libraries (DLL Support).  
* Image Library Updates.    (added, Blur, Fade,Mirror,Mask,GrayScale,Scroll)

kevin

Updated features of Play Basic Alpha V1.34)

The language now has over 350 commands.   There are 3 main command sets (that come to mind) to implement.  Sound support, Mapping and Entities.  While these command sets will make up the most powerful part of the language, all up there's unlikely to me more than 100 commands spread across the 3 of them.  The entity system for example is largely based upon then existing gfx command sets, so were probably about 75% of the way there to the initial demo releases..  


Command Sets:

* Shape Library (Render user definable convex, concave or even complex polygons, includes collision support).
* Disc & File System  Library  (added, over 50 commands to make your interaction with files so much easier, from nest folder scanning, random access through to even various custom string functions for dealing with paths/filenames)

kevin

Updated features of Play Basic Alpha V1.37)

 Over the past few weeks the entities and map libraries have been under development.  The entities library still has a long way to go before seeing it's way inside a release version, but an early version of the map library is now in.   The results have been very encouraging.  It's more than capable of running the two test maps (from xenon 2000) plus backdrop (640*480*32) at over 85fps  (duron 800, GF2 mx200)  The demo was also tested upon a P2 300/Geforce system and clocked in at a solid 75fps (640*480*16).    


Command Sets:

* Map Library ( A powerful collection of commands to make map creation and management a breeze)

kevin

#5
Updated features of PlayBASIC Alpha V1.55)

The biggest changes since the last update have been bug fixes and to the compiler/interpreter core  in general. Namely it's building o the EXE format and linker tools.  These allow the compiler to produce stand alone exe's of your work in one easy click.   PlayBASIC exe's have two selectable modes, RELEASE and DEBUG.

RELEASE mode is the fastest and smallest of the possible choices.  It's also for programs for which have been largely tested and are know to be solid.  Release mode doesn't include any Run Time error trapping in your program.  So a program that accesses an array out of bounds for example, is likely to crash without warning, or do strange things.   When in doubt, compile your program in debug mode.  

DEBUG mode is slightly slower and has a larger exe size when compared to RELEASE mode.   The advantage of DEBUG exe's is that you can now give out exe's to your friends, whom will be able to help trap errors in your program.  Unlike other languages, PlayBASIC's DEBUG exe's format is not only capable of reporting an error number and it's meaning, but it can also report the LINE Number where this error occurred in the original source.    It does NOT however include any of your source codes into the exe.  


Command Sets:
* Binary Math Library ( A powerful collection of BIT level commands)

kevin

Updated features of Play Basic Alpha V1.65)

The most recent additions have again been to the internal compiler and interpreter.  These changes now allow PB to have true local scope within Functions, and even STATIC variables.   So now PB has GLOBALs, LOCALs and STATICs.

STATIC variables are persistence between function calls.  Their declaration is only useful within FUNCTION calls.  PSUB (protected Subroutines) use static variable by default.  That's the major difference between to the two call conventions.  

LOCAL variables enforces a variable to take local precedence over any other previously defined Global definitions of this variable name/type.

I'm looking into the possibility of PUBLIC and PRIVATE declarations also.  If feasible these will most likely appear through a special 'code library'.   While it'd look similar to a class in say VB say, it'd be more like a Module.   However this should allow for code libraries to be shared with the absolute minimal amount of variable/array/function name clashing.  This is still however a bit of theory.  So we'll see

Command Sets:
* Font Support (Type Type (windows) and Custom Bitmap Font)

kevin

Updated features of Play Basic Alpha V1.81)

 Since, it's been almost two months from the last update.  I'll try and go through the new additions.  Those being,  the 2D Camera System, Sprite and array system updates and Time/Date Support, .

  The Camera is perhaps the most major and radical design change of any 2D orientated programming language to date.  .  Radical in the sense that when activated ,your no longer render to the screen directly, but as gfx commands are processed to the world buffer.  Your  view port is displayed from the cameras perspective.

  The main benefit here is that the cameras gives, si that takes the major reasonability's off your shoulders, those being, render order and transformation/clipping your world to the view port.  Since the drawing process is Z buffered (per item / not pixel) you get abilities and by products, you just can't easily do in other languages, if at all.

  For example, like mixing vector gfx (text/dots/lines/boxes/circle/shapes/polygons etc) with the mapping and sprites layers. So lines could be drawn in front of some sprites and behind others.  As these entities have their own Z priority as do each sprite.  So they could move in and out of the scene, just any other element. 

  The Camera concept doesn't replace traditional hands on rendering (drawing gfx immediately), just gives users a more powerful option.  You can use up to 16 cameras. Each camera can draw to any particular surface/view port you like, in any order you like.   This enables the cameras to be used to  render to images, which are then use within another camera.

  While working with a camera your dealing with world space, rather than screen space.  This allows your to control your sprites/maps in world space and the camera works out what's visible.   For example, to create a character in scrolling world.  You'd load your map/player images/sprites, set up the camera size.  To draw/update it, you draw the map at it's fixed position, handle the sprites controls and then position the camera at the players position, and PB takes care of the rest for you.

 For the compiler, the most recent major addition has been the addition of special pointer arrays.  These function allows you to pass arrays around, via an index, rather than explicit array handle. (ie. MyArray() ).  This allows you dynamically select arrays at run time, and access them through the pointer array.  

For example.

 Dim Table1(100)
 MakeArray  Me()
 SetArray ME(),GetArray(Table1())
 Me(1)=100

As you can see this is  way to manually pass the array index. The indexes are just integer values, You can store these indexes anywhere you like.  In the current tech demo i'm store lists of animation frames in a bunch of arrays, then using a pointer array to get the set of frames I want.

 I.e


 Dim Alien_BAdGuy1(1)
 Dim Alien_Bill(1)
 Dim Alien_Joe(1)
 LoadAnim Alien_BadGuy1(),frames,width,height
 LoadAnim Alien_BILL(),frames,width,heitght
 LoadAnim Alien_JOE(),frames,width,height

Dim Aliens_Anims(10)
Alien_Anims(1)=GetArray(Alien_BadGuy1())
Alien_Anims(2)=GetArray(Alien_BILL())
Alien_Anims(3)=GetArray(Alien_JOE())


So now in the animation update code, i've got this.



MakeArray Animation()

SetArray Animation(),Alien_Anims(Alien(lp).AlienType)

SpriteImage ThisSprite,Animation(Alien(lp).BaseFrame+Alien(lp).CurrentFrame)

speed=Alien(lp).CurrentFrameSpeed+1
if speed=>Alien(lp).FrameSpeedMax
speed=0
CurrentFrame=Alien(lp).CurrentFrame+1
if CurrentFrame=>Animation(0) then currentframe=0
Alien(lp).CurrentFrame=CurrentFrame
endif

Alien(lp).CurrentFrameSpeed=speed




Well, i'll you all dissect that.  The benefit here is that your virtually treating Arrays like memory banks, without loosing the familiar array interface.  So while it's little more difficult to grasp  conceptually, it's a lot easier on the user, then using memory banks directly.


Command Sets:

* Multi 2D Camera/Scene Support (View/Drive your Game through a Camera interface)
* Sprites Updates  (now support rotation/alpha blending)
* Time/Date Support
* User Definable Pointer Arrays

kevin

Updated features of Play Basic Alpha V1.85)

The most recent additions have been  Memory Banks and HTTP support.  

Banks allow you to manipulate/allocate banks of raw memory directly.  While these are well complemented with the binary command set already, I'm still hoping to integrate these further with the existing array system. But we'll see

Http support allows your program to communicate with web sites. This communication can be either immediate, or asynchronous.  And supports up to 32 simultaneous connections.      


Command Sets:
* Banks (User Definable Memory Banks/MemoryAllocation)
* HTTP (Web Access)

kevin

Updated features of Play Basic Alpha V1.93)

The past few weeks have seen the built in Mapping command set  grow dramatically.  From a raw frame work, now to a powerful base.  The library focus is to make handling and rendering of tile maps much easier on the user.  So the commands are designed to give us easy controls to create tile/update animations, create/copy/clone (and more) Level maps and build block GFX ..

The mapping system is built in a such way that the user can handle up to 32 different maps in memory at once.  A map is not just a rectangular grid of data, it's actually a complex parent structure, with various dependant data structures. Those being GFX BLK data, Levels and Animations.   So each map has a set of unique tile gfx associated with it (limit of 1024 GFX blk ), as well  unlimited (only by system memory) number of levels and  up to 64000 animation tile sets.  

Other recent changes have to how the data commands have been implemented.  Traditional basic's generally offer a quite limited set of READ/RESTORE/DATA commands.  While these are ok, they can be quite inflexible. In order to counter this limitation, we've given the user the ability to dynamically  read/step/search through data.  

 Ie.  So in PB you can now search for STRiNGs in your data statements, rather than hard coding Restore points with labels.


 Restore FindData("Middle",0,0)
  Data "Start"
  Data 1,2,3
  Data "Middle"
  Data 4,5,6
  Data "End"
  Data 7,8,9




Command Sets:
* Mapping Commands (Animation, Level controls)
* Improved DATA support (dynamic indexing)

kevin

Updated features of Play Basic Alpha V1.97)

The most recent addition to play has been the integration of what are called World Buffers.   World buffers allow the programmer to statically capture 2D operations into a buffer.  This allows the user to pre-build complex 2D scenes with Z depth.  These scenes can then be viewed/translated to the screen through the camera system.  This allows for great performance and removes the need for the user to translate their world information to the screen manually.


Command Sets:
* World Buffer  (Basic Static Buffers and Camera Translation)

kevin

#11
Updated features of PlayBASIC Alpha V2.04 (v2.01f)


 Development has been split across various fields over recent months.  Due to this split development, we've been forced to skip forward the V2.01 revision of the compiler to V2.04.  This means we now  have two editions of PlayBASIC ALPHA v2.04, one with the new hybrid interpreter, and this older edition.   Officially V2.01 is the last in that line, but rather than delay a release again, were going to release this edition of 2.04 as the demo, when the doc's are in place.   Anyway, so there is much less work focusing upon the compiler now.   The most notability new works has been upon the new IDE (PlayWrite) and  tools (Play Mapper).

 PlayWrite is coming along rapidly and is already approximately 70% complete for V1.0 release.  It features syntax highlighting, case correction, multiple project instances, an include manager and wonderful source inspector.  The source inspector not only keeps track of Functions and Label declarations, but also, Types, Global, Constants and even data.

 PlayMapper (Classic) is 2D Tile Mapping tool that is actually written in PlayBASIC.  This tool is completely open source, so users are free add their own features when need.  It features a custom GUI interface,  multiple layer support, Various drawing tools, entities (partly implemented at the time of writing) and more.