allegro speedhack competition november 1999

progress of the snake game

times are dutch times, gmt + 1

friday 

17:00 finally arrived at home after retrieving my bike from the store.

17:10 wrote down preliminary ideas on a large sheet of paper, together
      with the speedhack rules and technical demands.

17:30 created a makefile and started off.
      allegro initialization
      main function
      options sorting

18:00 food! aah! fries!
      1 episode of 'the nanny' later...

18:45 installing and creating timers

19:00 making this progress file.. eew. that paper with ideas is
      getting really full :)

19:50 made classes rect, bodypart, and body.

21:00 added moving functions to the body class, including gonio for
      using angles and determining stepsizes

21:30 started making the game loop and the drawing code. ah. this is
      where it get's messy :> first try is a single player, drawing a
      snake that doesn't grow, including a red dot that moves to
      indicate the timer.

22:00 this is too slow! (double buffer, X-windows, 640*480 24 bit)
      adding a dirty-rectangle system (roughly) to speed things up. it
      get's better, but pretty complicated too. then the thought
      crosses my mind that i want to have the whole screen
      scroll... is a dirty rectangle system going to do me any good?

23:00 let's visit martijn to break his concentration, see how far he
      is, and fish some answers out of him :) conclusions:
      - dirty rectangles even for a whole scrolling screen, unless i
      get too many overlapping rectangles
      - go back to 8 bit where possible to increase speed
      - possibly accept that X-windows will just be too slow for this
      game.

24:00 arrival :) we're not going to bed quite *yet* ... updating this
      file and uploading it, then i'll start making a decent setup for
      more than one player at a time.

01:00 finished the player class, including space to put key
      definitions for each player.

01:40 created a dirty rectangles list. hmm. the way it seems that
      every cd is over really soon (and i've heard quite a couple
      already :) suggests that time really is flying :) the clock
      suggests the same.. now that i think about it :P

02:00 - 04:00
      have i ever mentioned that i severely dislike dirty rectangles?
      :) apparently i'm still doing something wrong because the snakes
      are working flicker-free, but the borders of the field are not
      at all stable. i'll look into that tomorrow. the multiplayer
      version is most likely going to have a split screen, causing the
      required resolution to be high. this will probably increase the
      need for a good dirty rectangle system. we'll see tomorrow.

04:22 i'm now reaching the point where i have to go over every
      sentence 6 times and each line of code takes 10 re-reads :) that
      would be the point where i'll go to bed and start fresh in the
      morning. HAHAHAHAH. i just read arron's entry claiming he did
      shopping, i just realized what i forgot tonight :) tomorrow will
      be fascinating, i think i'll go to the store first thing in the
      morning.

      oh, and i *still* hate dirty rectangles :) tomorrow i'll try
      this thing out under dos on the other machine (slow pentium) to
      see if it really is too slow or if it has to do with X-windows /
      fbcon modes. we'll see. night all.. see you in the morning :)

saturday

10:30 *beep beep beep beep beep beep beep beep*
      i *know* i have to use the bell in the program.. but not *that*
      often.. *yawn*.. oh darn it's the alarm clock.

      -one long shower later-

      first thing i did was to try my bright idea to stop double
      borders.. split up dirty rectangles into 2 separate lists: one
      'clear' list, and one 'new' list. that should ensure that the
      borders are first erased and then redrawn. alas, the cure did
      not work.

12:00 i'm hopelessly out of everything, but mostly food. off to the
      store.

12:30 back, and pondering what i'm going to do with these stupid
      borders. i'll try to debug them once more, otherwise i'll just
      prevent them from scrolling into the screen, and makes players
      die a horrible death when they hit a border .. *GNAGNAGNA*

14:00 fixed scrolling of the screen, it now scrolls until the borders
      and only when the snake is too close to the edge of the
      viewport.

16:00 visiting martijn to get some inspiration. got the golden clue:
      the game is being so slow because i (bonk bonk bonk bonk) do a
      clear on a 1500*1500 bitmap. removed it, and reached 100 frames
      / second on a pentium 166. that will do :)

17:50 i'm going to make dinner and start implementing bonusses and
      collisions. then i can try and make the 'action' button work.
      also the idea of an overhead map is very tempting, i'm going to
      try that tonight.

18:50 - 21:30
      pasta sauce all over my design.. :) well we'll have to ignore
      that i'm afraid. Mell Collins on the saxaphone with the
      direstraits, and we're all set :)
      - bonus class made (dead snakes and real bonusses)
      - bonus list made
      - dirty rectangles added for each viewport for each snake, not
        just for one snake 
      - dirty list added for the scratch bitmap so i don't need to use
        a clear_to_color on a 1500*1500 bitmap. you're probably
	laughing, aren't you? well i'm not going to look for a more
        ingeneous solution :P
      - bonus generator made
      - drawing of bonusses works (very simple, but circles work)
      - crashing of snakes (leaving dead bodies) works, but makes the
        game slow if too many dead bodies are created

22:30 bonusses are starting to work (they actually do something now if
      you eat them). created the planned 'chainsaw' and 'burrow'
      modes, to saw through another snake (or your own tail) or to
      burrow under ground. created scoring bonusses that make your
      tail longer.

23:45 - 01:45
      martijn comes by, we install fbcon modes on the other linux
      machine, and allegro. martijn is getting along pretty nicely
      with his kloink game :) i'm jealous of the graphics (of which i
      am severely lacking) already.
      I now have the chainsaw mode working, you can cut your own tail
      off. things that are left to do:
      - some nicer colors or graphics for the snakes
      - some kind of background texture (it has to be fast to blit for
        scrolling) so you can see you're moving over a background.
      - set up and test the viewports for multi player mode
      - incorporate the beep somewhere (i think i'll either use it for
        the chainsaw or when you pick up a bonus)

02:00 - 03:10
      set up a palette and true color array for doing slightly more
      fancy coloring. added a screenshot key, and made a screenshot to
      upload with the progress report.   
      
sunday

10:30 *beep* *beep* *beep* *beep* *beep*
      this is getting old.. not again! :)
      took a long shower, found my pasta from yesterday and decided to
      eat the leftovers right away. tonight we'll settle for takeaway
      :P 
12:30 girlfriend on the phone.. and i haven't even started yet :)
      anyway, we'll see what happens.
13:30 i'm finally on my way. started off with making a flashy effect
      (oooooooh what gross colors :>) for the number 29. i challenge
      you to find it, but i swear the number 29 has some special
      effects in the game :) (and not just the lame command line
      option :)
      next step is implementing more than one player. everything
      should be finished already, but i'm keeping my fingers crossed
      that it will all work right away.

13:30-16:00
      multiplayer works, except that martijn was right, X version of
      allegro doesn't understand subbitmaps of screen. i'll have to
      look into a solution for that. under X it is now only possible
      to play with 1 player.

      added mouse support for the fourth player. mouse doesn't work
      under fbcon. aaargh! now i cannot test all features at once :P

      added highscore screen, to exit the game
      added end conditions: all players dead or one player reaches a
      length of 500. levels might still come, but i doubt i'll have
      time for it. this will have to do.

      what's left to do is:
      - record some sounds at martijn (circle saw and burrow sound)
      - add an intro screen where you can pick the number of players
        and the screen resolution
      - add tickmarks on the background so you can see you're moving
      - add an overhead map projection with xor drawing

      i'm uploading this, then off to martijn to record some sounds.
      dang, i still have to find out where i have to upload my entry
      when it's finished :) i hope martijn knows or the webpage shows
      it. 

18:00 - 20:30
      continuing. made sounds at martijn's, and asked for advice about
      the overhead map and the non-function subbitmaps under
      Xwindows. added sounds. they work :> added tick-marks on the map
      so you can see that you are moving. it's now 20:30, i'm updating
      this progress report and uploading it before i continue.

      things left to do (before midnight preferrably, i have a dentist
      appointment tomorrow morning)
      - overhead map
      - print score on the screen
      - make a DOS makefile
      - intro screen + settings for resolution and number of players

      in that order.. i'll see where i end.

20:30 - 22:00
      created the overhead map aaaaargh.. rescaling, yes / no in
      separate viewports, i finally had the complicated version (one
      map over all viewports) done to find out it doesn't play very
      nice so i took the easy way out after all.

22:00 - 23:00
      score box prints on screen

23:00 - 24:00
      tested the dos version. works with one filename changed. had to
      install allegro again under dos because the old version i had
      doesn't understand KEY_ENTER_PAD. created a README file for the
      project.

24:00 - 2:30
      made the intro screen. aaaaaaargh! i don't know what exactly i
      did wrong, but i couldn't get it right with 8bit and / or true
      color. i ended up including both a 8bit and a truecolor version
      of the bitmap. took way too long (eew, i have to be at the
      dentist in 6 hours) but oh well, that's part of the fun of the
      weekend i guess :)

      i really hope everything works now and that i didn't miss any
      vital parts. i guess Aron will be putting the entry up on his
      web site, i will put a copy on 

      http://www.icce.rug.nl/~hein

      follow the 'software' link to get there.
      if anyone has any building trouble or questions (most should be
      in the README provided) please let me know. oh, i made the whole
      thing a .tgz file and also a .zip file for those who have
      trouble with .tgz.

      -- uploading and bedtime.. finally :) --
