Saturday, 31 August 2013

Enter the Trap

29th-31st August 2013

Last time, I was working on the main game engine, hoping that everything was working. I was quite pleased with the result of the work so far. However, the colour of the tiles didn't look right on a CRT screen, so I changed the Blue+Purple tiles into Red+Purple. That looked much better. I had a great idea which was to add some kind of effect for every time the player is inverting the tiles. So I drew a sprite which creates a form of a dissolve/fade routine and added routines in the game to make this take effect. Basically, when the player hits a tile that inverts, the second sprite is used to form an animation over that particular tile. Now that I was very happy an impressed with the work done to the game so far.

I decided to move on to something else, related to the project. So I worked on a front end for the game. Unlike many of the front end title screens, where you have a static logo, credits and a scroll text. I wanted to do something completely different. I loaded in JSL's logo for the title screen. Then I converted the bitmap picture into a logo (Charset + Matrix) format. At the moment, this was just a static logo. So I decided to convert it into Swing Logo format. I downloaded Paramount's Shake It utility and converted the logo into a swinging logo format. 

Now I was happy with the swinging logo format. I exported the charset and swing matrix data into the project. Then I worked on the new front end. The 1x1 font was used to display the credits. I programmed in some multiple IRQ raster interrupts into the game's title screen code. Added the screen cuts. Top row of the screen has the first logo. The second row of the screen has the credits, which use the 1x1 charset, the third row has a 1x2 charset, which uses a smooth scrolling text message. Finally the bottom row has the second logo, which swings in reverse. I added some subroutines that would cycle the colour of the logo after a few seconds or so. This idea was inspired by common old-school C64 intros. The result turned out quite nice.

Now what about the game? So far I had 8 levels designed, so I decided to do some more tests on some of the newer obstacles. Unfortunately, for the blob, it stops at an incorrect position, causing the game to mess up. So to solve this problem, I added some simple checks and compared which direction the player was at. If the player was moving a longer distance, I had to trim the move distance slightly for a more accurate position. After I worked on the check subroutine for all 4 of those player directions (Up, Down, Left, Right), I worked on a few more levels, in which introduced the trap switches. If the player moves on to those either the trapdoors will remain closed, or they will all open. The T tile (correct direction) opens the trapdoors holes, and the T (upside down) represented the closing of the trapdoors. This trick worked, and some of the stages (up to level 12) are puzzling. As I positioned trap switches in various places to confuse the player.The result turned out great.

I also did some updates to the music. The in game music high notes part sounded pretty awful to the ears, so I changed the closing melody to the tune. The title screen instrument, which originally used sawtooth, was changed into a pulse ($41) and made the introduction of the tune sound much better. 

The assembled program is so far 10KB and it is going pretty well, and I seem to be progressing pretty quickly with this game. It may look as in the game could be ready for submission bby the end of September this year. Considering the extra free time I have been having recently :)

Friday, 23 August 2013

Here comes the Blob

17th-23rd August 2013

Last week and throughout this week, some people didn't hear from me for a while via email. Some people wondered what the heck happened to me. Well, I have been really busy on this project. As well as some classic gaming :) I also been on holiday for 2 weeks in Lydstep, Tenby as well, away from computers. There were wifi access points down there - but very limited. I wanted to get away from internet anyhow. It is too much of a distraction these days. Although the deadline isn't until 30th November to get the project finished and submitted to RGCD. I have a feeling that I will have it finished way before that particular date.

So then, what has been happening. Before I went on holiday for 2 weeks, between 27th July - 10th August. I was constructing the main game screen, using Jon Well's magnificent Multi Screen Construction Kit. This was only used to design one screen. When I checked the screen out, the size was 2 chars too small. So I expanded the grid and by adding just one more row of tiles to it. I also changed balls to blobs. The numeric counter was changed to blob symbols as well. Some different tiles were created. Those represented different obstacles, such as a normal tile, inverted tile, holes/traps, steel trapdoor, trapdoor switch, arrow pushers, and tiles that push you back to the previous tile. Then saved all of the graphics data, for just in case any adjustments or new tiles are planned. I also composed the title music for the game using Goat Tracker (See video below)


After finishing the game design grid, I captured the screen and transferred all existing screen and colour data directly to a memory location, using the T 0400 07e8 2000 (screen data), and T D800 DBE8 2400 (colour data) in VICE monitor. Then I closed down the VICE monitor and entered the Action Replay M/C monitor to save the data from $2000-$27e8 on to a .D64 image. Detatched the .D64 image and exported it to the C64 Studio project.Then I drew the sprites for the game.

The next step was to do some programming. The first thing I did was extracted all data into to the project directory, in which was called 'Invert'. I also added Exomizer to the directory as well. Compression is the key to starting a program :). I set up the main parameters inside C64 Studio to call  exomizer to compress the assembled binary, and  rename it to run via the decruncher, with no decrunch effect  (10 SYS 2061). Then I started the main programming of the level design. I based the level design on comparing which tiles are to be in place - as the level design was to be made manually by using the !byte command, using a row of 11 and a column of 10. Each number from 0 to 9 inside the table represented the object to be placed into the game area. I created a few routines in which read from the first tile character in each row, added 2 chars to place the next tile. I did separate low/high byte pointers to start from $0452, $0453, $047a, $047b, $d852, $d853, $d87a, $d87b and created a few loops which moved to the next tile character by 2 chars. Therefore with 2x2 chars, I used $0452 for the starting point of the top left tile, $0453 as starting point of the right tile, $047a as starting point of the bottom left tile, and the $047b as the starting point of the bottom right tile. I then added a few loops / subroutines to perform the action. Then it drew the correct test map on to the screen. The $D8xx + represented the colours.

My next step was to add the main player, a bluey blob in which was to be controlled by using a joystick plugged into port 2. I added some routines in which controlled the player. Basically, if the player was moving, and the joystick direction was being read at the same time. That process gets ignored, as the player is moved using a timer. After I was happy with this. I added the sprite/background collision routines, which compared which tiles the player was currently on after stopping on that particular tile. I got the effects to occur. One of which flashed the border (just for a test) if the player was on the hole tile. I was very happy with the overall result, I moved on to something else.

Now the sprite/background collision was ready, I loaded up Sprite Pad V1.8 and drew the player's animation frames. I originally had just 1 sprite for the player at first. Each frame represented the blog expanding and deflating. I liked what was done so far. So I saved the sprite data to C64 format again and inserted into the project. The next step was to program the sprite animation, where the player expanded and deflated at a certain speed. I programmed the routine in and it turned out quite nicely.

Back to programming the main levels. This time testing whether or not all tiles were correctly inverted to how they should look. After getting the routine working. I flashed the border again to say that the level was complete. I also programmed the clock routine. What a happy chap I was with this result.

Now came the nightmare, which I had for a few days. I designed 4 test levels, but after a level was finished. The tile data from the next level was out of place. I was pretty confused about how that happened. It puzzled me until yesterday. It turned out that I had forgotten to add the low and high byte values of the starting characters, which should initialise the first character and colour RAM position for each corner of the very first row of tiles. After that was solved. I programmed some messages to show LEVEL COMPLETE, LIFE LOST and GAME OVER. Then I was in the mood for doing some music.

I loaded up Goat Tracker V2.27 and worked on the in game music. Unlike the first tune which was used for the game, I wanted to do something pretty funky and quite cheerful. So I did a sort of funky cheery jazz type of tune as in game music inspired by demo scene musicians such as PRI, JCH, Drax, Syndrom, etc. Then added a game over jingle, inspired by the game over jingle from the "Artris" demo, by Scruffy Bits/Color7, which appeared in Commodore Format's cover tape #53. The result turned out pretty good. I generated a .SID file, and tested the .SID. Great, it worked. Now I transferred the music to the game project source, as .prg. I added some more routines in the game which plays the music. Awesome. It suits the game well. 

Now it was back to Sprite Pad V1.8 again, so I can add some explosions to the animation. This occur when the player loses a life, but first the blob sinks through the ground (or hole) magically. This can happen when time runs out or the player falls through a hole. I exported the new sprites to the project directory, then programmed the life lost routine, where the player gets killed. It looked quite good, but I wanted to add one more thing to the life lost routine. Shaking screen during the explosion. The pointers inside the explosion loop also read the animation table for the screen shake. Then restores the screen back afterwards. Wonderful. I love the overall result so far. So then what next? A real C64 test.

I copied the compiled .PRG to my 1541U2 and tested the game in action. Unfortunately, it looks as if I may need to adjust the correct tiles slightly as on the PAL monitor (TV) it doesn't look all that good. Still that won't really be much of a problem. Just a slight character change, and it will probably look much better. Everything else seems to be ok. More on this next week, as I am intending to get the FINAL touches done with Trance Sector Ultimate for RGCD tomorrow (Saturday) morning. Just a final bug fix for that.

I recently received an email from JSL offering me a front end logo for this game. Well, I am happy to take this, but I just hope it will be a 3 colour logo consisting of  7 or 8 chars down. There'll be no pressure either. After all, this is a hobby project - not exactly real life work :) I would like to to add one or two logo swing routines to the front end, so a 3 colour logo would ideal.For now, I shall enjoy a cup of tea. Then off to work in under an hour's time. Enjoy the game play video so far and tune in to another blog update, probably next week. Cheerio!