Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Road to PlayBasicFX

Author
Message
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 15th May 2009 16:01
PlayBasic V1.64j Beta #10

PB V1.64j10 is the latest beta of PB V1.64 retail update. This version corrects a few issues with the pre-compiled bindings from the previous beta as well as adds support for auto parameter casting on externally bound functions. This allows you to call externally linked functions and mix a match integers/floats as the parameters. A word of caution though, I wouldn't rely upon auto casting if performance is high requirement. If it's an issue, keeping the data types the same is the best bet as always.

Also, i've included an update of the BlitImage library. This version has a new wrapper for the AlphaPostMultColour function. Used to create the 'blur-o-vision" effects. You can do the same thing with Box (see InkModes), but whatever floats your boat.



PlayBasic V1.64j Beta #11

PB V1.64j11 is the latest beta of PB V1.64 retail update. This tweaks the bindings more and is starting to look like the release version. In fact from here there's only a few tiny changes left to make, as such, you should test this version with your projects now.


Download Beta's @ UnderwareDesign.com

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 19th May 2009 16:17 Edited at: 27th Jul 2011 18:05


Choose a new PlayBasic.com template


I'm looking for a suitable template for use as the new PlayBasic home page. The homepage will take everything from the PB product page and basically split that into a separate site. So product dizzies, news, downloads, screens, demos and links for starters.


I've been looking around and there's really too many sites to cover, so if you have interest in PB, then get off your back side and help us locate some template possibilities. Once we've enough, we'll then vote them down.


Want to help ? - See (OLD LINK REMOVED)

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 20th May 2009 07:54 Edited at: 20th May 2009 07:55
Play Basic V1.64 J BETA #12

PB V1.64j12 is the latest beta of PB V1.64 retail update. This adds support for externally bound functions to appear in the IDE keyword listing, as well adding optional expression support to DO / LOOPS structures.


ie.




Download Beta's @ UnderwareDesign.com

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 23rd May 2009 17:41 Edited at: 27th Jul 2011 09:59
Play Basic V1.64 J BETA #13

PB V1.64j13 is the latest beta of PBV1.64 retail update. This revision rounds off what will become the release edition of the V1.64J update. The changes since the previous beta are some graphics library and parser level bugs fixes, as well as a few new math commands from FX math lib.


Download Beta's @ UnderwareDesign.com




Attachments

Login to view attachments
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 1st Jun 2009 15:09 Edited at: 27th Jul 2011 10:03



PlayBasic V1.64j _Retail Upgrade_ is Now Available (1st, June, 2009)

This release updates the existing PB1.63w2 retail release to the current retail release version of PlayBasic V1.64j. Therefore you'll need to install patch PB1.63w2 (at least) prior to this one ! (if you haven't already)

The PB1.64j package includes updates of PB Compiler, Release / Debug Runtimes, SLIBS, DOCS & IDE V1.17. The main new additions in this editions are lots of new optimizations. Faster bilinear filtering, polygons , binding etc etc


For more information about PlayBasic, please visit the Play Basic home page and download the FREE learning edition and dive in.

Url: www.PlayBasic.com


Update Gallery




PlayBasic V1.63 -> PlayBasic V1.64 Gallery


Download Upgrade

See announcement to Download Upgrade



Attachments

Login to view attachments
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 8th Jun 2009 15:15 Edited at: 29th Jun 2009 07:21
PlayBasicFX V1.75 BETA #2 (Avail for Registered Users ONLY)

PBFX V1.75 editions are a continuation of the migration away from the Vm1 environment (found in PlayBasic) to a pure VM2 environment.

This beta adds some of the more recent parser changes and buffer overflow tweaks (added to PB1.64i editions) to the PBFX parser.


Download

Get Beta @ UnderwareDesign.com

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 11th Jun 2009 18:54 Edited at: 29th Jun 2009 07:15
PlayBasicFX V1.75 BETA #3 (Avail for Registered Users ONLY)

PBFX V1.75 editions are a continuation of the migration away from the Vm1 environment (found in PlayBasic) to a pure VM2 environment.

This beta corrects a mainly allocations bugs int he VM2 memory manager.



Download

Get Betas @ UnderwareDesign.com

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 17th Jun 2009 18:41 Edited at: 29th Jun 2009 07:12
PlayBasicFX V1.75 BETA #4 (Avail for Registered Users ONLY)

PBFX V1.75 editions are a continuation of the migration away from the Vm1 environment to a pure VM2 environment.

This beta comes closer to that objective as it moves the pre-compiled byte code module into PBFX. This takes the place of having to compile the bindings prior to user code. This makes the slibs/declarations.pba file obsolette, as such make sure you copy the new bindings.pbvm2 file into the main PBFX folder.

Download

Get Betas @ UnderwareDesign.com

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 25th Jun 2009 09:34 Edited at: 27th Jul 2011 09:42
PlayFont (basic edition) V0.01

This initial version of PlayFont is purely for the quick conversion of windows bitmap (2bit) and windows true type fonts (8bit) into PlayBasic V1.64's CRF format.

The tool simply lets the user select a windows font, then it converts it into CRF for you. You can view it in the main display window. Moreover, you can change the display message by entering your own message in the input box at the bottom. Just so you can check particular characters. At the moment the tool has no low level editing (ie. individual chr widths ) so there's not too much to it.





Download

Download PlayFont (Basic Edition) V0.01

Attachments

Login to view attachments
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 27th Jun 2009 15:55 Edited at: 25th Mar 2011 06:04
Edit: Nevermind discount expired

BMacZero
17
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 28th Jun 2009 06:30
Man, I think you have the most posts in a row of anyone on the forum . You sure are determined when it comes to this.



Diggsey: I have a spine and memory, but one memorable guy says he hates me. What am I?
LBFN
15
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 28th Jun 2009 07:29
Kevin:

You are indeed a man on a mission. Have you thought of making a number of upgrades and then releasing a new version/upgrade? I have considered PB, but these continual upgrades/changes give me pause. Don't get me wrong; upgrades = good. Having to download/ install this week's upgrade to run this or that = annoying.

My $.02


So many games to code......so little time.
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 28th Jun 2009 20:52
BMacZero,

Quote: "Man, I think you have the most posts in a row of anyone on the forum"


I don't really expect people to reply. So it's odd they do - This is just a blog of sorts for TGC PLayBasic customers to keep up on what's happening in the PlayBasic world.

http://playbasic.thegamecreators.com


LBFN:


Quote: "Have you thought of making a number of upgrades and then releasing a new version/upgrade?"


That's how upgrades are already issued.


Quote: " I have considered PB, but these continual upgrades/changes give me pause. Don't get me wrong; upgrades = good. Having to download/ install this week's upgrade to run this or that = annoying."


I think you're confusing beta's with upgrades. During development of any new upgrade, we issue beta versions on the regular basis to forum users. These are not upgrades though, just the current WIP version that's under review. Ideally this should mean any new functionality is ironed out long before it's in release version. At the end of the upgrades dev cycle, we issue the official upgrade patch.

On average there's 2 to 3 months between each upgrade. The only exceptions are when bugs are not trapped during the beta testing and a replacement upgrade has to be built.

LBFN
15
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 29th Jun 2009 00:30 Edited at: 15th Aug 2010 23:12
Perhaps "updates" would have been a better word than "upgrades", but my point is that since 5/15/09, you have done the following:
5/15 dl PB V1.64j Beta #11
5/20 dl PB V1.64J Beta #12
5/23 dl PB V1.64J Beta #13
6/1 PB V1.64J retail upgrade (must install patch PB 1.63w2)
6/8 dl PBFX V1.75 Beta #2 (I don't know the difference, if any, from PB and PBFX)
6/11 dl V1.75 Beta #3
6/17 dl V1.75 Beta #4

It's great that you are continually developing the software, but it seems like it is always in a state of flux.

So many games to code.......so little time.
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 29th Jun 2009 07:38 Edited at: 29th Jun 2009 07:50
You're confusing retail beta's with retail updates/upgrades. Retail beta announcements are the WIP builds of the coming upgrade (whatever edition it happens to do). In Dbpro terms, they're the equivalent of this

Here's the list of all of the PlayBasic upgrades from the last 12 months.


PlayBasic V1.64j _Retail Upgrade_ is Now Available (1st,June, 2009)

PlayBasic V1.64i _Retail Upgrade_ is Now Available (5th, Mar, 2009)

PlayBasic V1.64h _Retail Upgrade_ is Now Available (12th, Jan, 2009)

PlayBasic V1.64c Retail Upgrade is Released (30th, Sep, 2008)

PlayBasic V1.64 Retail Upgrade is Released (2nd, Sep, 2008)


Since the 1st,Jan,2007 we've released 14 upgrades PlayBasic. Which averages out to about a upgrade every 2 or so months.

The current edition of PlayBasic (V1.64j) still runs the vast majority user source code from PlayBasic V1.02 (28th,10,2004), without change.

LBFN
15
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 29th Jun 2009 17:37 Edited at: 15th Aug 2010 23:14
___

So many games to code.......so little time.
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 28th Jul 2009 17:06 Edited at: 27th Jul 2011 10:07
Frame Sheet Animation Library V0.02

This update corrects a few bugs in the original library and expands the frame sheet command set. There's also a new example included (beat'em up), to help demonstrate how to manage multiple character animations.

Have fun !

Download

Frame Sheet Animation Library




Spooky Shadows

This is a bit of tech demo experimenting with ways to create a 2d lighting/shadow effect.



More..

Attachments

Login to view attachments
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 14th Aug 2009 19:16 Edited at: 27th Jul 2011 10:12
Quake MD2 animation test V0.02

This little example load a MD2 model (ID software's Quake2 model format) and renders the model on screen (using TextureTri) with animation. The demo has various key controls to set the rendering mode and you can rotate the models using the arrow keys.


Demo Controls:

Arrows = Control object rotation

F1 = Toggle Filtering (Bilinear filtering)

F2 = Set texture drawing to "solid"
F3 = Set texture drawing to "Alpha50"
F4 = Set texture drawing to "Alpha add"
F5 = Set texture drawing to "Alpha Subtract"

ESC = EXIT DEMO


Download:

Quake MD2 Loader Test V0.02


Pics:



Attachments

Login to view attachments
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 13th Sep 2009 21:09 Edited at: 27th Jul 2011 18:04



PlayBasic V1.64j2 _Retail Upgrade_ is Now Available (14th, Sep, 2009)

This release updates the PlayBasic V1.63w2 -> V1.64j retail editions to the current retail release version of PlayBasic V1.64j2. However, if your edition of the PB is older than PB1.63w2, then you'll need to install that patch prior, to updating the latest.

The PB1.64j package includes updates of PB Compiler, Release / Debug Runtimes, SLIBS, DOCS & IDE V1.17. The main changes for various SLIB updates and health 180K reduction in the runtime sizes.


For more information about PlayBasic, please visit the Play Basic home page and download the FREE learning edition and dive in.

Url: www.PlayBasic.com


Update Gallery





PlayBasic V1.63 -> PlayBASIC V1.64 Gallery


Download Upgrade

See announcement to Download Upgrade



Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 2nd Oct 2009 04:35
Latest version of www.PlayBasic.com V0.48 alpha is online. Lots of new tweaks and lots of new source code content. But still lots to do..

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 7th Oct 2009 21:34 Edited at: 7th Oct 2009 21:41
V0.50 of www.PlayBasic.com alpha is online. This revision adds the tutorial section. Not a lot of content ATM, but that's coming

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 16th Oct 2009 06:14 Edited at: 25th Mar 2011 06:06
PlayBasic V1.64k WIP

Read the latest blog entry for all the latest and coming features to PlayBasicV1.64k



www.PlayBasic.com

The tutorials section is online. Not a huge amount of content ATM, but there's still lots of stuff to link in from the tutorial forums.

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 21st Oct 2009 07:03 Edited at: 21st Oct 2009 07:06
PlayBasic V1.64K WIP thread

Work is progressing fairly well on the next major update. So far i'm focusing upon adding some features that are from the PlayBasic V2.00 (PBFX) design doc..

Latest additions are a bunch of new C styled math short cuts to the parser. Read More

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 24th Oct 2009 07:32
PlayBASIC V1.64 K BETA #4 (Retail Compiler Only Beta) - (Avail for Registered Users ONLY)

PB V1.64k4 is the latest beta of the new PBV1.64 retail update. This beta brings a few new compiler level changes to PB, namely math short support and Byte & Word field support in User Defined Types.

Math Shorts are another idea borrowed from C. The syntax is basically the same, expect PB only supports these operations in Assignments, while in C you can apply them anywhere, which is handy in C, not so much in BASIC.

What are they ? - Well they're simply a way of short cutting math operations being performed upon the same variable or array.

For example, in older versions of PB, if you have a variable SCORE and wish to add 100 to it, they you'd either type Score=Score + 100 or use the INC operator. Eg INC score,100 (Note: Only available in older editions of PB V1.64)

Now in V1.64K we have the following short cut operators.

++ ; Increase by one. This is the eqivilent of INC operator. Except you can use these on arrays/ type fields
-- ; decrease by one. This are the eqivilent of DEC operator. Except you can use these on arrays/ type fields

+= ; Add right value to left. Eg Score += 100 , is the same as Score = Score +100
-= ; Subtract right value from left. Eg Score -= 100 , is the same as Score = Score -100
*= ; Multiply right value by left. Eg Score *= 100 , is the same as Score = Score *100
/= ; Divide right value by left. Eg Score /= 100 , is the same as Score = Score /100


So really these additions just allow us to shorten some long expressions. These operators can be used on most data types and structures within PB. Including Integers, Floats, Strings, Arrays, Pointer writes (limited support) and even User Defined Users. However Array Field elements in User defined types are not currently supported.




Byte & Word Fields

As of PB1.64k, PB now supports BYTE (8 bit unsigned) and WORD (16bit unsigned) fields within User defined type structures. This address a bit of gotcha when trying to work with some external functions (ie windows, other 3rd party dll's mainly).. But you can use this stuff in your programs like so.








Download

See Announcement for download



WIP Thread

Follow the WIP beta gallery thread in the show case

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 25th Oct 2009 05:52 Edited at: 25th Oct 2009 05:53
Just issued a new beginners programming challenge called 'Shoot The Alien' for PlayBASIC

Knowledge Requirements In this challenge

* Understanding of Variables & Arrays
* Understand of basic graphics commands
* User input
* Movement / Animation
& Collision


see-> Challenge #19 - Shoot The Alien (Mini Game)

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 27th Oct 2009 03:52 Edited at: 27th Oct 2009 03:52
PlayBASIC V1.64 K BETA #6 (Retail Compiler Only Beta)

PB V1.64k6 is the latest beta of PBV1.64 retail update. This beta brings a more compiler level changes, some Runtime speeds up and a few bugs fixes from the previous beta.

In this beta the math short cuts have been extended further, both in what they can be applied to (should support all data types) and there's a few new operators also, namely AND (&=), OR =), XOR (~=) operators

Other changes revolve around the priority of certain opcodes (low level stack + pointers) within the VM1 instruction set. The latter gives a nice speed boost to accessing array fields in user defined types. In fact, all pointer operations should be faster, but don't get too excited though we're probably only talking 10->15% real world speed improvement on those operations. Of course, if you don't really use pointers, then this is unlikely to make any great impact in your programs.

The last changes have been to the stack opcodes. While the changes thus far are fairly minor really, even so, the clean up should help with programs that use a lot of function calls. In some test programs the changes we're producing a handy 12% speed up, but In real world code, I doubt we'll see that. Perhaps 5%. But a saving is a saving..


Download
Get BETAs



WIP Thread

Follow the WIP beta gallery thread in the show case

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 1st Nov 2009 07:13
PlayBASIC V1.64k Beta 8 - Mismatched Assignment Casting.

I hadn't noticed this before, but PB doesn't seem to like assigning pointers to integer/float variables. From the parsers perspective this is perfectly legal, but the runtime doesn't actually feature the require opcodes. So in older version of PB you'll get a unknown opcode error. As such I've dropped in some support for this. Seems to work ok..

eg.




Edit: Should work on all the main structures now.






PlayBASIC V1.64k Beta 9 - Array operators / Assignments.

Currently working my way through adding some more array functionality in the way of operators. So far this beta has some (limited) support for array handle assignments. In case you didn't know (if so, you might want to read the Helps->About tutorials at some point!), when we use handle in PB we're talking about about the entire array, be it a Integer array, Float array ,String array, Typed array or Typed variable . The container is basically the housing the around the elements inside the array structure. So these operations are not applyed upon individual elements inside the array, but the entire arrays contents.

So far, all we can do is copy the right side to the left. Ie. DestArray() = SrcArray(), which at this point is really only a short cut for CopyArray command. I've a few other ideas that might be handy also, but it'll keep those under wraps for the time being.

Anyway, here's a example.




Outputs



Read PB1.64k WIP

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 1st Nov 2009 19:39
Just posted Beta #9 of PlayBASIC V1.64k in our forums maintenance area.

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 2nd Nov 2009 07:57
PlayBASIC V1.64k Beta 10 - Returning UDT's from Functions.

Today I've been looking into the best way to insert such functionality into PlayBasic V1.64k. Implementing this today is basically about bridging the gaps, and trying not to leak memory in the process. While it's not currently working, I'm reasonably sure that VM1 includes enough control to wedge such an ability into it. Might not be most elegant solution internally, but it should work ok.

I should point out here, that we're talking about returning a single UDT pointer instance, not a container (array/list etc)..



tiresius
20
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 2nd Nov 2009 16:46
Sounds good.

Couple questions:
Why do you use Dim Cool as Vector2D instead of just Cool as Vector2D

Why do you need the "as Vector2D" in the return UDT example?

I'm not a real programmer but I play one with DBPro!
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 2nd Nov 2009 17:34
Quote: "Why do you use Dim Cool as Vector2D instead of just Cool as Vector2D"


Dim Cool as Vector2D is PB syntax.

Quote: "Why do you need the "as Vector2D" in the return UDT example?"


That's the return type prototype. This performs two tasks, It creates the local UTD pointer and gives us the type of data being returned. Otherwise during code generation, there's really no way of knowing what 'type' of data is being exported from the function.

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 2nd Nov 2009 17:37
PlayBASIC V1.64k Beta 10b - Returning UDT's from Functions (Continued) .

It's been a pretty creative and productive couple of days code wise. Thus far, every thing seems to have come together to fairly well, which is surprising. It hasn't all gone to script with the odd WTF moment, but most things on my to do are getting ticked off fairly quickly this time, and i'm happy to say that Returning User Defined Types is now one of them.

Lets not get too far ahead ourselves though, currently you can only return a single new instance of TYPE from a FUNCTION (NOT a PSUB). This type is accessible through a UDT pointer inside the function, then exported as new type bank from the function. So what's returned from the function call is virtually the same as what the NEW operator returns. Which is the 'buffer' this type structure is stored within, and not an array/list container. Therefore PB will expect you to write this buffer handle into a container such as typed variable/array or list. If you don't, you'll leak this memory !

Now since the return type is a UDT pointer inside the function, we actually need to initialize this using the NEW operator. If you don't do this, it'll crash anytime you read/write to the field. I could possibly do this for you (init it as the types declared parent type), but then you'd lose some control, since types can be inherited in PB. So what you could is Dim the return type as the general parent, but actually allocate one of it's siblings. Which is perfectly legal.

Anyway, here's a bit of a working example..





Read Beta 1.64k Work In Progress

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 3rd Nov 2009 06:29 Edited at: 3rd Nov 2009 06:30
Play Basic V1.64 K BETA #10 (Retail Compiler Only Beta) - (Avail for Registered Users ONLY)

PB V1.64k10 is the latest beta of PBV1.64 retail update. This beta adds the ability to declare and return locally allocated UDT pointers from functions..
Read Here about usage

Download

Get PlayBasic From UnderwareDesign.com

Valle
16
Years of Service
User Offline
Joined: 10th Mar 2006
Location: in your girlfriends bed
Posted: 3rd Nov 2009 11:45 Edited at: 3rd Nov 2009 11:46
Quote: "Why do you use Dim Cool as Vector2D instead of just Cool as Vector2D

Why do you need the "as Vector2D" in the return UDT example?"


Because PlayBasics syntax is different from DarkBasics.

/edit
Oops, I didn't see it was answered already. The returning UDT stuff looks awesome by the way !


Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 4th Nov 2009 19:30
PlayBASIC V1.64k Beta 12 - Passing Individual User Defined Types Into Functions .

With the addition of being able to return individual UDT's from functions, then it makes sense to add the ability to pass Individual User Defined Types into Functions also. This gives us two methods to move data between scopes. You have the original container methods and now you can pass individual type buffers.

To declare an input param as individual UDT we use the VARIABLE as UDT declaration. When you call this function, PB expects this field to be a UDT bank. The bank is then resolved to a pointer and pass through to the function internally. So the UDT variable inside the function is actually UDT pointer. So the local UDT has no container. You're writing directly into this type data. However, When you pass a Typed array/Typed variable in, your moving the entire array/list structure.







Here's a quick reworking of one the previous examples, this version features passing individual types in and out of user defined functions.





Here's a version that uses array handles/containers. This is functionally the same as the version above, expect for one Key difference. The version above is passing the individual TYPEs in and OUT of the functions, so inside the SpawnNewObject/DrawMe functions, we can only access stuff in this structure, we can't access the list that came from.

However in the version bellow, we're passing the entire array (LIST) container. This allows us to perform operations upon the passed LIST inside the function (if we need too), rather than just upon the single passed instance.



Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 6th Nov 2009 05:41 Edited at: 6th Nov 2009 05:42
PlayBASIC V1.64k Beta 12b - Returning Local Arrays from Functions (Maybe).

This afternoon I've been continuing my work on the Function Parser. Now that most of the big issues are resolved, it should be possible to export a locally created array (an array dimmed inside a function), and return and assign it to another array(). Those with a keen eye will no doubt see why I was messing around with Array() operators a few days back - Anyway, while it doesn't currently work, ideally this could mean that you can dynamically create arrays.

However, there's a catch (isn't there always), exported arrays will be returned as their underlying bank handles, these are use plain integer values. Since the return isn't strongly typed (for flexibility here), it's going to be possible for you to leak arrays if you're not careful.

Anyway, here's the current WIP snippet. So far this parses correctly, but doesn't generate the runtime code for the array exporting.








PlayBASIC V1.64k Beta 12c - Returning Local Arrays from Functions (continued).

Well, we can tick off another feature. I thought this might take a little longer to get working, but it's really gone fairly seamlessly this time. The implementation isn't complete mind you (only currently supports return integer arrays) but the frame work is in now working. Hopefully, there's no hidden drama's awaiting the implementation of the other array types. But, anyway..


So here's a basic functionality example... Not too exciting, but it shows the concept.



Outputs..





Here's another example. This one is using a 1D array, to store 1D array handles in. So we're conceptually creating functionality to resembles the 'arrays within arrays'. To access the dynamically created arrays here we're using a manually declared redirection array via MakeArray. So before we can access any array handles within TABLE() we need to, copy the array bank into our redirect array. Once that's done, the array appears like any other.






Download

You'll find Beta 12c posted on our forums as always...

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 7th Nov 2009 12:24 Edited at: 7th Nov 2009 12:25
PlayBASIC V1.64k Beta 13 - Returning Typed Arrays & Typed Linked Lists from Functions.

Well well, this is getting a lot more interesting than just being able to return integer arrays dynamically. Now we can return locally created float/string/ typed arrays and even Typed lists from within functions also.

When an local array is exported it's exported as the databank that represents this item in memory. We can assign the bank indexes to a receiver array (MyArray() = SomeFunction() ), or we can store them in an integer fields (as per the example above).

If we do this, we can't access the data directly, we need to first create an array stub using MakeArray. Then any time we want to access the data, we assign the array stub our bank index and hey presto, we're able to read write to the array. It's not the prettiest solution, but it's something that works today!

Here's a simple example.







Here's a much more practical example that uses attached typed lists to store character inventories in. So each character has it's own linked list of types. This can as go as deep as you like..




Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 7th Nov 2009 18:49 Edited at: 7th Nov 2009 18:49



2009 PlayBASIC (game programming) Competition Starting Soon !

Surprise! - Yes, we've lined up another wacky competition for all the code crushing indie game programmers/designers out there.


What is it / When does it start ?

This years theme/rules will be announced on the forums on.

9th, Nov, 2009



Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 11th Nov 2009 16:50
PlayBASIC V1.64k Beta 14 - Post Fix Support On User Defined Functions.

This additions bring user functions into line with the internally bound & native VM operations. In other words you can declare a user function name and use the # and $ symbols at the end. The parser doesn't use this are the return prototype though, the return type still comes from the what exported after the EndFunction statement.




Note: Function name matching is explicit. So if the function is declared with the post fix, then you can't just drop it, at least not now anwyay.



This also works on LinkDLL functions now..




Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 14th Nov 2009 03:12
PlayBASIC V1.64k Beta 15 - Yet Another Asteroid Clone.

Been busy today with other real world stuff, so tonight I thought i'd knock up a demo rather than tinker with parser/compiler. This one is yet another asteroids demo, it's really just the first thing that came to mind (that didn't require artwork ) . The Interesting thing is, that Asteroids is a game that's often discussed (ie. a common question I get) but I don't really recall seeing too many people get a demo up and running. So I knocked this up.

The demo doesn't actually use another new in terms of rendering, it's just some alpha additive shapes on depreciated buffer (image blurring). The only thing that make it a 1.64K program is in the code. Which just uses some of the new features here and there. It could be made to run it in V1.64I/V1.63LE but then there's no point posting it here..

So far the demo features player controls, basic asteroids and player firing, collisions and some particles. Looks ok when running...


PB V1.64 Gallery Thread

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 15th Nov 2009 17:31
YAAC (Yet Another Asteroids Clone)

cleaned up the code and posted an 'as is' version on our forums.



WIP Thread (pics/source)

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 17th Nov 2009 19:42
PlayBASIC V1.64k Beta 16 - Import/Export Exporting Pointers & Buffers from PSubs.

This betas supports passing pointer in/out of PSUBS, as well as support for passing UDT buffers and IN and OUT as well as Array Buffers out Psubs. The latter means you can dynamically create arrays/lists.. In other words you can do really freaky stuff..



Sample,






See PV1.64K Wip Thread

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 18th Nov 2009 15:05




Casual Creations - 2009 PlayBASIC Game Programming Competition

Only 10 Registration Days left !

http://www.CasualCreationsCompetition.UnderwareDesign.com/




Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 21st Nov 2009 19:05 Edited at: 21st Nov 2009 19:06
www.PlayBasic.com

Added some more tutorials, plus a little PlayBasic system compatibility tester.



Debugger Prototyping (Syntax Highlight)

Been doing a little work on some possible debugger updates. Learn more

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 23rd Nov 2009 20:27
Debugger (Syntax Highlight) demo


This is a demo of the current technique. The basic approach is split into two halves, the pre-processing and the rendering side. All the work is done during the pre-processing leg. This code analyzes the source file and builds a representation of this. The render just draws the representation.

So the processing side is really a brute force operation in this edition. As such, the longer the source file being imported the longer the load time. The test is set up to load a 20,000 line (plus) source file. On my system, it routine loads this file in around 1700-1800 milliseconds. Which is well within the bounds of acceptable use, given the size of the test file and that is prototype is built in PlayBasic V1.64k Beta17.

Learn More (Download)

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 25th Nov 2009 20:10 Edited at: 25th Nov 2009 20:15
PlayBASIC V1.64k Beta 18 - CallFunction (Dynamic Function Calling)

All of the recent work has been edging towards adding more operations that allow greater freedoms in user code. What CallFunction does, is it allows you to call a function in your code by name. While it's early days as yet (I've only just got a simplified version working in fact) this functionality will hopefully allow users to write routines that can dynamically call other routines, without the user having to explicitly code it.

This type of functionality tends to pop up when we need to write code that's going to be used between many projects, while still remaining generic. A good example that comes to mind, would be a GUI library. Where the GUI could be written to call a particular user defined action(s). For example, if the GUI detected a button click, the GUI could check if the button has an associated function (something the designer could to do at design time). This function be the code that react to this button click. So the programmer wouldn't have to explicitly add code to react to the button click

Another situation could be in collision detection. If each object had a user associated 'destroy function', then the collision code could be simplified into a more generic version. This would allow the programmer to add more object types and destroy methods, without having to patch them into all the collision routines. So basically it's going to be used a call back mechanism.

Anyway, so far all that's working is calling simple subs without and parameters or returns.. In the example bellow it's calling Psubs, in the future I hope to be able to support user defined functions/psubs and bound functions. But first things first...

This example randomly calls either the functions bellow by name.




tiresius
20
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 26th Nov 2009 03:59
That's neat. Could this become like an eval(string) function that runs playbasic code dynamically?

I'm not a real programmer but I play one with DBPro!
Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 26th Nov 2009 13:11
Quote: "
Could this become like an eval(string) function that runs playbasic code dynamically?
"


Unlikely, That's a pretty slippery rabbit hole that one. Getting it eval simple expressions would be reasonably easy I guess. But where do you stop.

I do have a similar concept of sorts in mind, but I'll keep that to myself for the time being...

Kevin Picone
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 26th Nov 2009 13:14
PlayBASIC V1.64k Beta 18 - CallFunction (Dynamic Function Calling) (cont.)

While it's only a few hours later, but the implementation has progressed a bit further already. The current version supports user defined functions and Psubs. Moreover function calls support basic parameter passing. I suspect that only Integer/Float & strings will work (at this point), but I haven't actually tested anything else. Arrays certainly won't work, but pointers and individuals types may work. It doesn't returns though.

Given the function is called by NAME, this means function name has to be resolved back to it's internal pointer. This process was pretty slow in the initial version. With the following benchmark (bellow) taking some 750 milliseconds to execute 10,000 times. However, with a bit of a rethink i've been able to trim this back to a much more respectable 22.8 milliseconds for 10,000 calls.

In the final you'll be able to call functions by name, or by index, which gets rids of the need to search for the function by name. So that'll be a lot quicker I'd imagine.





Quickly tested calling via Function Index.. And it'll execute the equivalent loop in about 3.8 milliseconds. So clearly, via index will be the best of the options. If speed is a concern. CallFunction will also be slower than native function call though.

Login to post a reply

Server time is: 2023-01-29 19:10:50
Your offset time is: 2023-01-29 19:10:50