Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Here comes a preview of the forthcoming new AFlib2!!
#71
I got 29 FPS (decent) on a 1.3 gHz with 512Mb of ram. I say that aint half bad. :-).
hen they say it can't be done, THAT's when they call me ;-).

[Image: kaffee.gif]
[Image: mystikshadows.png]

need hosting: http://www.jc-hosting.net
All about ASCII: http://www.ascii-world.com
Reply
#72
To Relsoft (aka Richard Eric M. Lope), Na_th_an, syn9, Dr_Davenstein, and MystikShadows:

Quote:Scale2x. :*)
Quote:MMX is the answer for fast 2x scaling. Check what Rel mentioned Wink

Well guess what, all of you? I HAVE IT right here!!! Big Grin And it is so amazing to believe that I have actually experimented last night with tweaking that new demo with Scale2X built in, too! Speaking of that, here now is FB source-code of a Scale2X version of the exact same test using AFlib2:

Code:
'===============================================================
' A F l i b 2   D o u b l e - S i z e d   S c a l e 2 X
'                                 D i s p l a y   E x a m p l e
'===============================================================
'Here is yet another program example for AFlib2, only this time,
'it is an even faster way of doubling the actual 256x192 game
'display size to a fit the WHOLE screen in a 512x384 graphics
'mode, all using Scale2X and in good 'ol 8-bit color once again
'right here!!!  ^-^
'
'Hope you like it, and do enjoy this much richly!!!  (^_-)v !
'
'
'                                        - Adigun Azikiwe Polack
'                               One of the Founders of Aura Flow
'                    Developer of "AFlib2 - Aura Flow Library 2"


Defint a-z
Option Explicit

WindowTitle "AFlib2 Double-Sized Scale2X Display Example - (c)2006 Aura Flow."


' First of all, let's roll out AFlib2 into play!!
'---------------------------------------------------------------
'$include: 'AFlib2.bi'


' Next, we set our screen mode to 512x384, 8-bit color,
' windowed, with 2 pages!
'---------------------------------------------------------------
ScreenRes 512, 384, 8, 2, 0


' Now setting up our arrays.....
'---------------------------------------------------------------
Dim gamedisplay.buffer as any ptr
Dim as Integer GFX_h, GFX_v, BufferScr_h, BufferScr_v, SprCount
Dim as ImageType AF2spriteset
Dim Frames, t, stime, fps
Dim path as String

Type Starship
  x as Single
  y as Single
  speed as Single
  scale_opportunity as Integer
  anim_speed as Single
  anim_frame as Integer
End Type

Dim TestSprite(1 to 48) as Starship


path = ""


' Next, let's load in our PP256-based sprite file here which is
' "AF2DemoA.put", and generate our default AFlib2 palette
' automatically!!  ^_-
'---------------------------------------------------------------
AF2.InitSpr_PP256 AF2spriteset, path + "AF2DemoA.put"
AF2.GeneratePalette 1


Locate 1, 1: ? "Just a moment, please......."
ScreenSet 1, 0


' Then, we load in one of our built-in fonts, only this time we
' do a custom shadowed version here!
'---------------------------------------------------------------
AF2.DisplayAllChars 1, 1, 18, 0, 6
AF2.DisplayAllChars 0, 0, 31, -1, 6
AF2.OptimizeFontSet 0, 0, 1
AF2.ClearScreen 0


' Now comes the important part: extracting our physical graphics
' size of the main screen of the window with the "ScreenInfo"
' command and then dividing that by 2, and that would give us
' our 256x192 game screen buffer (which is *approximately* half
' the physical size!  :o ! )
'---------------------------------------------------------------
ScreenInfo GFX_h, GFX_v

BufferScr_h = (GFX_h / 2)
BufferScr_v = (GFX_v / 2)


' Then, we load in our buffer plain and simple using our command
' "AF2.InitBuffer"!!
'---------------------------------------------------------------
AF2.InitBuffer BufferScr_h, BufferScr_v, gamedisplay.buffer


' Here, we initialize 300 built-in stars, as well as do the same
' for 48 starships!
'---------------------------------------------------------------
AF2.StarInit 300

For SprCount = 1 to 48
  TestSprite(SprCount).x = (int(rnd(1) * (BufferScr_h + 90) - 90))
  TestSprite(SprCount).y = (BufferScr_v + 200)
  TestSprite(SprCount).speed = (int(rnd(1) * 100) + 1) / 5
  TestSprite(SprCount).scale_opportunity = int(rnd(1) * 30) + 1
  TestSprite(SprCount).anim_frame = 0
  TestSprite(SprCount).anim_speed = 0
Next


' This is our loop here, where we draw our sprites and moving
' stars into our 256x192 game display buffer, and then we simply
' double the size of that display in an *interesting* way by
' first of all PUTting the buffer, and then using the command of
' "AF2.Scale2x_Auto" to work such wondrous magic!!!  Amazing
' stuff, huh?  You can press the 'ESC' key at anytime here to
' exit this.  ^-^=b
'---------------------------------------------------------------
Do
  AF2.ClearScreen 0, gamedisplay.buffer

  AF2.StarMotion 300, 1, 1, gamedisplay.buffer
  AF2.StarMove 300, AF2.Down, 20

  For SprCount = 1 to 48
    TestSprite(SprCount).y -= TestSprite(SprCount).speed
    TestSprite(SprCount).anim_speed += .5

    If TestSprite(SprCount).anim_speed >= 1 then
      TestSprite(SprCount).anim_speed = 0
      TestSprite(SprCount).anim_frame += 1: If TestSprite(SprCount).anim_frame > 2 then TestSprite(SprCount).anim_frame = 0
    End if

    If TestSprite(SprCount).y < -200 then
      TestSprite(SprCount).x = (int(rnd(1) * (BufferScr_h + 90) - 90))
      TestSprite(SprCount).y = (BufferScr_v + 200)
      TestSprite(SprCount).speed = (int(rnd(1) * 100) + 1) / 5
      TestSprite(SprCount).scale_opportunity = int(rnd(1) * 30) + 1
      TestSprite(SprCount).anim_frame = 0
      TestSprite(SprCount).anim_speed = 0
    End if
  
    Select Case TestSprite(SprCount).scale_opportunity
      Case 0 to 24: Put gamedisplay.buffer, (TestSprite(SprCount).x, TestSprite(SprCount).y), @AF2spriteset.p_data[AF2spriteset.p_dataindex[TestSprite(SprCount).anim_frame]], trans
      Case 25 to 28: AF2.SprBlit_scale TestSprite(SprCount).x, TestSprite(SprCount).y, @AF2spriteset.p_data[AF2spriteset.p_dataindex[TestSprite(SprCount).anim_frame]], 2, 2, gamedisplay.buffer
      Case 29 to 30: AF2.SprBlit_scale TestSprite(SprCount).x, TestSprite(SprCount).y, @AF2spriteset.p_data[AF2spriteset.p_dataindex[TestSprite(SprCount).anim_frame]], 3, 3, gamedisplay.buffer
    End Select
  Next

  AF2.OptimizedPrint_Put "FPS: " + ltrim$(str$(fps)), 0, 0, 1, AF2.false, gamedisplay.buffer

  frames += 1
  t = timer - stime
  If t > 2 then
    fps = frames / t
    stime = timer
    frames = 0
  End if


  ' This is where Scale2X truly starts to kick in!!!  :D !
  '---------------------------------------------------------------
  Put (0, 0), gamedisplay.buffer, pset
  AF2.Scale2x_Auto

  AF2.CustomSync fps70
  ScreenCopy
Loop until inkey$ = chr$(27)


' Now safely removing our sprite file, our font, and our game
' display buffer from memory before we head into the sunset!
'---------------------------------------------------------------
AF2.RemoveSpr AF2spriteset
AF2.RemoveBuffer gamedisplay.buffer
AF2.RemoveFontSet 1


' And we're out the door!!  Be seeing you again!!!  ^_-=b !
'---------------------------------------------------------------

And the run-time results of this code are found in this download:
.....where the 512x384 graphics window has a 256x192 screen doubled through Scale2X indeed!! Much faster results are likely guaranteed, too!!! Smile !

See you once again with the FPS results from you on this newest Scale2X test. :king:



BRINGING YOU ALL A MUCH BETTER WAY THIS AFTERNOON,

[Image: file.php?id=32]
Adigun Azikiwe Polack
One of the Founders of “Aura Flow” ::: Continuing Developer of “Frantic Journey”
Current Developer of “Star Angelic Slugger” ::: Webmaster of the “AAP Official Projects Squad”
Original Creator of the “The New FreeBASIC 8-Bit Palette Machine” and “AFlib2 - Aura Flow Library 2”
url=http://dhost.hopto.org/aapproj/][Image: file.php?id=194][/url]
Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!! Big Grin !
Reply
#73
64 fps
machine specs:
a64 3700+
1 gb 3200 ddr
geforce 6600 gt
[Image: freebasic.png]
Reply
#74
45-55fps, p3 550, now that is truely awsome! thats exactly what i've been looking for >D
Reply
#75
around 80 fps. The reason it's so much better than my last results is I'm on a different pc. :wink:
Reply
#76
To all of you right now:

I am QUITE very happy to say that the documentation for AFlib2 is getting a dead-serious boost forward and then a lot!!! d=Big Grin=b ! Here is why: I have just gone over the 200-page mark, covering every single routine so far in the Sprite Routines, PP256 Font Routines, Built-in 8x8 Font Routines, and Drawing Primitives Routines. These things are covered down pat!! Wink But now, I am working on documenting the Screen Routines, Scale2X/4X/8X Routines, Screen Collision Routines, Sprite Collision Routines, and a lot more. I will promise you, it will be *well* worth the wait as this lib eventually gets released sometime between March and April 2006 (potentially so, definitely!! Cool ! ).

While I was working extensively on my documentation, I had the computer shut itself off on me abruptly a couple of times, but all is under some serious control now, thank God!! Big Grin !

In the meantime, take a whiff at this little glimpse of what is gonna be in my AFlib2 doc:

Code:
Defint a-z
Option Explicit


' Let's load up AFlib2 in here...
'--------------------------------------------------------------------------
'$include: 'AFlib2.bi'


' ...and set the graphics resolution to 640x480 windowed graphics mode,
' 8bpp, with 2 pages!!
'--------------------------------------------------------------------------
ScreenRes 640, 480, 8, 2, 0


' Setting up the arrays!
'--------------------------------------------------------------------------
Dim as ushort ptr TestSprite, BGtile
Dim as Integer GFX_h, GFX_v, Blit
Dim as Single Brightness, Trans_fading, One_color, Bg.X, Bg.Y, scroll
Dim as Single Rotate, ScaleX, ScaleY
Dim as Integer Brightness.ctrl, Trans_fading.ctrl, ScaleX.ctrl, ScaleY.ctrl
Dim as ImageType AFlib2_title, AFlib2_titleshadow


' Now extracting the physical graphics mode size here with variables
' "GFX_h" and "GFX_v", so that we can put them to good use later on!!  ;)
'--------------------------------------------------------------------------
ScreenInfo GFX_h, GFX_v

WindowTitle "The AFlib2 Hit-List of Sprite Blits!!!"
Locate 1, 1: ? "Just a moment, please......."
ScreenSet 1, 0


' Next, we set up our palette and sprites in a jiffy, including also our
' "AFlib2" logo (and its shadow, too!  ;) )!
'--------------------------------------------------------------------------
AF2.GeneratePalette 1  ' <--- This automatically generates our default
                       '      AFlib2 palette!

AF2.DisplayAllChars 1, 1, 18, 0, 2
AF2.DisplayAllChars 0, 0, 31, -1, 2
AF2.OptimizeFontSet 0, 0, 1
AF2.ClearScreen 0

Circle (31, 31), 31, 56, , , , f
Line (0, 0)-(63, 63), 31, b
Circle (31, 31), 24, 58, , , , f
Circle (31, 31), 18, 0, , , , f
Line (0, 0)-(63, 63), 234
Line (63, 0)-(0, 63), 234

TestSprite = AF2.InitCustomSpr(0, 0, 65, 65)
Get (0, 0)-(65, 65), TestSprite

AF2.ClearScreen 0

Line (0, 0)-(64, 64), 183, bf

AF2.Globe 31, 31, 20, 8, 2, .5, 1
Line (0, 63)-(63, 63), 18, bf
Line -(0, 63), 22, bf
Line -(0, 0), 26, bf
Line -(63, 0), 30, bf

BGtile = AF2.InitCustomSpr(0, 0, 65, 65)
Get (0, 0)-(65, 65), BGtile

AF2.ClearScreen 0

AF2.InitSpr_BMP AFlib2_title, 280, 104, "AFlib2_titleC.bmp"
AF2.InitSpr_BMP AFlib2_titleshadow, 280, 104, "AFlib2_titleC-shadow.bmp"


' Alright!  ^-^=b  In this first loop, this will show you the many sprite
' blits consisting of these: Normal, One-colored, Translucent, Translucent
' Dark, Translucent Darker, Translucent Darkest, Null-shaded, Translucent
' Fade Supported, and Brightness Supported!!  Press any key to exit this
' loop.
'--------------------------------------------------------------------------
Do
  AF2.ClearScreen 0

  If Brightness.ctrl = 0 then
    Brightness += 1
    If Brightness > 41 then Brightness.ctrl = 1
  else
    Brightness -= 1
    If Brightness < 0 then Brightness.ctrl = 0
  End if

  If Trans_fading.ctrl = 0 then
    Trans_fading += .25
    If Trans_fading > 10 then Trans_fading.ctrl = 1
  else
    Trans_fading -= .25
    If Trans_fading < 0 then Trans_fading.ctrl = 0
  End if

  One_color = int(rnd(1) * 255) + 1

  scroll += 1: If scroll > 63 then scroll = 0

  For Bg.Y = 0 to 8
    For Bg.X = 0 to 10
      If (Bg.X + Bg.Y) mod 2 = 1 then
        AF2.SprBlit (Bg.X * 64) - scroll, (Bg.Y * 64) - scroll, BGtile, GFX_h, GFX_v
      else
        AF2.SprBlit_trans (Bg.X * 64) - scroll, (Bg.Y * 64) - scroll, BGtile, GFX_h, GFX_v
      End if      
    Next
  Next

  AF2.SprBlit 8, 16, TestSprite, GFX_h, GFX_v
  AF2.OptimizedPrint "Normal Sprite Blit", 80, 24, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_color 8, 88, One_color, TestSprite, GFX_h, GFX_v
  AF2.OptimizedPrint "One-colored Sprite Blit", 80, 96, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_trans 8, 160, TestSprite, GFX_h, GFX_v
  AF2.OptimizedPrint "Translucent Sprite Blit", 80, 168, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_tr.dark 8, 232, TestSprite, GFX_h, GFX_v
  AF2.OptimizedPrint "Translucent Sprite Blit", 80, 240, 1, AF2.false, GFX_h, GFX_v
  AF2.OptimizedPrint "(dark version)", 80, 248, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_tr.darker 8, 304, TestSprite, GFX_h, GFX_v
  AF2.OptimizedPrint "Translucent Sprite Blit", 80, 312, 1, AF2.false, GFX_h, GFX_v
  AF2.OptimizedPrint "(darker version)", 80, 320, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_tr.darkest 8, 376, TestSprite, GFX_h, GFX_v
  AF2.OptimizedPrint "Translucent Sprite Blit", 80, 384, 1, AF2.false, GFX_h, GFX_v
  AF2.OptimizedPrint "(darkest version)", 80, 392, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_null 320, 16, TestSprite, GFX_h, GFX_v
  AF2.OptimizedPrint "Null-shaded Sprite Blit", 392, 24, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_tr.fadecust 320, 88, Trans_fading, TestSprite, GFX_h, GFX_v
  AF2.OptimizedPrint "Fading Translucent Sprite Blit", 392, 96, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_brightness 320, 160, Brightness, TestSprite, GFX_h, GFX_v
  AF2.OptimizedPrint "Brightness-based Sprite Blit", 392, 168, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_trans 363, 379, @AFlib2_titleshadow.p_data[AFlib2_titleshadow.p_dataindex[0]], GFX_h, GFX_v
  AF2.SprBlit 360, 376, @AFlib2_title.p_data[AFlib2_title.p_dataindex[0]], GFX_h, GFX_v

  AF2.CustomSync fps70

  ScreenCopy

Loop while inkey$ = ""

AF2.ClearKeyBuffer

Rotate = 0
ScaleX = 0
ScaleY = 0


' Then in this second loop here, we show you even more *amazing* sprite
' blits for you: Rotated (normal and solid), Scaled (normal and solid), and
' Rotated/Scaled (normal and solid)!!!  Again, you can exit here by
' pressing any key!  :D
'--------------------------------------------------------------------------
Do
  AF2.ClearScreen 0

  If Brightness.ctrl = 0 then
    Brightness += 1
    If Brightness > 41 then Brightness.ctrl = 1
  else
    Brightness -= 1
    If Brightness < 0 then Brightness.ctrl = 0
  End if

  If Trans_fading.ctrl = 0 then
    Trans_fading += .25
    If Trans_fading > 10 then Trans_fading.ctrl = 1
  else
    Trans_fading -= .25
    If Trans_fading < 0 then Trans_fading.ctrl = 0
  End if

  If ScaleX.ctrl = 0 then
    ScaleX += .075
    If ScaleX > 1.2 then ScaleX.ctrl = 1
  else
    ScaleX -= .075
    If ScaleX < 0.1 then ScaleX.ctrl = 0
  End if

  If ScaleY.ctrl = 0 then
    ScaleY += .10
    If ScaleY > 1.2 then ScaleY.ctrl = 1
  else
    ScaleY -= .10
    If ScaleY < 0.1 then ScaleY.ctrl = 0
  End if

  Rotate += .01: If Rotate > 359 then Rotate = 0

  scroll += 1: If scroll > 63 then scroll = 0

  For Bg.Y = 0 to 8
    For Bg.X = 0 to 10
      If (Bg.X + Bg.Y) mod 2 = 1 then
        AF2.SprBlit (Bg.X * 64) - scroll, (Bg.Y * 64) - scroll, BGtile, GFX_h, GFX_v
      else
        AF2.SprBlit_trans (Bg.X * 64) - scroll, (Bg.Y * 64) - scroll, BGtile, GFX_h, GFX_v
      End if      
    Next
  Next

  AF2.SprBlit_rotate 8 + 32, 16 + 32, TestSprite, Rotate
  AF2.OptimizedPrint "Rotated Sprite Blit", 80, 24, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_rotate.solid 8 + 32, 88 + 32, TestSprite, -Rotate
  AF2.OptimizedPrint "Rotated Sprite Blit", 80, 96, 1, AF2.false, GFX_h, GFX_v
  AF2.OptimizedPrint "(solid version)", 80, 104, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_scale 8 + 32, 160 + 32, TestSprite, ScaleX, ScaleY
  AF2.OptimizedPrint "Scaled Sprite Blit", 80, 168, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_scale.solid 8 + 32, 232 + 32, TestSprite, ScaleX, ScaleY
  AF2.OptimizedPrint "Scaled Sprite Blit", 80, 240, 1, AF2.false, GFX_h, GFX_v
  AF2.OptimizedPrint "(solid version)", 80, 248, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_scale.rotate 8 + 32, 304 + 32, TestSprite, ScaleX, ScaleY, Rotate * 4
  AF2.OptimizedPrint "Scaled/Rotated Sprite Blit", 80, 312, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_scale.rotate.solid 8 + 32, 376 + 32, TestSprite, ScaleX, ScaleY, -(Rotate * 4)
  AF2.OptimizedPrint "Scaled/Rotated Sprite Blit", 80, 384, 1, AF2.false, GFX_h, GFX_v
  AF2.OptimizedPrint "(solid version)", 80, 392, 1, AF2.false, GFX_h, GFX_v

  AF2.SprBlit_trans 363, 379, @AFlib2_titleshadow.p_data[AFlib2_titleshadow.p_dataindex[0]], GFX_h, GFX_v
  AF2.SprBlit 360, 376, @AFlib2_title.p_data[AFlib2_title.p_dataindex[0]], GFX_h, GFX_v

  AF2.CustomSync fps70

  ScreenCopy

Loop while inkey$ = ""

AF2.ClearKeyBuffer


' Now, let's clean up the mess here to free up some memory!!  ;)
'--------------------------------------------------------------------------
AF2.RemoveCustomSpr TestSprite
AF2.RemoveCustomSpr BGtile
AF2.RemoveSpr AFlib2_title
AF2.RemoveSpr AFlib2_titleshadow
AF2.RemoveFontSet 1


' Thank you all, and good night, everybody!!!  :D !
'--------------------------------------------------------------------------

....and you can download the result of this code right here, as this one will remind you of all of the amazing sprite blitting that this game lib has to offer for all 8-bit graphics modes in FB!!!

With that happy thought in mind, be seeing you again now!! :king:



GIVING YOU THE VERY LATEST HEADS-UP TONIGHT,

[Image: file.php?id=32]
Adigun Azikiwe Polack
One of the Founders of “Aura Flow” ::: Continuing Developer of “Frantic Journey”
Current Developer of “Star Angelic Slugger” ::: Webmaster of the “AAP Official Projects Squad”
Original Creator of the “The New FreeBASIC 8-Bit Palette Machine” and “AFlib2 - Aura Flow Library 2”
url=http://dhost.hopto.org/aapproj/][Image: file.php?id=194][/url]
Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!! Big Grin !
Reply
#77
To all of you now:

Pardon me up front for making a double-post here, as I have got a brief yet *vital* announcement to make.

Right now, since the old Pionex 450mhz computer from my room area was shot from earlier this month of March 2006 due to a blown motherboard, I was (and currently am! Wink ) allowed on at least one of the other computers to continue the work close to where I left off!! The beauty of it is that I have already and successfully backed up my AFlib2 work (documentation and all!!) on both floppys and CD-R disks just a few days or so before that disaster even happened!!! Big Grin ! Now, I am slowly but surely setting up and making camp on one of the other computers, so to speak, so that I can resume and finish up my documentation for this game lib there. That will at least hold me over until I end up with a newer computer of my own in my room area, ok? Smile !

Thank you people so very much for your fine attention. Bye for now as I do what I can to rock the AFlib2 joint wide open!!! :king:



PICKING UP THE PIECES,

[Image: file.php?id=32]
Adigun Azikiwe Polack
One of the Founders of “Aura Flow” ::: Continuing Developer of “Frantic Journey”
Current Developer of “Star Angelic Slugger” ::: Webmaster of the “AAP Official Projects Squad”
Original Creator of the “The New FreeBASIC 8-Bit Palette Machine” and “AFlib2 - Aura Flow Library 2”
url=http://dhost.hopto.org/aapproj/][Image: file.php?id=194][/url]
Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!! Big Grin !
Reply
#78
wow, thats insane... glad you got your data recovered.. keep up the good work
url=http://www.random-seed.net][Image: asylumsig.png][/url]
Reply
#79
Phew, what a relief. After hearing about your computer, I thought that the lib would be delayed. But that just wouldn't be you. Good luck.
quote="Deleter"]judging gameplay, you can adaquately compare quake 4 with pong[/quote]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)