PlayBASIC V1.64N2 / V164N3 (Work In Progress) Gallery

Started by kevin, April 22, 2012, 12:07:12 AM

Previous topic - Next topic

kevin

PlayBASIC V1.64N2 BETA #15b (Release Candidate #2)

      PlayBASIC V1.64 N2  Beta #15b,  this version fixes the array caching issue found in the previous betas.   As with beta 15,  I'm expecting this to be this the release version.    Therefore,  users are strongly advised to test this version across as many of their projects as possible prior to the release!



Download


     Get  PlayBASIC V1.64 N2 Beta #15b (login required)



kevin


PlayBASIC V1.64N2 - Documentation

     Been slugging it out, making another a pass over sections of the documentation.    One of the things that's always bothered me, is the lack of picture content in the doc's,  so I've been trying to knock up some small animated gifs to give some type of visual representation of what the code is doing, or some tutorial is rambling on about.   Which is quite possibly turning out to be the most boring things I've ever done, given how long it's taking.   To make the gif's i'm just saving out runs of sequential bmp files from PB, then using VirtualDub to import and export each set as an animated gif.  Turns out to be pretty easy once you get going.     

     Looking over the doc's there's actually a number of tutorials in parts sitting in the database.  None of them are anywhere near complete, but the most useful one seems to be a sprites tutorial.   So the past couple of sessions I've been sitting down and having blast at that one.   Some of the stuff in it, we could probably ditch, but might as well leave it there for the time being as it's possibly a bit too low level in places.   The idea of the tutorial is cover as much ground as possible, but you can't cover everything.   

                 
Learning Edition Update

      The distance between the current learning edition (based on V1.64L) and the current work in progress V1.64N2 revisions has become a deep divide, since it's now over 2 years behind the current build.    A lot has been implemented/changed in PlayBASIC in that time.   So there's a very strong argument to be made that it's time to upgrade the Learning Edition of the package also,  but I'm somewhat undecided now is the right time.    Given that this directly impacts upon my rather limited time for working on PBFX.   The current thinking is to get the retail version of V1.64N2 out, then when it's time to upgrade PB again, build a new LE version prior to that.  So the LE version is always behind the release version.   


   


kevin


PlayBASIC V1.64N2 - Documentation Continues

    Dropped at some 50+ hours into the documentation pass already and i'm barely half way through the sprites tutorial..  Was really hoping to knock that over as i'm rapidly running out of time for all things PB.   The sprite tutorial is broken up into a stuff like an introduction, motion, animation, collision , high level management and few other bits, like a section on the rendering stagings in the sprite engine.   The latter will certainly help some people get a clearer idea of how the render engine processes pixels from the source image, through the modifier and out to the destination surface.

    Have been doing some tinkering with V1.64N2 Beta 15  and  found a few examples that no longer work that should. One that comes to mind drops a phantom 'array doesn't exist' after that arrays been passed around a bit.  Got a feeling some of the array functions might clash with the array cache.  But will have to crack it open to have a look see. 
     

Big C.

The sprite thing sounds interessting... Hope it makes somthing clearer to me ;D Maybe the series can user exspandble...

ATLUS

New Documentation, sounds interessting! ^__^

kevin


good to see people read the doc's.... erm :)

stevmjon

Quote from: kevin on June 12, 2012, 03:06:55 PM

     The sprite tutorial is broken up into a stuff like an introduction, motion, animation, collision , high level management and few other bits, like a section on the rendering stagings in the sprite engine.   The latter will certainly help some people get a clearer idea of how the render engine processes pixels from the source image, through the modifier and out to the destination surface. 
     


looking forward to it.
It's easy to start a program, but harder to finish it...

I think that means i am getting old and get side tracked too easy.

kevin


Quotelooking forward to it.

    Can't imagine there's anything all that new it, given it's paraphrasing what's on the boards..


Backups

     Taken a  day off all things documentation due to some sort flew like illness creeping in overnight, what fun...  Been trying to catch up on another round of backups though, but the burner has decided it's not going to behave and spit out some weird errors 50% of the time.   The discs seem to read other in other systems, but it's another bit hardware on it's last legs.    But anyway,  did happen to find bunch of old projects that I was looking for a while back,  there's even an old version of PlayANIM. 

     PlayANIM is the frame work of a basic sprite animation tool written some four or five years back.   After looking at it today (although briefly), the bare bones of something useful are there,  so it might be worth stripping the guts out it and using that core code with the newest 'standard' template for the GUI stuff.    To tool is split into two/three sections,  frame grabbing and animation building are the main ones.   Frame grabbing allows frame to be any size and in any order from any file in the pool.  I know there's version with animation sequencing, but this version doesn't seem to have that, no biggie.    Since that's missing stuff like real time changes to controlling the blending, Tint, Rotation, Scaling etc ) and some type of even parent->child  grouping would be handy. 


kevin

#53
PlayBASIC V1.64N2 BETA #15c (Release Candidate #3)


      PlayBASIC V1.64 N2  Beta #15c,  this version corrects another potential issue from writing mismatched data into cached integer array accesses.    If nothing else is found, this all be the release version.

     Users are very strongly advised to test this version across as many of their projects as possible prior to the release as might be a while before it's updated again !



Download


    old file removed



Documentation

   Still ticking away at the doc's,  managed to save over one whole section of the sprites tutorial, without even noticing it until today.  Was going to throw that out, but remembered most of it, so threw another version together.   The sprites tutorial is about 90k of raw text,  making it around 3 times larger than any other tutorial in the doc's to date.   It's pretty example heavy though,  taking a progressive approach through the various subjects.  Most of the examples are variations of one running theme.

   Like this,

PlayBASIC Code: [Select]
   ; Force PlayBASIC to limit the program to
; a max of 60 frames per second
SetFps 60.0


;*=--------------------------------------------=*
; Load Animation Frames
;*=--------------------------------------------=*


; get playbasic compiler path to guess
; location of the help file media

path$=ProgramDir$()+"\Help\Commands\Media\Animations\Star\"

for Count=1 to 8

; build this filename
File$="Star"+Digits$(Count,4)+".bmp"

; Load this frame into the required image slot
LoadImage Path$+File$, 99 +Count

next



;*=--------------------------------------------=*
; Setup our Game Character Type
;*=--------------------------------------------=*


; Create Type called "GameCharacter"
Type GameCharacter

; declare XPOS and YPOS fields as integers
Xpos
Ypos

; Declare Current animation frame as float
CurrentFrame#

; add the anim speed field as float
AnimSpeed#

EndType


;*=--------------------------------------------=*
; Init the our Star variable
;*=--------------------------------------------=*



; Dimension STAR typed with LINK LIST Support
Dim Star as GameCharacter LIST


; Set up a for / loop to count from 1 to 10
For lp = 1 to 10

; Add a new Empty star to the list
; The new item is now the current item
; within star. So we're now accessing it
; every time we access star's fields
Star = New GameCharacter

; set the Xpos and Ypos fields of current star
Star.XPos = rnd(800)
Star.Ypos = rnd(600)

; Set CurrentFrame to 100
Star.CurrentFrame = 100

; Randomly pick our animation speed. The rate'
; can be from as low as 5Fps and as high as 25fps
Star.AnimSpeed = RndRange#(5,25) / GetFps()

next



;*=--------------------------------------------=*
; MAIN LOOP OF PROGRAM
;*=--------------------------------------------=*

Do

; Clear the screen to black
Cls


; Update all the Star Characters
for each STAR()

; Add this characters anim speed to it's
; current frame and wrap the results
Star.CurrentFrame#= WrapValue(Star.CurrentFrame#+Star.AnimSpeed#, 100, 107)

; Draw this image at it's current position and frame
DrawImage floor(Star.CurrentFrame#), Star.Xpos, Star.Ypos,true

next


; Show the newly drawn scene to the user
Sync

; Check if the ESC key is press ?, if not,
; loop back to the DO statement until it is
loop EscKey()=true





  It doesn't start at this level, this is about 2/3 of way through, so it pretty bare bones stuff.. LoadImage, DrawImage type stuff initially.   The sections put forward progressively ideas on how to make the initial examples better by using various techniques.   Like loading images in Loops for example,  using Floating Point CirrentFrame# counters with ranged wrapping.   So slowly the clunky versions morph into more flexible.   Can't possibly cover everything.. but enough to give some beginners a starting point.  You can find more complex usage examples both in the Projects Pack that ships with PlayBASIC and of course here on the forums.

  Anyway, have pretty much fleshed out the main sections now, but still got to write some more stuff on collision and a few more management examples.   Much of management section, relies upon the users knowledge of things like Types/ Arrays / Linked Lists..     Which thankfully we already have tutorials covering those.    

 

kevin

#54
 Documentation Continues

   Yep, still hacking my way through the Sprite Tutorial.  Today, I'd be willing to say it's complete enough  so that somebody new to all this jazz could learn enough to make a bit of a basis.   It actually covers a lot fringe stuff also, from some history sprite,  double buffering, syncing.. etc...   but in some ways I guess it poses more questions than it answers for some people.   In that, where and when to you use sprites or manually render images ? - There's no black and white answer.   And the more laterally you think about it, you can create sprite like scenes from all kinds of materials in PlayBASIC.   Ranging from vector art,  texturing mapping stuff through to Bitmap fonts and even Maps all mashed into into one.    So the one solution fits all just doesn't stand up.

   Anyway,  going to tweak up the article a bit more and perhaps build a few more examples.  If that goes as planned, then i'll bumble up a release version and that'll be that.


kevin


PlayBASIC V1.64N2 -  Are we there yet ?

     It's been a pretty bizarre month for me, my plans  basically went out the window when some family issues (we'll call it that ) occurred.   Long story short, all things computer related had to take a back seat.   The upgrade hasn't stalled, it's not canceled and will indeed be released, as for exactly when I'm not too sure.  Was hoping this week, but that's unlikely today.   What I can say is that this week, i've had a lot more time for all things UW + PlayBASIC related.    So I've been pumping in some hours doing some 'clean up' work on the some common parts of the doc's.   Last night focusing on the Maths/Strings stuff which i suspect hasn't been looked at for some time now.     Most of the clean up stuff is about perhaps adding some more copy, another example better cross linking and the odd picture.    Still lots of stuff that bothers me about the doc's but i'll have to live with it. 

     My original goal was to have a clean up pass of the doc's for the V1.64N2 retail release, wait a while, then build a learning edition from V1.64N2.  By then we should have enough feedback to address any issues etc and repeat the process again.  Simply because we don't have enough active beta testers.   To build a learning edition  we'll need to a complete pass over the project packs and documentations.  So it's important as much of the information is up-to-date as possible..   One thing that never ceases to amaze me is just how long a complete documentation pass can take.   Was working out recently that i've spent almost a year of my life writing PlayBASIC documentation, scary.     


kevin

#56
 PlayBASIC V1.64N2  Retail Released

  So the upgrade is finally built and uploaded.  Lots of new stuff all packed into this edition.  

 Download PlayBASIC V1.64N2 Upgrade (login required)

ATLUS


micky4fun

Looks like many examples and demo's for me to try here , how much fun can one have
thanks for all the hard work in keeping us all up to date,

great work !! ;D

kevin

#59
  PlayBASIC V1.64N3 - Oh dear, another one

   While knocking up some more examples and bits and bobs for those active people on the forums,  it's not that uncommon to run into something behaving badly.  One such oddity has been the Block classification routines in the Map library.  The block classification is just some routines that scan block pixels and attempt to quantify the pixel data that's inside each block.  Preferable without stalling the entire process.

    The trouble has been, that certain pixel combinations can give return wrong answers.  Making the odd tile appear 'solid' when it's semi transparent. This is not a new thing, it's been acting strangely for a while, but locking down the cause isn't always as linear as i'd like.   Finally found the problems (i think!), which has turned out to be interesting in a boring programmer sort of way, where one issue was that a previous block state could carry forward breaking the decoder.  Which was an off shoot of the optimizations at the time.  Ya get that.  

    To test this, I've been using a level from Sigtrygg's  Hell Eagle game.  In that game, the world is made up of one large picture.   I've taken backdrop, run it through Play-Pic2Map which spits out about 8 meg of block data at (32*32 block size), something like 80% smaller than of the original size.  All you do now  is load the blocks and level map into PB and render them.  

   Bellow is a picture of the Hell Eagle map rendering in debug mode (The lines around the blocks).  The text represents the classification of the each block, which now seems to be giving the expected results for the three primary block types.   -1 = blank , 0 = solid and  1 =transparent


The dream (nightmare) is over ? - New Beta

    Yep.. unfortunately what this all means, is we'll need to build another update at some point on the sooner side, rather than later side.

    Download PlayBASIC V1.64N3 Beta #1 (login required)



Hell Eagle Mock Up (Test Project)

       I'm using this  little side-project to put the mapping stuff through a real life usage, rather than smaller examples.   The only way to find issues hiding down deep in the guts of the library,  is by digging in and writing something.   It's mostly been fine so far,  the block classification changes seem to be working a lot of better now, at least in the limited range of testing I've been able to do tonight.    There's some stuff  that needs looking at, which is surprising given the age of the library now. The recent update was 2 years ago..

       Anyway, since the tech is about mapping and worlds thought i'd knock up a world loader.  It's just a text file.  The parser is just some cut'n'pasted loops,  but it gets the job done.    The loader pulls the text file in, cuts it up into an array of strings and just scan down it looking for the section names. When it finds one it calls a function that reads the particular fields of that type.   Not pretty, or that clever.. but it's quick to write and does the job.  Internally the demo does most of the work.  Like after parsing the sections of the characters are set up.  You could manually associate eat character with the platform it belong to, but it seems easier to just write a little routine that found the closet platform to the character.   We could use this in game as way the characters can query if the player has landed on the platform.   The same sort of idea would work when picking which character runs to the chopper... You could painstaking define all the orders, but seems easier just doing it with some code.   

       In this pic, the men are drawing lines to the center of the closest platform, the player has not logic behind it, it's just mouse controlled.   Using the SpriteHitMap function to detect the impacts.  But there's a bit of problem with that,  it's fine in some places, and not others.  I think there's a span buffer issue hidden away in that.  None of the less, shape mode seem to works fine.   Speed wise, it'll draw the 1024*768 frame in 5 millisecond refresh (200 fps) on a 7 year old system.   
 


; --------------------------------------------
; Hell Eagle Mock Up World Dizzy
; --------------------------------------------


Player-Section
StartingXpos =1420
StartingYpos =300

#


Map-Section
     BlockMaskColour   = $ffff00ff
     BlockWidth        = 32
     BlockHeight       = 32
     BlockFileName     = WORLD_Blocks.Bmp
     LevelFileName     = WORLD_Level.Map
#


Platform-Section

Width  = 110
Height = 4
Colour = $ffffffff

addplatform =206,452
addplatform =2726,412
addplatform =460,840
addplatform =2873,764
addplatform =276,1440
addplatform =1010,1575
addplatform =2289,1913
addplatform =197,1936
addplatform =2696,2303
addplatform =149,2303
addplatform =1481,2299
addplatform =3737,192
addplatform =3776,949
addplatform =3384,1849
addplatform =3566,2694
addplatform =3435,3057
addplatform =2044.3062
addplatform =1361,3008
addplatform =144,2994

#




Men-Section

addman =180.0 , 425.0
addman =320.0 , 424.0
addman =340.0 , 424.0
addman =2650.0 , 384.0
addman =2705.0 , 384.0
addman =2900.0 , 383.0
addman =2980.0 , 383.0
addman =428.0 , 814.0
addman =630.0 , 813.0
addman =2773.0 , 737.0
addman =2850.0 , 737.0
addman =3000.0 , 737.0
addman =258.0 , 1410.0
addman =385.0 , 1410.0
addman =1010.0 , 1543.0
addman =1102.0 , 1543.0
addman =2275.0 , 1883.0
addman =2440.0 , 1883.0
addman =2460.0 , 1883.0
addman =193.0 , 1905.0
addman =290.0 , 1905.0
addman =2670.0 , 2273.0
addman =2940.0 , 2273.0
addman =2970.0 , 2273.0
addman =2985.0 , 2273.0
addman =33.0 , 2274.0
addman =63.0 , 2274.0
addman =96.0 , 2274.0
addman =280.0 , 2274.0
addman =298.0 , 2274.0
addman =1380.0 , 2270.0
addman =1400.0 , 2270.0
addman =1600.0 , 2270.0
addman =1680.0 , 2269.0
addman =1720.0 , 2269.0
addman =3732.0 , 161.0
addman =3852.0 , 161.0
addman =3878.0 , 161.0
addman =3771.0 , 920.0
addman =3891.0 , 921.0
addman =3381.0 , 1818.0
addman =3476.0 , 1818.0
addman =3526.0 , 2665.0
addman =3546.0 , 2665.0
addman =3665.0 , 2665.0
addman =3417.0 , 3028.0
addman =3545.0 , 3028.0
addman =2000.0 , 3033.0
addman =2025.0 , 3033.0
addman =2155.0 , 3033.0
addman =2185.0 , 3033.0
addman =1335.0 , 2980.0
addman =1470.0 , 2980.0
addman =1493.0 , 2980.0
addman =140.0 , 2963.0
addman =240.0 , 2963.0

#