News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

ThesiusXIII - Forest Blast Tech

Started by kevin, May 06, 2007, 04:05:58 PM

Previous topic - Next topic

kevin

#30
Thesius XIII Forest Blast  - Download

    Decided to release source code as is.  Basically it's the game frame work, without a real level to play :(.    I've decided to release it now as it's been some 3/4 weeks since I touched it and given that i'm currently bogged down updating old the demo/media packs.   This could have easily fallen by the way side. So here it is.

    The code was written in PlayBasic 1.62/1.63.  Feature wise it only uses a handful of PB effects, namely pixel perfect collision,  variable and alpha 50 blend modes (sprites and box) and Alpha colour addition for sprite flashes.  If you removed the 'linked list' controls in the particle library, it'd compile and run really old version of PB also. I.e.  PBv1.40 possibly as low as probably V1.30.

    This demo was largely created from cut-pasted tidbits from the PlayBasic example packs.  Most notably from the AXIS demo,  which is what the whole thing is based upon.  The art work is a combination of stock PB artwork like  Blink's forest backdrop, combined with Pincho Paxton's Trillion art (Ship/buildings),  combined with some elements from TheMaskedCoder's  and various tidbit that were sitting in my GFX folder.  I've no idea where they're from..  

  Have fun working it out :).


Download

  Download Thesius XIII Forest Blast (Source Code only) (login required) (2.4meg)



Rembrandt Q Einstein

Amazing work Kevin.  The effects are phenomenal.  I had never considered a shoot 'em up where the ship goes above and below water, but not only does it look great, but I'm sure it would allow interesting possibilities for enemy design and gameplay.  Looking at your code I thought you might have some secret functions to keep the framerate high, but saw the same inkmodes and spritedrawmodes that we all use.  What was the reasoning behind not using either sine shapes or a water image instead of the box command for the water?  Would framerate have suffered too much?

"This example was written coincide with the Blaster Blaster competition. " means that it's not an entrant I'm guessing?  I'm sure it would rack up some programming points (but might suffer on sound ;) ).

kevin

#32
 
QuoteAmazing work Kevin.  The effects are phenomenal.  I had never considered a shoot 'em up where the ship goes above and below water, but not only does it look great, but I'm sure it would allow interesting possibilities for enemy design and gameplay.  Looking at your code I thought you might have some secret functions to keep the framerate high, but saw the same inkmodes and spritedrawmodes that we all use.

  If only I had $1 for every time i heard that. :)

QuoteWhat was the reasoning behind not using either sine shapes or a water image instead of the box command for the water?

    Originally i just cut and pasted the sine water height demo into the axis demo. And that was it for a while.   I didn't like the way it looked with a perspective scene.  Mainly since the viewer can stand above the water line, so you can see over it.  Which breaks the illusion.    You could project a triangle mesh, then then you'd need  clip the triangles against various building planes.  Doable, but a bit messier.


QuoteWould framerate have suffered too much?

   There'd be a slight overhead in rasterization, but after that, they use the rendering code.   It's a little difficult to see now, but the blending level of the water changes the deeper you get. 


Quote"This example was written coincide with the Blaster Blaster competition. " means that it's not an entrant I'm guessing?  I'm sure it would rack up some programming points (but might suffer on sound  ).

    ahh, If only I wasn't judging the competition :)     



kevin

#33
 Code Update - Changes

     If you've tried running the Thesius XIII source/demo in PlayBasic V1.7x revisions,  you've no doubt run into an odd sprite doesn't exist problem.   I'd assumed this was from some difference with how the sprite list is traversed in PB1.7x, but it turned out that older editions of the PB (1.63 and bellow)  let you to attempt to detect impacts against sprites that didn't exist without raising an error.   This is not the case in PB1.7x editions however.

      Anyway,  So in order to get this demo running in newer editions of PB you'll need to replace the UpdatePlayerBullets() function (found in the Player source Tab) with one provided bellow.  Effectively what was happening was when a bullet left the screen, it was being deleted but rather than continuing the loop, it was falling through and hitting the SpriteHit command.    There was another logic error which would occur when bullet hit an alien.     Rather than  grabbing the Next Sprite in the list prior to subtracting damage from the hit alien,  it was doing it after it.   This is no problem when the alien wasn't destroyed, by if it was, the code would  end up reading a none existent sprite and popping a runtime error.

      Moreover, the original source code used the SpriteImageRGB command which is obsolete  in PB1.7x revisions.   While it's not actually used in the demo, it's present within the source code, so you can just delete or comment out any such instances from the source and it should compile and run.    When I get some time, i'll build a version of the source that will work in both editions,  Which is just a matter of  adding optional compilation tags.





Function UpdatePLayerBullets()
For Bullet=0 To GetArrayElements(PlayerBullets().tPLayerBullet,1)
If PlayerBullets(Bullet).status

x# =playerbullets(bullet).x#
y# =playerbullets(bullet).Y#
Spr =PlayerBullets(bullet).sprite

Select PlayerBullets(Bullet).Brain
Case PlayerBullet_Directional
Angle#=PlayerBUllets(Bullet).angle#
x#=CosNewValue(x#,angle#,10)
y#=SinNewValue(y#,angle#,10)

EndSelect

playerbullets(bullet).x#=x#
playerbullets(bullet).y#=y#
PositionSprite spr,x#,y#

If SpriteInCamera(spr,Screen.camera)=False
Delete_PlayerBullet(Bullet)
continue
EndIf

KillBullet=False
CheckSprite=GetFirstSprite()
Repeat

HitAlienSprite=SpriteHit(spr,CheckSprite,CollisionClass_Alien)

If HitALienSprite>0

CheckSprite=GetNextSprite(HitALienSprite)


SpriteDrawMode HitALienSprite,2+4096
SpriteAlphaAddColour HitAlienSprite,RndRGB()

CreateExplosionAnim(ExplosionAnim_Small,x#,y#,z#,rnd(360),rnd#(5),rndRange#(0.5,1.5))

if GetSpriteCollisionClass(HitAlienSprite)=CollisionClass_Alien


; handle Damnage on alien LAST..
; get the player that fired this shot
player=PlayerBullets(bullet).player

; handle damage alien and return score (if any)
Score=HandleAlienDamageFromSprite(HitAlienSprite,1)

if Score
Players(player).score=Players(player).score+score
Players(player).ScoreRefresh=true
endif

endif


KillBullet=True
EndIf
Until HitAlienSprite<1


If KillBullet
DeleteArrayObject(PlayerBullets().tplayerbullet,Bullet)
else
Inc NumberOfPlayerBullets
EndIf


EndIf // end of Status check
Next

// The Number Activate PLayers bullets this update
Game.Stats.ActivePlayerBullets=NumberOfPlayerBullets

EndFunction

kevin

It's back again

    It's been a long time between drinks for Thesius XIII, while this demo wasnever intended to be 'complete' game,  I'm in the process of adding a few more nick knacks so that this can be used as feature game in the upcoming re-release of the PlayBasic Demo.    Thesius XIII is of course a bit of shout out to a shooter I wrote some 15 years ago on the Amiga.  How time flies!


Object Manager

     So far, I'm just  tinkering around with adding an dynamic object trigger/management layer.  This object manager controls the activation of dynamic objects throughout the world.    In other words the engine stores all the objects in a list definitions or triggers if you will,  these  objects are effectively sitting in hiatus when in this state.    When the player reaches a particular point, the object manager triggers (adds) this object class to the scene, with the required properties (position, scale whatever)  and hey presto the character appears where-ever you've defined in with the world space.

    The level definitions looks like this.   So far the parser only supports the Mine trigger, but it's all seems to be working ok.  There's only 4 or 5 objects (all the GFX i've got) anyway :) 


<Triggers>

Mine=1100.0,200.0,400.0
Mine=1200.0,300.0,400.0
Mine=1300.0,500.0,400.0

Mine= 700.0,000.0,400.0
Mine= 800.0,000.0,400.0
Mine= 900.0,000.0,400.0

Mine=5300.0,500.0,400.0,0.0,0.0,0.0

</Triggers>




thaaks

Do you use UFF for the definition file or something else?

BTW: Is there some XML parser for PlayBasic flying around?

I will look at this game tonight - I completely missed it during my year of PB absence but it looks great!

Cheers,
Tommy

kevin


QuoteDo you use UFF for the definition file or something else?

  See the source.


QuoteBTW: Is there some XML parser for PlayBasic flying around?

  not that i know of.


kevin

#37
  Thesius XIII V0.16  - Bunker Objects

        Slowly picking through this in my spare time.  Adding a new object class bunkers and some more triggers, so that objects that are already implemented can be positioned in the level.   To save design time ( even I find that funny :)), objects can be triggered in two ways.  Individually or via random batches.    Obviously individually is where you trigger each object at a particular spot (ie. tedious), while random batches allows you to create an invisible objects that randomly spawns objects into the scene for a certain time.     Anyway, here's another piccy.


kevin

Thesius XIII V0.20

      Finally got back to working on this after various interruptions.   First thing on the agenda has been to change how the game engine deals with the world & screen space.     The previous editions the game engine had various ways with dealing the objects.   Some objects worked in world space coordinates others worked in screen space.   This was causing a few issues with syncing the camera movement as well interactions with the player.    Which was largely due to the hacked together origins of the demo.  Ie. Cut and paste     While such changes aren't slap in the face obvious (but you can notice while playing)  it now means everything (hopefully) uses the same system.   This means the player can now stop/speed up etc and game engine manages objects better.

       The picture bellow is another fairly samey picture.  It's simply showing a couple of new ship object types I've managed to scrounge up.    So far they have no behaviors, but they're likely to be pattern based (See Here).    Basically canon fodder.   Also implementing some fragment explosions in static mines (more cut and paste :)).  Got a few other ideas but don't want to get two far ahead of myself..   Can always implement them later.


kevin

#39
 Thesius XIII V0.21 - Fragments

   Been tinkering with adding fragments the past couple of hours.  These are particle type that generate a temp 'burnt' image when an explosion occurs.   The piccy bellow is overkill, stress test if you like.   It won't be used at this level in the actual demo.  Anyway,  it's simple but effective

kevin

#40
 Thesius XIII V0.21 - Demo

    Since the last session I've implemented most of the object types.   All that really remains now is the boring level layout stuff.   Since current there's no real fixed level to play, so most of it's random..

    One of the new alien controllers is generic path follower (It uses this code - surprise surprise ). ATM the falcon V ships (the sorta wedge looking ones) use it.   But they all use the same (odd ball) path from random spawn points.   If there's time i'd like to  set up the objects to run sets of paths. So you can make longer paths from smaller fragments. A bit like lego.   Which is an idea from my  original Thesius XII  game (Amiga).  In T12  the path/animation engine had controls to make random choices, even comparisons, animations triggers and loops.   This enabled objects to move through common junction points at will.   The idea was to give the fixed behaviors a more  dynamic feel.  

  Anyway, I've attached a demo for you tinker with. Have fun!



Controls

  Mouse = Control PLayer

   F1 = Trigger random spin mines
   F2 = Trigger random crabs
   F3 = Trigger random path based falcons.

   F5 = Slow down
   F6 = Speed up

   F8 = Add bullets to player

   Space = Trigger Homers

   Enter = Show Stat's

   ESC = QUIT



Download

Thesius XIII  V0.21 (login required)


 Built with PlayBasic V1.63v

monkeybot


ATLUS

Cool!!!!its good game and good demonstration for playbasic!!!!!!!!!!!!!!!!

kevin


Thesius XIII - Pattern Editor

  Yep back working on the Thesius XIII tech demo, so I figured I might as well throw together a bit of pattern editor. Those with a keen eye will no doubt notice that it looks a lot like this Path Movement combined with this BackDrop. That's because it is :) All i've added to this version is a camera so I can move outside of the 'game' viewport. This allows paths to be defined that start and end off the screen.

kevin

#44
 ThesiusXIII V0.25

      This version setup to play a real (well thrown together) level now.   So objects are spawned through the trigger list, paths etc etc.. It's funny how much of a difference that makes, as all of sudden it's starting to feel like a real game.   All be it, a very one side game at the aliens are much stronger than the player.. but ya get that :)

Anyway, here's a few more pic's