dreamcast 3d asteroids v0.0.7
by
jimbo : dcasteroids source
Dan Potter and Jordan DeLong of Cryptic Allusion : KallistiOS version 1.1.6
Andrew Kieschnick of Napalm-X : dcloadip including dc-tool
Marcus Comstedt : maple and hardware info including scramble.c
Thorsten Titze / hangar-eleven.de - the tutorials that got me started
Joerg Schilling : Schily's USER COMMANDS cdparanoia mkisofs cdrecord
Brian W. Kernighan and Dennis M. Ritchie : the C language
Bjarne Stroustrup : the C++ language
SEGA/HITACHI/NEC : the cool hardware
Baltimore Gas & Electric: the electricity that powers it

Thanks :
to Professor Houlahan of JHU for teaching me C++
to Professor Kumar of JHU for teaching me OpenGL
to Paul Boese for glScissor
to DoomRaiderC and Ralphis for the sounds
to the AfterStep desktop for the rock texture



links/downloads:
dcasteroids.bin v0.0.7 - 787k
dcasteroids.elf v0.0.7 - 927k

dcasteroids-0.0.7.tar.gz - source tarball - 494k
dcasteroids-0.0.6.tar.gz - source tarball - 494k
dcasteroids-0.0.5.tar.gz - source tarball - 422k
dcasteroids-0.0.4.tar.gz - source tarball - 102k
dcasteroids-0.0.3.tar.gz - source tarball - 83.6k
dcasteroids-0.0.2.tar.gz - source tarball - 81.1k
dcasteroids-0.0.1.tar.gz - source tarball - 79.4k
dcasteroids-0.0.0.tar.gz - source tarball - 130k

dcfighting

linux starter page
unix/*nix cheat sheet - 8k - contains a list of useful commands.


gameplay:
for 1 2 3 or 4 players: this decision is determined by the number of controllers plugged into the console at run time.
  1: red   2: blue   3: yellow   4: green
buttons:

analog stick - aim
direction pad - up/down && strafe left/right

 Y  - forward
X B - strafe left/right
 A  - brake(slow down -> stop)   - while holding A other controls are non-functional.

right trigger - depress rapidly to shoot block, charge for laser blast (ready when meter turns from red to green)
left trigger - hold to zoom in and adjust sensitivity of thrusters and aim

start - pause
  while paused, the buttons and dpad control your settings:
    Y button selects sensitivity of analog stick while zoomed out(green bar)
   //  X button selects the sensitivity while zoomed in
    dpad left/right changes the selected value

    X button also changes view: first person or external

  start to unpause the game...
   this deserves a note as the logic is slightly different than most games(i feel it's better):
    any player can pause the game...
     but to resume, all players must release their pause...
      that is, you can pause the game while its paused, so it is then doubly paused.
       this way, if someone else pauses to check their settings, you can pause as well and check yours,
        then when the other guy unpauses, game play waits to resume until you have unpaused as well.
  all players must be unpaused in order to play.


powerups:
 a colored crate may float into your space.  grab it if you can:
  white = health
  red = machine gun
  blue = spread
 powerups are more plentiful in the lower levels.  stock up on them there, then try to stay alive.

enemies:
 the purple flying saucers will try to shoot you and other players.  shoot them first.
  after a little while theyll lose interest... but in the higher levels theyll come after you for longer...


code:
Makefile
scramble.c - courtesy Marcus Comstedt

functionally:


dcasteroids.h - 0.7k
dcast_main.c - 23.5k - includes

alphabetically:


dcast_consequence.c - 4.8k
dcast_control.c - 17.2k
dcast_draw.c - 5.4k
dcasteroids.h - 0.7k
dcast_main.c - 9.7k
dcf_draw.h - 3.0k
dcf_draw.c - 0.6k





screenshots:





changes:
v0.0.7:
Thu Mar 28 16:37:47 EST 2002
 added a give up time after which ufos fly up and out of space and disappear.
  changed colors of players and scores - red, blue, yellow, green.
   tried out a ship model from DoomRaiderC - looks good, but slows us down too much at the moment...
    fixed a display bug - no "youre dead" message during external view.

v0.0.6: 
Thu Mar 28 00:30:56 EST 2002
4 player action - slow, but it works.  3 as well.
 different color health packs float in:
  white - health +75 (max is 100)
  red - machine gun  (hold trigger lightly for rapid fire)
  blue - spread     (fire three bullets at once)
 enemies randomly drop in too.
saw an enemy float off into space away from the 1p in 1p game...
Wed Mar 27 21:08:27 EST 2002
 enemies now have an opponent field, so they attack whoever attacks them(but first they default to player1).
  destroying an enemy now yields 100 points - to the player who fires the shot that destroys it.
   added a couple more sounds from DoomRaiderC for health pickups and such.
Wed Mar 27 17:27:21 EST 2002
 found and fixed a big ufo bug/typo - now they seem to be fine.
  added powerups which increment health and disappear when collected. also explode when hit.
Wed Mar 27 14:43:02 EST 2002
 added machine gun and spread fire as attributes a shooter may possess... both are simultaneously possible.
  need to flip the up vector when ship is upside down...
    or calculate it based on roll..
     added color to ships health bar(hull_integrity)
      attempted to use pvr spheres(the function from Dan's bubble demo) as asteroids for drawing...
      1) the #define does not seem to be working correctly for turning them on/off...
          another argument to eliminate the globals.
      2) its much faster - noticeably but...
      3) theres no viewport clipping.
fixed a problem in play logic - when player 1 dies, the world is put on hold. 
Wed Mar 27 02:28:38 EST 2002
 added enemy_t struct, follows player and can be blown up.
  added hull_integrity to shooter_t, now players can die.
   press start to be resurrected.
encountered the floating point bug; may have averted it by changing pause detection code:
 split start detection into a separate function.
Tue Mar 26 20:46:43 EST 2002
 added ogg vorbis music playback, which is mutually exclusive with sound effects at the moment.
added velocity transfer from bullet when player gets shot.  scaled by massratio = 0.02.
Tue Mar 26 14:19:45 EST 2002
 found a trap condition yesterday - player hits a wall at the right speed, and gets stuck in it.
  fix consequence function to add a perp.component to velocity.

v0.0.5:
added scoring: 20,10,5,2 for small->large.
 on screen score display for 1 or 2 players.
  for now, shooting the other player will decrease his score by 1.
added level advancement... start at 1, advance by destroying all asteroids and pressing A.
 currently 3 is the maximum difficulty, all others are like it.
added ground and sky, with textures.  terrain map would be better.
trying to add transparency...
added these lines from Dan's gltest.c
// init
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_FILTER, GL_FILTER_BILINEAR);
    glTexEnvi(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_MODULATEALPHA);
// in draw loop
    if ( 1 ) {
        glKosFinishList();
        // glColor4f(1.0f, 1.0f, 1.0f, 0.5f);
        glDisable(GL_CULL_FACE);
    }
    sphere( 1.0, 6, 6 ); ...
    glColor4f( col * 0.9, col * 0.5, col * 0.0, 0.5 );
    if (1) {
        glEnable(GL_CULL_FACE);
    }
Sun Mar 24 20:40:07 EST 2002
 added sounds for primary/laser fire and hit/explosion.
  changed drawing of rocks to one color, rock texture...
   all rocks are drawn as spheres with 1,2,3or4 slices.
    the smaller ones look a little weird, kind of like chunks of rock... ill leave it for now.
Sun Mar 24 12:00:10 EST 2002
 added the explosion type, currently drawn as an orange sphere.
  it indicates where a hit has taken place, and should probably go along with a sound effect.
   color currently decreases with its lifetime...
    transparency would be better.

v0.0.4:
Sun Mar 24 01:45:34 EST 2002
 added two player pause logic; game is now friendly to 1 or 2 players.
  added A button for braking; this makes the game MUCH easier.
   added interface for player settings changed through controller while paused.
    individual view choices as well.

Sat Mar 23 19:18:19 EST 2002
 found and fixed a bug which has become a part of the control system.
  you may no longer apply thrust with BXY while zooming with Ltrigger.
i notice that laser shots seem to linger in space, still having the power to break up rocks seconds after
 they are fired.


v0.0.3:
Sat Mar 23 02:22:55 EST 2002
 added shooter_t *owner field to shots for collisions with _other_ players...
  changed player pointers to an array for multiples.
   added drawing of laser shots(fading in time).
     consequences now include player/shot collisions, so the game canbe competitive.
Fri Mar 22 19:55:48 EST 2002
 glViewport and glScissor combine to make an idiom for split screen view.
        // p1 view
        glViewport( 0, 0, 640, 240 );
        glScissor( 0, 0, 640, 240 );
        draw_scene( player1 );
        // p2 view
        glViewport( 0, 240, 640, 240 );
        glScissor( 0, 240, 640, 240 );
        draw_scene( player2 );
updated to the latest cvs version of kos 3/21/2002.
found a bug: no asteroid display when 2nd controller is plugged in.
found another large bug in moving shot intersection code: wrong index!!!!
 performance is now much better.

v0.0.2: reversed left trigger behavior: hold now to enter "precision mode" - 
 - thrusters are slower (have less effect on your speed)
 - view zooms in
 - analog stick tracking speed goes down
 - ships speed decreases (until trigger released)
also changed right trigger shot behavior:
 press trigger(after not preesing it) for a regular shot
  hold the trigger down slightly to charge for a laser shot
   when charged, the meter turns green.  depress trigger fully for laser shot.
    tweaked crosshair.
X while paused now changes zoom.
fixed intersection bug for moving shots(large one at that!)

v0.0.1: velocity code added.  makes game harder.
 added scoring info display to screen.
  boundary condition and space indicator in green.
   working on moving shots, but might be infected with the fpu bug:
    getting trouble trying to move asteroid processing code into function...

v0.0.0:
 flying code in 3d, asteroid intersection and result code in consequence.c.

---------------------------------------------
TODO:

level advancement:
 each level has a certain level of difficulty:
 - number or asteroids
 - size of inner/outer containment areas
 - bonus timing (more points for completing level quickly)
 - max asteroid speed (initialized randomly)