Happy Hour was my first attempt at writing an NES game back in the spring of 2014, March to be more precise. I wrote this as I worked through the Nerdy Nights and MRN's tutorials. As I learned more, the more features I added to the game. I worked on this pretty steadily up until about June when life got super busy. In November, I tried to return to it and start a new project, a Power Pad game some of you may remember, but by December 2014, I realized that life was just too busy and ultimately in February of 2015, I ended life on Happy Hour. I did this for a few reasons.
1. The game play is fun for about 20 seconds, then it gets old.
2. I had come to realize that this was a great starter project, but it wouldn't be anymore than a learning platform.
3. Other opportunities in the Homebrew Community
With that said, you can follow the progess of the game below to its death (Start at the bottom for day 1), if you care to read that much. If not, then just grab the beta ROM and give it a go! I have also posted The Instructions below. One day, I may decide to post the programming as well, I'm just not ready, yet. I have no issues sharing parts of the code with anyone that asks if you want to know how I programmed a particular part.
Thanks to all the helped me with this code. I can't even remember everyone that had input, but you know who you are. Without you guys, I would not have made it this far!
D-Pad - Change Beer Flavor
Start - Pause\Unpause or Start Game or Start Level
A - Hold to Fill Mug\Release to Stop Fill
B - Serve Order After Filling Mug
Fill the beer order requested by the Patron. Levels increase in difficulty by cutting time and requiring more beer to be served. Fill speeds will change each level.
To advance the level, you must fill the equivalent of the following:
Levels 1-3: 10 beers in 60 seconds.
Levels 4-6: 11 beers in 55 seconds.
Levels 7-8: 12 beers in 50 seconds.
Levels 9+: 13 beers in 45 seconds. (I think around 9-10, it becomes impossible).
The number of beers depends on how well you fill the order based on what fill level the mug is at:
Mug Level 1: 1/5 of a beer
Mug Level 2: 2/5 of a beer
Mug Level 3: 3/5 of a beer
Mug Level 4: 4/5 of a beer
Mug Level 5: 1 Beer!
Mug Level 6: 0 Beers
So to quickly advance to the next level, it is in your best interest to fill the beer to the top! In the Beta Version, you are blind to this. Plan was to implement a meter to indicate how close you are to advance to the next level. Never made it that far...
Scoring is based on how well you fill the order. You earn "Tips" for better fills. 2x bonus starts with 3 successfull fills in a row. You cannot fill a mug if you are on the wrong beer. If you try and you have a bonus, your bonus is lost. Fail to fill the mug to the top, lose your bonus.
Mug Level 1: $0.20
Mug Level 2: $0.40
Mug Level 3: $0.60
Mug Level 4: $0.80
Mug Level 5: $1.00 ($2.00 with Bonus)
Mug Level 6: $0.00 (overfilled mug)
Game ends when you cannot pass a level.
6/2/14 - NEW ROM UPLOADED! New Title Screen with animation!
So, it's been nearly a month since my last update, but it is a cool one! Thanks to some help, my code it running great and the bug I had is gone! You will find a nice flashing title on the title screen with this version! I failed to add any sort of meter or number to indicate how close you are to a level up. I also failed in tweaking the level difficulties. Life has become very busy as of late and I have been checking NA on my phone quite a bit, so my time for coding has suffered.
Another feature you may or may not notice is that you now score bonus points for time left in the level. As of right now, it just adds the lump sum to the score immediately after the level is complete. I would like to animate it like Super Mario Bros. You should get 10 points per second left in the level. Maybe the next update will have the animated feature.
That's about it for this level. The bug (thanks to thefox for the fix) set me back a bit as well as the making graphics. Enjoy the ROM!
Some features I would like to add:
-A screen that shows the point totals for each mug level, think how the Pac-Man arcade does this with the ghosts. I want to make a screen that mimics that.
-Implement some sort of count down or meter that shows you how close you are to a level up.
-Work with the level difficulites and try to fing a nice place on the screen to show what level you are on during game play.
-Music and sound effects. I haven't looked at how to do this yet. I am scared!
-Come up with more ideas to make this a better over all game instead of the same level over and over with more difficulty. You know, some polish!
5/9/14 - NEW ROM UPLOADED! Now with graphic to show when you are in a x2 bonus and you score 10 points per second left in the level
I figured I better upload a new rom since it has been awhile since my last upload. Sorry for the delay, bad week for coding. Both new features were very easy to implement, but life gets in the way. 11 month old daughter is suffering from cutting teeth and hives, so nights have not been very kid to me and I have been sleepy.
Anyways, you will notice a 'x2' graphic next to the score when you are in bonus mode. Very handy to let you know when you screwed up. Also, when the level is complete, you will notice your score will increase 10 points per second you have left and the score clock will go to 0. Right now, that is not animated, but have contemplated actually animating it. I haven't tested this very much, so if you notice a bug (score is not correctly applied or the wrong points), please post here and let me know.
I didn't have time to implement a "Drunk Meter". That is the goal for the next ROM release. After this, I will be very close to being complete with the gameplay portion of the game. I will then start to work on better game over and title screens and maybe some extra screens. I am thinking of a screen that interrupts the title screen and shows what points are scored per mug stage. Maybe animate it like the Pac-Man Arcade screen when they show the points of the ghosts.
Goals for next update:
1. Add a Drunk Meter.
2.Tweak Level Difficulty variables and complete the 13 and beyond variables.
3. Work on some graphics for the Title and Home Screens.
4. Clean up code and maybe some other graphics.
Thanks for following the thread, I hope you are enjoying it!
5/5/14 - NEW ROM UPLOADED! Includes Bonus Points & New Scoring Code!
So, this was a slow going update being busy with life and writing a new way to add my score, but here it is! I didn't tweak any of the level difficulties, but I did add a double bonus if you get a streak of 3 or more correct! The streak is broken in 3 ways:
1. Try to send an Empty Mug.
2. Send any mug that is not filled 100%.
3. Try to fill a mug with the wrong beer order. Ex: order was ale and you tried to fill it with lager.
NOTE: The bonus carries over to the next level!
The new scoring is pretty cool and it actually exposed my code for how poorly it was written. The score code worked first try, but created a bunch bugs. I just finished fixing those tonight! Thanks again to MRN for helping me with bugs and talking me into the new scoring code.
Goals for next ROM release:
1. Show 'X2' on the screen when you are scoring double bonus.
2. Add points to the score for time left in the level (thinking 10 cents per second)
3. If I have time, add a "Drunk Meter" so you know how close you are to the next level up.
Enjoy the ROM until next time!
4/30/14 - NEW ROM UPLOADED! Level Increases Difficulty, Mug Slides!, and you are forced to change beer flavors starting in level 4.
What a crazy last few days. I accomplished more goals that I thought possible! Thanks to Mario's Right Nut, I fixed a very simple bug that broke my code that I was stuck at for a couple of days. This playable ROM is nearly a full game without all of the bells and whistles! I have a lot of tweaking to do as the game is pretty simple for levels 1-6, a bit harder at levels 7-9 and then I think impossible at level 10. I was nearly perfect on level 10 and I still didn't have enough time.
You will find a very noticable bug in this ROM, but it won't hurt game play. You will play the game once just fine, but if you hit start at the Game Over screen and then start a second game, there will be a slight 3-5 second delay before the game starts. Your time will be ticking down, but you don't have a beer order and you can't press A. My guess is that I have a flag running wild that didn't reset from the previous game and its waiting to roll back over to the trigger number. I would troubleshoot it tonight and fix it, but I'm tired, so you get a buggy game. Also, if you can make it that far (somehow), the game caps at level 12. Levels 13 and beyond are just level 12 over and over.
My goals for the next ROM release are fix buggy code, tweak the level difiiculties, and try to implement a bonus if you get 3 perfects in a row! Should be a fun challenge. If I complete these 3 tasks, I pretty much have all my game mechanics down. I may try to play with some other ideas I have, but I don't know. My code is already ridiculously long and very tough to follow and trouble shoot.
Have FUN! And please, if you have any comments or critisism, let me know. You guys are pretty much my unofficial ALPHA testers!
4/24/14 - NEW ROM UPLOADED! Now with levels for every $10.00 AND a new game play layout.
HUGE progress made. I now provide you with infinite levels! I also changed the look of the game play layout to allow for future mug sliding animations!
So, now you can play an actual game. You can advance levels when the counter I implemented hits 50 (1 point per $0.20). Eventually, I when to depict this 50 as a Drunk Meter. The more you fill the mug, the more the drunk meter fills up. Basically, if you get 10 perfect fills, you pass the level. I upped your time to :30 to make this really easy to do. I do not have a limit on levels, yet (if ever). Either I will cap it or eventually just make gameplay impossible once you hit later levels.
Also impelented, you have to unlock beer flavors by advancing levels. Levels 1-3, you can only pour lager. Go ahead, use the D-Pad, you can't change the color! Level 4 unlocks Ale, Level 7 unlocks Wheat, and level 10 unlocks stout. Pretty damn cool!!
Other than that, I fixed some bugs. The most confusing was a point increment bug I had where I was getting fantom points. That should now be fixed.
Next up, I want to implement the orders being yelled out (LAGER, ALE, WHEAT, STOUT) and force the player to have to change to that color. This should be a pretty cool challenge! After that, I will work on mug sliding graphics, and finally, I think I will be able to add variables to increase game play difficulty as the levels advance!
Until next time, enjoy the new ROM!
4/22/14 - NEW ROM UPLOADED! Complete with Title and Game Over Screens!
I have learned a BOAT LOAD over the last couple of days. Wow, my mind is in complete overload and I'm so excited to have as much done as I do. When I went to bed last night, my code was junk, nothing would load or work, and I was completely lost. Now, I have a fully functional game where you always lose in 20 seconds!
3 of the 4 bugs below are gone! Only bug #4 remains, but I really don't care about him at this point and I don't know if I will ever solve him or not.
Ok, so what was accomplished. I completely rewote my Game State Upate process from Nerdy Nights, to Mario's Right Nut's #2 tutorial. After doing this, my code was broke and I had no clue what most of it was doing. After many hours of pounding through it, I finally have a grasp on it. I have also learned much more about the NMI and the Forever Loop. I think I have everything correct, but I may not. All I know is that my code is functioning the way I think it should by looking at my code.
I also learned a lot about pointers. The LOW# and HIGH# codes had me completely lost (see here for details
). But thanks to the many fine folks at NA, I have a great understanding of it and rewrote my background code to take advantage of it. My first attempt at pointers was to find an efficient way to write text to the background, such as Pause and other future ideas. I wanted to recycle the code I was already using instead of wasting space writing the same process each time I wanted to write something on the sceen.
My next goal is to work on a delay when the game starts so it doesn't just start running. I'm not sure what I am going to do for that yet. Either Press A to start filling which would start the timer or have a "Ready!, Set!, Fill! and then start the timer. After this, I think I may work on redrawing the Game Playing background. I'm not really happy with it and I really think adding a Patron for ordering drinks would be cool (complete with sliding beer mug). After that, I think I am going to jump into working on a random generator that will have the Patron bark out beer orders. Then I will probably have to work on beer sliding and then adjusting the scoring for that. WHEW! I have a lot left still!
Until then, enjoy the 20 second ROM and marvel in the wonderful art of the Title and Background Screens!
Just a quick update on progress. I have been working on getting the gamestates to transition nicely. In doing so, I had a TON of code rewrite to do and learn a TON! For the most part, it is working, however, I have created a few bugs to workout. I have 4 gamestates, Title, Playing, Pause, Game Over. I can transistion to each state just fine with the start button. However, I don't think I am doing it correctly because I get a "flicker" between screens. What I mean by this is for about a frame of time, I see all of the graphics in the wrong position during transition. Basically my go is nothing special.
If Start Pressed
Load New Background
Enable PPU (with or without sprites)
DO OTHER STUFF (reset variables, etc)
Bug #2: When I include my code in the DO OTHER STUFF that changes my color palette back to default (I change beer color by changing the color at the Palette during NMI), between the Game Over and Title sceens, my title screen fails to load and I get all Zero's. I have a feeling the NMI ChangeColor Subroutine is messing with the background loading. Maybe it is taking to long? I could avoid the issue by using the other 3 sprite color sets but I am now just avoiding the issue instead of learning how to fix the issue.
Bug #3: When my Title Screen loads at the game start, it looks fine (well, actually it looks pretty boring right now because I haven't done anything to it), however, when I go from the Game Over Screen (Sprites Disabled) to the Title Screen (Sprites Enabled) my Playing Game sprites (mug and handle) are on the screen. I could just avoid the issue and disable sprites on the title screen, but that sucks. Outside of setting all of the sprites off the screen, is there a way to just clear out PPU Register $0200 and up when I load new screens? It has to be pretty easy.
Bug #4: I sort of broke Pause when I setup the Game Over and Title gamestates. If works great unless the A button is being pressed to fill the mug. It used to work, now it's broke.
That is all for now. I think the next ROM I post will be a fully functional Title and Game Over Screen.
4/19/14 - Updated playable Demo ROM - With working time and Game Over Screen!
Lots of work was done. I think I have fixed all of the contoller bugs. Mulitple buttons pressed don't mess up the fill. Pause and Game Over are also working! However, when you press start at the Game Over screen, it only does a full game reset instead of a game state switch. I am currently working on getting gamestates setup with separate backgrounds for each game state. This is going to take a lot of code rewrite and be a huge learning curve for me. Once this step is completed, there will be a functional Title Screen, Main Playing Sceen, and a Game Over screen that will display your score. When you push start from the Game Over screen, you will go back to the title screen. Once this step is complete, I can then start working levels and advancing to the next level. I come so far and learned so much, but I still have a ton left to do! Enjoy the playable ROM!
4/16/14 - NEW ROM ATTACHED WITH WORKING SCORE!!! (Sort of working)
The score is now mostly working. When you press be to reset the mug to empty, the score is than calculated based on fill stage of the mug. I simply created a loop around my IncrementScore subroutine and decrmented the counter that kept track of the Mug Fill Stage. 20 points is scored for each time the IncrementScore Subroutine loops. Here is the code for when the B Button is pressed. The Upated Score is then Drawn to the screen during the NMI Routine.
LDA buttons1 ; player 1 - B
LDA #$00 ;Reset Mug to Empty
CMP #$06 ;Check if Mug is Overfilled, if yes, then 0 points scored
LDA MugCheckCounter2 ;Check if Mug is Empty, if yes, then 0 points scored
JSR IncrementScore ;Jump to the IncrementScore routine and add the score
STA MugCheckCounter2 ;Decrement the Mug Fill Stage until 0, then jump out of the loop
STA MugCheckNotFillingFlag ;Reset the Flag to show sprites not filling
STA MugCheckNotFillingFlag2 ;Reset the Flag to enable A Button
This created an interesting bug that if A and B are pressed simultaneously, then the score goes crazy (increments 20 each frame), the mug stops filling, the handle stays tapped and the beer sprite stays on the screen. My next 2 goals are to figure out to avoid this bug and start working on the time
4/15/14 Update 2 - Updated ROM attached!
Cleaned up some of the code and fixed a bug. The bug fixed would keep the beer filling sprite on the screen after the mug would overfill. It just looks silly, so I got it to go away when the overfill mug loads on the screen.
Enjoy the ROM and comment your thoughts and ideas, good or bad.
4/15/14 - Demo ROM attached to this post for your enjoyment.
PROGRESS! PROGRESS PROGRESS!
I am really getting to know my code and getting much more comfortable with NES 6502. Great progress has been made the last couple of days with working on slowing down the animation. I was able to utilize my existing BNE opcodes and added a second variable to keep track of the stage the filling of the mug is at to control the speed of the animation. Much more simple than I thought it would be.
I should now be able to create a variable or two to increase the speed of the mug filling in different stages. Later stages can have faster filling mugs to make it much more difficult to get a perfect pour. After I work out a couple of small bugs, I hope to have the mug animation behind me and begin work on the score and time. Once I get the last couple of bugs worked out, I will attach a new ROM for you all to enjoy!
Small victories this weekend! I have a fully functional tap handle, the beer turns on and off with the tapping of the handle, and I have learned a fun way to change the colors of the beer with the D-Pad.
My first challenge was changing the beer colors. Initially, I was using all 4 attributes of the 16 color palette and just changing the attribute number. All 4 sets of colors were identical except the 2nd color. Instead, I decided to use just one attribute and change the color in the palette during the NMI. Thanks to KHAN's help, I got this working! This frees up the 3 other set of colors for other sprites if I need them. Fun note, if I ran this subroutine after the DrawScore subroutine, my background would screw up. So, I had to place it before DrawScore.
My second challenge was to get the handle to tap and start filling the beer while the A Button was pressed and then when to untap the handle and stop filling the beer when it when A was no longer being pressed. I figured this out by making a buttons1_old variable that would store the last known state of the controller when Button A is pressed (10000000). Then right before I checked the buttons the next frame, I added a subroutine that would be triggered if it saw the controller status was not equal (00000000) by comparing buttons1 to buttons1old. This routine would set the tap handle back to the starting position and shut off the beer flow.
That's it for new victories. My next set of challenges includes troubleshooting the color changing for the beer flow (still not quite right for that one sprite) and trying to get the mug sprite to "fill" (change sprites) while a is being pressed but switch to another set of sprites when A is let go. This will be the toughest part of the code here. Once the is done, the basic game function will be done and it will be on to other animations and adding the score.
Thanks to KHAN Games, I now have a better understanding of getting my sprites to load and do something on the screen. At this time, they are not 100% functional, but I can change the attributes, tap the handle (kind of), and change the mug once. Still have a long ways to go, but it is nice to finally see sprites changing.
Nothing new to report. Spoke with a few members here on some pointers and have decided that for this game, I am not going to use meta-sprites. I now need to go back and rewrite a bunch of code to get my sprites working again. I may try to work with meta-sprites in my next game. Once the sprite are coded, then it will be on to working with the animations!
4/4/14 Morning Update
So, meta-sprites are kicking my ass!! Between the pointers and loops, I get lost in the shuffle. I have probably started Mario Right Nut's tutorial at least 5 times and I get confused on the update constants section. Pointers have always been my weakness in any programming language, so I hope to bust the hump on this one. As of right now, no major update on the game, just more frustrations learning the code.
One last update for 4/1/14
Made great progress on the controller. I have setup Button A and Button B to increase the score. This also created my first bug in the IncrementScore section of my code. The maximum my score can show is 99980. I wanted to see what would happen if it went past that and it started incrementing the 10,000th's digit with the letters of the alphabet, which are located right after the numbers in my data. So, my score after 99980, looks like A0000. My goal is to make sure no one will score that high anyways, so it may not be an issue anyways.
4/1/14--------------Done with Nerdy Nights 9, onto some advanced tutorials by Mario's Right Nut-------------
I have made it through Nerdy Nights 9. I have a pretty basic program set up with no animation but I do have the score writing to the background, just 000.00 as of right now but a small victory. I still find myself going back to previous Nerdy Nights to look up some of the basics I have forgotten along the way.
I have started on Mario's Right Nut tutorials because I want to setup the A Button to increment the score to make sure my score is working properly. Trying to figure out this controller programming is frustrating. I had a good handle on it until I got into subroutines, not I am lost again. When I look at sample code, I can't really follow what is going on with everything else muddying up the waters. The controls are not as easy as I first thought they were going to be and have me second guessing some of the original mechanic ideas I have for this game.
That is all for now. Once I get a good grasp of the contoller, I think I will dive into meta-sprites.
3/31/14 ------------------------------Thread Started
Welcome to my Journey in writing my first NES game, Happy Hour. Don't expect updates to be very often as I am learning along side coding the game.
Here is a screenshot of the background .
Here are some sprites:
1 Player. I have thought of a 2 player battle if it seems easy enough to do.
Fill the mug and push it along to fill the next mug.
The mug will fill in 7 stages at a pretty quick pace while holding the A button.
Empty, Start filling, 1/3 Filled, 2/3 Filled, Full, Topped Off, and Overfilled.
When you release the A button, you will not be allowed to continue to fill the glass. You must press B to advance to the next mug and begin filling again. Each stage of filling will be worth a set amount of points, calculated in tips. In later stages, different styles of beer will be ordered and you must swtich the tap to fill the order correctly.
Empty = $ .00
Start filling = $ .20
1/3 Filled = $ .40
2/3 Filled = $ .60
Full = $ .80
Topped Off = $1.00
Overfilled = $ .50 (may decide to go lower)
Wrong Beer Type = $ .00
Each stage will be timed (time to be determined). You must fill as many mugs as possible in that time limit. To advance to the next stage, you must score a set amount of points based on the stage difficulty. As each stage advances, difficulty will increase by a decrease in time, an increase in points required to pass, and increasing the different types of beer to fill.
There are 4 beer types that can be ordered. The order with appear in a speech bubble. You will know what style you have currently selected by looking at the tap handle as it will change colors. In the early stages, there will only be 1 type and the 3 other buttons on the D-Pad will be disabled. As the levels increase, a new flavor will be added. The exact number of stages between adding beer styles is yet to be determined.
I have thrown around the idea of adding time back to the clock if you successfully Top Off a beer or implementing a bonus in tips for streaks such as 3 or 5 in a row will double your tips. I have no other ideas of factors to add and may look to you guys for help.
The last idea is tossing in a bonus stages between levels that add another style of beer. Ideas have been a beer filling contest against the computer or a drinking contest where you have to alternate A and B to out drink the computer.
That's all I have for ideas at the moment. I have been spending the last couple of days building sprites and background data.
Thoughts, ideas and criticism is all welcome.
Thanks and enjoy the ride!