Notebook

Updates on all of my latest projects

Making an Atari game – Day 22

It’s funny, everytime I plan on working on one thing, when I get into coding I end up working on something unrelated. I didn’t end up going near the Endboss code today. I always thought the game would be a little better if the dungeon had at least some locked doors and keys. This may sometimes force the player to backtrack through places he/she may have ran through or explore more of the floor they may have missed. I was thinking I wouldn’t have room for keys and locks but kind of thought of a better alternative tonight. I decided to make a locked cellar door, which would randomly appear on some floors where the ladder to the next floor should be. I then made a pulley switch that is placed somewhere else on the same floor. This Switch will swing either left or right, depending where it is when the player hits it. If the switch is pointing towards the right, then the locked cellar door will disappear, revealing the ladder. If the switch is pointing to the left then the door will be locked.

It’s kind of a basic but neat little system. I’ve never really coded a switch before in a game that when activated, it then effects something in a completely different room. Was kind of fun and simple, not much code required and in the long run I think it was a better solution to having keys.

I also placed the Princess on the 32nd floor (thinking that might be a good spot to end this game). Then I started to work on sound effects a bit. I added my first real in game sound, which is the sound effect that plays when a monster takes damage. Im not great with sound effects yet and don’t have a full understanding of it so this might take a bit of time and research if I want this game to sound half decent. Since this game will be a long one. I want to make sure that none of the sound effects will become annoying over time.

[Edit: Two hours later] – Okay, the sound effects don’t appear to be as difficult as I originally thought, thankfully. I took a quick look at some example source code and played with “The bB Music and Sound Data Creation Toy” on Random Terrain and just through some quick trial and error really, I managed to come up with roughly the kind of sounds I was picturing in my head for this. I wanted a Mario coin like sound. I think I came kind of close to that. I adjusted the enemy damage sound to be more satisfying when you hit them. Created a nice higher pitched sound for when you get an item like meat to gain health. Also got a new sound effect for when you pick up the two Swords. And lastly, I made a small little woosh sound for when you swing and miss with your sword. I’m pretty happy with that. Only other sounds I need to make is a sound effect when the player reaches a ladder and another one for when the player takes damage.

There doesn’t seem to be too much more to do on the coding side of this game.. All that I can see that is left is:

  • Create an EndBoss (possible multiple, if I can squeeze them in there?)
  • Create a nice (hopefully) bitmapped title screen (Game Over & Win screen if there is room)
  • Sit down and think of what monsters to keep, disregard, and replace. Also think about how I want to place them throughout all of the floors to keep a nice steady increasing challenge.
  • Oh also, that dragon I made.. I would like to do something with him. Maybe make him a bit smaller, or turn him into something else completely. Another flying creature, so he can fly through obstacles in the room and make a b-line straight for the player. I also want to give him 3 or more hitpoints to kill. Overall just make him work better and appear more throughout the dungeon.

And I think that is it on the coding front?? Of course I will have to go through and polish things where I can and add PAL support, or create a separate PAL file. But yeah. I feel like I’m on track to hitting my 30 Day goal. I’m soon going to have finished my first Atari 2600 video game! 😮 I’m beyond excited about this 😀

Making an Atari game – Day 21

I Worked on making the enemies move a little smoother and Fixed 2 bugs.

  • The 1st bug, the player would randomly lose a hitpoint when he/she walked into some rooms.

What was happening was when you walk into a room, the player is sent to the opposite side of the screen and the next room would be drawn. However, the enemy sprites weren’t relocated out of the way before the next drawscreen command. This would cause a collision with the player and the (seemingly invisible) enemy, and the player would lose a hitpoint.

  • 2nd Bug, The cloud of “smoke” would disappear waaaay too fast after you killed an enemy.

I have saved a separate file every time I make a major change to the code. Right now I am on file number 40. I didn’t notice when the enemy death animation broke, so I went back and found the last working version on file 15. The reason it broke was because of the way I draw multiple enemies by sharing sprites. Basically, once I added more than one enemy to the game, the death animation ended in a single frame (a blink of an eye). The reason is because when the program calls the death animation to be drawn, it draws it for the current dying enemy. But then the program calls the draw monsters routine, which draws all 3 monster sprites at once before the death animation was finished animating. This was replacing the enemy death animation because all 3 are sharing the same sprites. It was kind of complicated trying to fix this one but I eventually did and added in a bit more frames before the animation ended to make it last a little longer on the screen. Just enough time that it feels satisfying to me to kill a monster and see them disappear in a white cloud. I tend to obsessively play and adjust over and over until things feel just right to me.

I added Enemy tracking. Now I can pick and choose which enemies I would like to be more intelligent. If the Track Player variable is set to 1 on the enemy, then that enemy will constantly walk towards the player in the room. Makes the game a little more challenging when all three Monsters are attempting to swarm the player.

Designed a new EndBoss Lair that I am hoping to use for multiple EndBosses. Right now the lair sits on the seventh floor in the third room up. Then the princess is in the floor just below it. This will all change though, once I start play testing and try to design the actual game to be more fun and structured. Right now everything feels very random and out of place. It’s like I have all kinds of working pieces, they just aren’t all fitting in with each other nicely yet.

This whole project feels like putting together a large puzzle. It’s like a puzzle that you make and at the same time have to solve yourself. That is pretty much all it is. It’s a fun puzzle to put together for me, which will hopefully turn out to be a fun game for you.

Next I think I would really like to work on making an Endboss… I also need to get some sound effects going too. I have the driver all made and just kind of sitting there. Need to start experimenting with creating the sounds I want this game to have. I think that will make a huge difference in the feeling of this whole project.

It’s getting close to Christmas however, which leaves me with less free time to work on this. (Update: keep in mind, these are notes that I wrote while I was writing this game back in December of 2018)

Making an Atari game – Day 20

When I originally set out to do this project. I was thinking that it might take me around 30 days to complete. That was just a rough guess, not knowing anything about the Atari yet. Now I’m just sitting here by my girlfriend and just said to her that I can’t believe this is Day 20. Only 10 more days and I might actually make it.

Haha, kinda early to say cause anything can happen, but I am so far along now that I think I could actually have the code completed by then. That is really exciting.

Today I kind of took it easy and tinkered around with the code a bit, which was kind of a nice and relaxing night. Nothing too strenuous on the brain but very happy with what has been added.

So far I had a bunch of monsters coded into the game, different graphics and such. But if I played the game it would only ever show one of those monsters through every room and every floor. The one type of monster. If I wanted to see the other ones I would have to change a variable’s value in the code and then compile and run it again.

So tonight I finally got all the monster types roaming around the dungeon in a specific order. Some kind of look better/uglier than others but they are all there. I think I’m going to sit down next and kind of plan out what monster graphics I want to keep, which ones I should replace with something a little better, and what the best order of appearance should be for each one during gameplay.

Making an Atari game – Day 19

I managed to free up even more space today by changing how I placed monsters in a room. This should hopefully give me the space needed to create an endboss.

The "Master Sword"
The “Master Sword”

Once I cleaned that code up I started work on adding the “Master Sword”. This is what I decided on turning the spear into that I talked about earlier. I created the pixel art for it and decided to place it somewhere on the early floors for now. I also gave it a new room to sit in. I find it makes it feel a lot more important than how I originally had it where it was just lying on the floor in any random hallway. 

Once I placed the sword in the game I figured I should put the Win Game princess in there somewhere. Since the game really needs to be beatable, I figured I shouldn’t save the princess for last or I might end up running out of space somewhere. For now the princess is sitting in a copy of the “Master Sword” room. But if by the time I am finished this and there is enough room I may create a different one for her.

As of right now, it just takes damage off the player when he touches the princess lol. This is because she is just a copy of an enemy sprite. But it does check for collision and for now I am going to leave it where it is. I am hoping I’ll be able to add a win game graphic in bank 2 along with the title screen and game over screen. I’m really not sure how much space those full screen graphics will take up. So again, I guess I just have to wait and see. 

Making an Atari game – Day 18

Tracking magic missile
Tracking magic missile

Now I was thinking about how in Yar’s Revenge there is a little tractor beam/missile like object that follows you around the screen at a very slow crawl as you are trying to take out the main enemy. I always found that dynamic fun, and since it might be too tight to try and have separate types of monsters in the same room together, I didn’t think it would be all that hard to have a tracking missile object in some of the rooms. Which it wasn’t really. It was a pretty easy add to the game and made a huge difference in how fun it is.

Since the beginning I wanted to have trap rooms, where all the doors will close once the player enters the room. This proved to be rather difficult. It’s kind of a long story but I was using the pfpixel command to turn the pixels on and off to open and close the doors. However, for all four doors, that required 24 pfpixel commands, which ate away far too many cycles. I could put a drawscreen command in between drawing the doors, but that made entering a room very ugly. So I went on a search online for a quicker way to draw pixels to the screen. I originally thought I could just change the bits in the variables for the Playfield but that proved to be futile. Then I found the pfhline (Playfield horizontal line) and pfvline (Playfield vertical line) commands. I’ve seen these before but didn’t think to even try them at first because I couldn’t see how drawing a horizontal or vertical line would be any quicker than just changing the pixels. I was wrong. It’s a lot faster and takes a lot less space. What took 24 lines only takes 8 lines now. 

So now I have trap rooms plus more space for something extra later in that bank. The trap rooms will close all doors when you enter a room if there are monsters in it. Once you kill the monsters and collect the treasure, then the doors will open again. Works very much like how Zelda’s dungeon rooms do it. That’s kinda what I was going for.

Adding the Tracking missile and the trap rooms made a pretty big difference in how interesting this game/dungeon feels.

Making an Atari game – Day 17

It's dangerous to go alone! Take this.
It’s dangerous to go alone! Take this.

I Added a sword on the ground in the first room that the player must pick up before he/she is able to attack anything

I Added two new item drops. A chicken leg that will restore health to 100% and a Mario like mushroom that will give the player an extra life

Ugly brown beast
Ugly brown beast

I Added more monster types (graphics). Two scorpions (red and blue), two “beasts” (brown and purple), two more “mummies” (now there is blue, green, and black). This has filled that bank full. I may change some of these monsters later, I don’t really like the beast graphics. Might turn them into bats. I would also like to add a dragon that actually chases the player if there is enough space later. Was thinking about using bank 2 (which holds the sound effects and title screens) for more monster graphics if there is any space in there left over.

Right now I need to work on monster speeds. Whenever I increase the speed of the monster movement (for deeper levels in the dungeon) they will sometimes overlap a wall by a couple pixels. They don’t get stuck or anything, it just looks kind of ugly to me. I need to adjust the collision detection to match the movement speed. Which is a bit confusing with fixed point integers. But that’s where I’m going to try to throw most of my effort at next.

I have so many plans for feature I want to add, like all Atari programmers, but am struggling for free space and variables at every turn. I am really hoping there will be enough room for multiple (with palette switching) end bosses or at least one. I would also like to add a random treasure room. But have a feeling that will be a little much. I think I am going to have to make a list of priorities of features and start working my way down because I know a lot of them will not make the cut. The most important on that list will be a princess to save. So once I figure out the monster speed/collision problem, I should really make sure to add a princess at the bottom floor to win the game.

Making an Atari game – Day 16

I added a rudimentary sound driver after reading the Random Terrain information on it. Not too bad, it works so far. Just need to check it on the real system to make sure everything still runs smoothly.

I went around the code a bit and polished things up some. Made the score gradually scroll up when you get points rather than just showing the new score instantly. Just more fun to display it that way.

Starting room
Starting room

In the entire game, I was using a total of 5 sprites and using the rest as extra variables. I wanted to free up some variables so I decided to eliminate the 5th sprite, and have it interchangeable with sprite 4 instead. Sprite 4 was always just the dungeon/floor entrance sprite (kind of a cross in a circle, shown above). Sprite 5 was always a ladder to go down a floor. Since they were both never being used at the same time anyway, now I just switch sprite 4 back and forth between the entrance and exit when needed. This gives me four more extra variables that I can use for whatever: player5x, player5y, NUSIZ5, player5height.

I think I already have a plan for 3 of them. I think I am going to use them as item drop labels. So when you clear a room, instead of just coins appearing for each monster killed, sometimes more items will be dropped, like something for increasing health, stronger sword, or an extra life. 

Making an Atari game – Day 15

The monsters can now shoot. This wasn’t too difficult to implement either. They use the “ball” sprite in the Atari for the bullets. Only one can appear on the screen at any given time (unless I allow flicker), so only one monster can shoot at a time. However one thing I may have to account for later is that sometimes when the player enters a room, if the monster happens to appear kind of in front of the player and looking in his direction, he will shoot at him instantly. This would feel very unfair in the game. So to counter this I think I may add a clock variable later to the game which keeps ticking every frame kind of behind the scenes. Then when you enter a room, all the monsters will check the clock and if 2 or 3 seconds have gone by since the player first entered the room then (and only until then) they are allowed to fire at the player. 

Collecting animating coins
Collecting animating coins

I have added coins in the dungeon to collect. Once you clear a room of monsters, coins will be randomly placed for the player to collect. What I originally planned was once you killed all the monsters, the coins would appear in the middle of the room. Not moving or anything, just sitting there. But something kind of unexpected happened. Because I am basically using the monster sprites and turning them into coins, I forgot to turn the monster movement off. So when I tested the code out and killed all the monsters in the room, all the coins randomly appeared but also started moving randomly around the room. They were using the Monster’s walking code and I kind of liked it. It made it a bit more fun to chase after the coins that were sliding around. So I kept that “bug”. To make it a tad bit more interesting, I may also have them disappear after a given amount of seconds when I add that clock variable. This way the player kind of has to be quick in collecting the coins. I am running dangerously low on variables at this point. Im probably going to have to look for ways of reusing some in “smart” ways in order to finish this project.

Another bug found that I decided to remove was, since the coins behaved like monsters, they also shot at the player. This was obviously ridiculous and easy to fix but funny to find.

At this point Im starting to get excited about sound effects. So far this game has been very very silent. But collecting the coins kind of triggered my brain to the need of high pitched sound effect. I want it to sound fun to collect the coins like the sound in a Mario game. So I looked up the sound effect for coin collecting in Mario on YouTube and then I opened up an Atari sound emulator in my browser and played around with it until I found something similar to see if it can be done. It’s close enough to my liking. Still Not in the game yet, but just wanted to make sure that kind of sound was possible on this system.

I’m a little worried about the sound code. With the Atari I basically have to code my own sound driver. This is something I know nothing about, I’m not sure how many variables it will take and I’m down to my last few. I’m really hoping it won’t be too difficult. I only have one bank left that is virtually unused, which I kind of always planned to use for the sound driver and title screen/menu and ending/winning screen. That “should” be enough space for all of that. Just hoping that when I call another bank for the sound effects it doesn’t go over my 262 cycle count.