News:

Function Finder  Find all the functions within source code files

Main Menu

Xenon 2000 Tech Demo

Started by kevin, December 21, 2003, 04:24:39 PM

Previous topic - Next topic

kevin

Xenon PlayBASIC Tech Demo
=================

After releasing the latest alpha for testing to the team yesterday (private) , I've been spending most of the day getting my hands dirty actually using PB myself.  My aim today has been to create a basic, mini recreation of  XENON 2000.   Mainly since I have a full complement of art work to mess around with.  After a day of messing, I've squashed a few annoying bugs, and spotted a few 'would be convenient' but missing commands..  It's all of the process

 Anyway here's a shot of the demo as it evolves.   The next step will be to set up a wave creator for the bad guys, so it runs like your average vertical shooter.   It's missing collision to the maps and each other though..


Video Of Xenon V0.10


Edit: Video added in july 2017

kevin

#1
Pushing It
=================

Spent most of today looking for a bug in the array commands, only to find a dumb logic bug in my test program :).. ahh typical..  Anyway so far i've added a few more commands to the sprite/camera set .   In this shot bellow  i'm test how much load it handle on screen.  With each little tweak it's making the management routines simpler and simpler.

Bellow is all the bullet creation/delete and controller functions from this demo.. Take note of the sutble use of the array commands to find/rebuild the passed arrays.    This type of system is complete dynamic, and can you handle thousands of the objects like this.  There's actually a fair bit of bloat in that code. I.e. the types really don't need the store the bullets positions..   As it's faster/easier to use the sprite system directly, than do movement/clipping manually.


PlayBASIC Code: [Select]
Function Update_bullets(Bull().TPlayerBullet,ThisCamera)
Items=get_array_elements(Bull().TPlayerBullet,1)

For lp =0 to items
if Bull(lp).status=true
ThisSprite=Bull(lp).SpriteNUmber

MoveSprite ThisSprite,0,Bull(lp).Speed
if SpriteInCamera(ThisSprite,ThisCamera)=false
DeleteSprite ThisSprite
Delete_Bullet(Bull().TPlayerBullet,lp)
Continue
endif

CurrentFrame=Bull(lp).CurrentFrame
SpriteImage ThisSprite,Anim_Missile_Frames(Bull(lp).BaseFrame)

inc CurrentFrame
if currentframe>1 then CurrentFrame=0
Bull(lp).CurrentFrame=CurrentFrame

endif
next

EndFunction



Psub Delete_Bullet(Bull().TPlayerBullet,index)
if Index>-1
If Index=<get_array_elements(Bull().TPlayerBullet,1)
index=index*4
Clear_array_Cells Bull().tPlayerBullet,Index,index+4,1,0
endif
endif
EndPsub


Function Add_bullet(Bull().TPlayerBullet,Xpos#,Ypos#,Speed#,BulletType)
Index=GetFreeBullet(Bull().TPlayerBullet)

Bull(index).Status=True
Bull(index).Xpos=Xpos#
Bull(index).Ypos=Ypos#
Bull(index).Speed=Speed#

bull(index).CurrentFrame=0
Bull(index).CurrentFrameSpeed=0
Bull(index).FrameSpeedMax=4

Sprite=GetFreeSprite()
Bull(index).SPriteNumber=Sprite

Bull(index).BaseFrame=BulletType*2

CreateSprite Sprite
PositionSprite Sprite,Xpos#,Ypos#

EndFunction


Function GetFreeBullet(Bull().TPlayerBullet)
repeat
Items=get_array_elements(Bull().TPlayerBullet,1)
FreeItem=Find_array_cell(Bull().tPlayerBullet,0,4,items+1,0)
if FreeItem=-1 then redim Bull(Items+10) as TPlayerBullet
until FreeItem<>-1
endFunction FreeItem





kevin

#2
Absolutely Pushing It
=================

   It's xmas morning here and I'm still plodding away on PB and this Xenon tech.   I wouldn't call it a 'game' demo, just a pure tech demo.  The following picture shows an extremely intense stress test, the test is mainly upon the collision system. In this scene the bullet objects have full collision against the little flapping alien objects.  Even with hundred of on screen PB intelligent collision design barely makes a dent in the frame rate.   (a solid 50 FPS)  Duron 800/ GF2mx 200/ WinME

 For the record, PB currently does NOT feature any partitioning of scene space.  Obviously through partitioning it could be even faster.  Ultimately the world system will include partitioning. The type of collision being used here is BOX.  While shape based collision will add extra over head, and even more so for 'pixel', i'm pretty happy with this sort of performance..

 Another interesting concept that's built into the sprite system is the ability to find multiple impacts.

froggermon

wow. thats looks really nice.  Where did you get the sprites from?

kevin

#4
The backdrops/sprites are from Xenon 2000.. Without them it'd be the blocks flying over a checkboard demo :)

So the idea of the demo is to  show that a person could create something equally as pretty as the Bitmap Brothers, given PB and a really good artist :)



Download


   Check Out Xenon 2000