ShadowCentaur 2,
Quote: " I've made a 2d ascii based shooter in DBC but due to the slow sprite commands my framerate is frustratingly slow. Which is better in terms of 2D commands and speed, Dark Basic Proffessional or PlayBasic? "
Depends upon what you want to do with it. If the application is working how you want currently just slowly, and therefore you want to drag and drop it say, then both require some work on your part. It's difficult to say how much, having never seen the app/code in question.
In terms of raw 2D image blit speed PlayBasic is
leap years ahead of DB classic.
It's a different story if want loads of rotation. While the sprite rotation engine in PlayBasic is fairly fast considering (it's DX3), it's not the quickest thing on the planet though. So when comparing to current release editions of PB (V1.63 and bellow) to DBpro atm, it's a bit of lottery as to what's faster. While DBpro should be faster always (DX9), with a little clever design you can certainly keep up..
Too often people assume that render speed is be and end all, It's nice, I'm not disputing that.. But to be quite frank DBpro does not offer a complete 2D solution, it gives you parts then expects you to fill the gaps. One well documented gap is the lack of
any native pixel perfect collision solution. While this can be overcome with user software methods or recent plug in additions. They're not only rather expensive, they aren't very quick. So the extra rendering performance is soon lost in collision detection.
PlayBasic by designed tries to keep a proportional balance between the two, so we have fairly fast rendering and equally fast collision solutions built in. Ranging from vector to pixel perfect. Including mixed modes (vector to pixel perfect and vice versa).
In terms of number crunching (Code execution) PlayBasic (1.62 / 1.63) performance sits in-between the DB and DBpro. V1.63 can actually match and even beat Dbpro performance in certain circumstances. It often comes down to how well you utilize the embedded commands/features of the language. The more you embrace them, the more efficient (faster) your programs will become.
One distinction has to be made though. PlayBasic V1.62 (current demo) uses the original runtime engine, creatively referred to as VM1. PlayBasicV1.63 (current retail edition) uses some elements from VM2. Which this is obviously our second generation runtime environment. VM2 includes a lot of low level speed ups/design changes. Therefore 1.63 can be significantly faster than V1.62. In Particular with memory/array & string operations. Which are are virtually unavoidable when programming.
PlayBasic also ships with two editions of the runtime environment. Those being
Release and
Debug. The Debug edition is the basically the same runtime you use when testing your programs from the IDE. So it includes
nanny code to try and stop you from doing bad things..

.. The release edition has all safe code removed. This gives a hirer yield to the raw calculation performance. How much so is Dependent upon how much raw calculations your program do. But, 10%->20% isn't uncommon.
Porting Code
Initially new users could be forgiven for assuming that PlayBasic syntax is much like DB / DBpro. While there are obvious similarities, but once you get past those you'll discover that PlayBasic is a far more structured and strict then either DarkBASIC, Dark Basic Pro (DBPRO) combined. Interestingly this is commonly seen as bug by migrating DarkBASIC users trying to quickly dump their old DB code in PB.
One particular example commonly occurs with Accessing array elements. While you can get away with lots of potential 'illegal memory accesses' in DB/Dbpro. PB isn't that forgiving. If you write outside the bounds, it'll force a runtime exception.
Another thing you'll not doubt discover when moving DB/DBpro code to PB, is that PB doesn't have Bitmaps. Why ? as in PB you can render to/copy from any
image, making the need for the bitmap style solution totally redundant. However when porting DB game, you'll probably end up simulating them.
The other main difference (that comes to mind) is the packed word command names and naming convention that PlayBASIC uses. While DB/Dbpro use a broken word command names (ie Sprite X(SpriteIndex) ) PB uses a Packed format with
strict naming convention. (No spaces) So it becomes (GetSpriteX(SpriteIndex)) .
Command names in PlayBasic are also reversible. For example, if you set a sprites draw mode property (ie SpriteDrawMode SpriteIndex,Mode) you'd query this property using the equivalent
GET statement. Ie (Mode=GetSpriteDrawMode(SpriteIndex). So if you know how to set something in PB, you instantly know how to retrieve it.
Other conventions that come to mind are CREATE, NEW, DRAW. Effectively you can Mix the prefix with the media type and you get a valid command name.
CreateSprite,
CreateImage,
NewSprite(),
NewImage(),
DrawSprite,
DrawImage etc etc.. This means the command names indeed can be longer than the DB counterparts, but once you come to terms of the naming convention you can easily guess command names, even if you've never used the command set before.
Anyway, if you'd like me to port you've game for you as an experiment, just send it over and i'll give it a quick seeing too.