+Living Room Arcade Posted June 17 Share Posted June 17 Night Driver Arcade for Atari 2600 in bB This project will be to try to make an arcade version of Night Driver for the Atari 2600 in Batari Basic. Special thanks to @alfredtdk Mr. Alfred for kindly allowing me to use his test file to get me started on this! Spoiler NDA_0001.bas NDA_0001.bas.bin 4 Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 19 Author Share Posted June 19 Goal: Try to make a home version for Atari 2600 as close to the arcade version as possible Arcade Version Screenshots and Video Spoiler Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 19 Author Share Posted June 19 Paddle or Joystick? Spoiler Night Driver arcade version (Atari, 1976) Paddle The road markers are all the same height - you lose the 3D perspective Joystick + pfheights The road markers vanish into the distance - strong 3D perspective According to RT's Guide, you cannot have paddle controls and pfheights at the same time. (kernel options chart) I was really hoping to use paddles, but for this project I'll probably go with the joystick just because IMO it looks so much better. 0001_paddles.bas 0001_paddles.bas.bin 0001_joystick.bas0001_joystick.bas.bin 1 Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 19 Author Share Posted June 19 Joystick Controls Spoiler The arcade version of Night Driver had a steering wheel, a gas pedal and an up/down gear shifter with four gears. Spoiler Proposed Joystick Controls for Atari 2600 Night Driver Arcade JN = joystick neutral, JL = joystick left, JR = joystick right, JU = joystick up, JD = joystick down BU = button up, BD = button down On Game Reset, start in gear 1 at 0 mph BU and JN first, then JU-and-release = shift up one gear BU and JN first, then JD-and-release = shift down one gear BU and JN first, then... JU = gas and add BD for more gas JD = brake and add BD for more brake JL = turn left and add BD to turn left harder JR = turn right and add BD to turn right harder Kernel Spoiler Actually, if we're not using the paddle, then we can choose any kernel. I'll probably choose the 8k Super Chip for more RAM and more options. Quote Link to comment Share on other sites More sharing options...
ComputerSpaceFan Posted June 19 Share Posted June 19 Awesome stuff! Good luck! I've been waiting for fourteen years for someone to try. 1 Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 20 Author Share Posted June 20 On 9/15/2010 at 8:35 PM, ComputerSpaceFan said: I really like the original coin-op version of Night Driver and I always felt the 2600 cartridge was a bit disappointing. No offence to Rob Fullop, he did a heck of a lot with what the 2600 had to offer, but any similarity between the coin-op version and the cartridge version is pretty distant. Two questions: 1) Would the 2600 be capable of displaying the white road markers as smoothly as the coin-op machine did? I mean, that arcade unit didn't show much in the way of graphics but what it did show was silky smooth for frame rate and such. 2) Would it be possible to make the game work with paddles in the Player 1 slot for steering and a joystick in Player 2 slot for switching gears? Failing that, Enduro and Pole Position aren't playable with paddles are they? Or is there a hack out there to make them work with paddles? Well, as a Batari Basic newbie, I'm not qualified to answer these questions. I can only talk about my project. Spoiler 1) In my project here, so far, I'm still looking into that, but that is certainly what I would want if I could do it! 2) That's an interesting idea using a paddle for steering and a joystick for shifting. I'll keep it in mind! @ComputerSpaceFan Thank you for your comment. And thanks for the encouragement and good luck! Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 20 Author Share Posted June 20 Let's Try the Paddle Again Spoiler @ComputerSpaceFan's comment about getting the white road markers to move smoothly got me thinking. New Proposal Use the basic kernel with no options (so as to retain use of Missile0 and Missile1) Now you have the ball, 2 missiles and P1 sprites to use to draw white road markers. Now you don't need a playfield. Just a black background. Now that you are using the basic kernel again, we can use paddle controllers again The white road markers, being sprites, can now be moved smoothly. Sprite Management Situation A: The Road Is Straight Then you will have 4 pairs of white road markers + 1 on the horizon. Your car sprite P0 (your car) will be used to draw the white road marker on the horizon using flicker. The four white road markers on one side of the road with be drawn using missile0, missile1, the ball and P1 sprites. On alternate frames, missile0, missile1, the ball and P1 sprites will be used to draw the white road markers on the opposite side of the road using flicker. Thus, all nine white road markers (and your car) will all be drawn every other frame using flicker. Situation B: The Road Is Curved When the road curves enough so that either one of the two white road markers at the bottom disappear off the side of the screen, then The white road marker on the horizon is moved to the bottom row. It is still drawn using P0 (your car) using flicker. The other four white road markers on one side of the road will again be drawn by missile0, missile1, the ball and P1. Again, on alternating frames, missile0, missile1, the ball and P1 will be used to draw the white road markers on the opposite side of the road using flicker. Thus, again, all nine white road markers (and your car) will all be drawn every other frame using flicker. Summary Thus, whether the road is straight or curved, there will always be nine white road markers. One is always drawn with flicker using your car's P0 sprite. The other 8 are always drawn, using flicker, using the 2 missiles, ball and P1 sprites. Thus, every white road marker is always drawn every other frame and your car is always drawn every other frame. Controls Spoiler Simple paddle control like in Atari 2600 Night Driver. The possibility of using Player 2's joystick for shifting. Quote Link to comment Share on other sites More sharing options...
glurk Posted June 20 Share Posted June 20 (edited) I'm an ASM guy, but if I were doing this game, the static yellow block of a car would be drawn with PF using the mirroring feature, and you would have both players, both missiles, and the ball free.... You could do really nice overlapping markers and get VERY close to the original. Edited June 20 by glurk Misspelling 1 Quote Link to comment Share on other sites More sharing options...
LatchKeyKid Posted June 20 Share Posted June 20 Which kernel are you planning on using with bB? Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 21 Author Share Posted June 21 @glurk I think I understood what you said. That is a good suggestion, I think. Thanks! Except, what did you mean by "overlapping markers?" @LatchKeyKid Well, I'm might try to use the paddles, so, maybe the standard kernel. Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 21 Author Share Posted June 21 Sprite/Flicker Management - Rotations Spoiler As I think about it some more, a better way to manage sprites/flicker might be to set up a rotation for drawing the sprites. Generally, I think it would work like this. Make a list of all the objects that you want to draw on the screen. Next, make a list of all the sprites available to use to draw them. Finally, assign the objects to be drawn to the available sprites in a rotation, calling drawscreen after each rotation. Example. Suppose there are 10 white road markers to be drawn on the screen. Further, we have 3.5 sprites available with which to draw them. They are missile1, the ball, the P1 sprite every frame and the P0 sprite every other frame. So, our rotations might look like this: Frame 1: missile1 - draw white road marker 1 the ball - draw white road marker 2 P1 - draw white road marker 3. drawscreen Frame2: missile1 - draw white road marker 4 the ball - draw white road marker 5 P1 - draw white road marker 6 P0 - draw white road marker 7 drawscreen Frame 3: missile1 - draw white road marker 8 the ball - draw white road marker 9 P1 - draw white road marker 10 Call the subroutine to update the list of 10 items to be drawn. drawscreen Note: The P0 sprite is available every other frame to draw white road markers. On the alternate frames it is used to draw the player's car. Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 21 Author Share Posted June 21 Night Driver Arcade - Paddle & Flicker Version Spoiler The Concept: The white road markers are made from the missile1 and the ball sprites and will be drawn in a rotation using flicker. There will be two digital displays at the top of the screen. Current speed in mph in the top left corner and time remaining in seconds in the top right corner. They, along with the player's car, will be drawn using the P0 and P1 sprites in a rotation using flicker. The total distance traveled (AKA your score) in miles will be displayed using the bB 6-digit score area at the bottom of the screen. Parallel Processes In the Main Loop, there will be parallel processes going on separately, at the same time, but not in sync with each other. (They each can begin and end separately.) PP #1: White Road Markers Do some calculations. Make a list of all of the white road markers to be drawn on the screen w/ x-y coordinates for each. Next, assign missile1 and the ball to the items in the list in a rotation until all of the items have been drawn over the course of a few frames. Make an updated list and repeat. PP #2: Speed, Time Remaining and Your Car Do some calculations. Find the player's current speed in mph and the time remaining in seconds. Speed can be 1, 2 or 3 digits. Time remaining can be 1 or 2 digits (99 seconds max). Make a list of all of the objects that need to be drawn. Ex. In the picture, above, speed is 126 mph, time remaining is 99 seconds. Therefore, the 6 objects on the list would be: 1, 2, 6, 9, 9 and the players orange car. Next, assign P0 and P1 to the objects on the list in a rotation until all of the items have been drawn over the course of a few frames. Update the calculations and make a new list. Repeat. PP #3: Total Distance Travelled Calculate the player's total distance travelled and update its value in the 6-digit display. Repeat. Rates of Flicker White Road Markers: If 6 white road markers need to be drawn, we have 2 things with which to draw them (missile1 and the ball). Then the ratio is 3:1. If the game is running at 60 frames per second, then the white road markers would be flickering at 20 fps. Digital Score Display and Your Car: Max 6 objects to be drawn and 2 things with which to draw them (P0 and P1 sprites). The ratio is 3:1 and the flicker rate would be 20 fps. Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 21 Author Share Posted June 21 "Falling" White Road Markers - A Kaboom! Analogy Spoiler During game play, pairs of white road markers are continuously "falling down" until they "fall off" the bottom of the screen. The road "turns" when the point of origin of the pairs of white road markers on the horizon shifts left or right. Think of the game Kaboom! The Mad Bomber is always dropping bombs. The bombs fall straight down from the locations where the Mad Bomber dropped them. When the Mad Bomber is stationary, the bombs form a straight line. This is like a straight section in the road in Night Driver. The Mad Bomber is stationary. This is like a straight road. But when the Mad Bomber is moving left or right, the bombs can form a curve. Actually, nothing is "curved." The path of each bomb is always straight down. It's kind of an illusion that there is a "curve." Anyway, this is like a bend in the road in Night Driver. The Mad Bomber moves right. This is like a road turning right. The Mad Bomber moves left. This is like a road turning left. I used Darell Spice, Jr.'s Kaboom Deluxe to control the Mad Bomber to make these screenshots. Quote Link to comment Share on other sites More sharing options...
glurk Posted June 21 Share Posted June 21 (edited) 9 hours ago, Living Room Arcade said: @glurk I think I understood what you said. That is a good suggestion, I think. Thanks! Except, what did you mean by "overlapping markers?" The most distant road markers overlap each other vertically during turns as part of the 3D depth effect. You can see this in videos of the original game. I was thinking in terms of a purpose-built assembly code kernel, which is how I would do the game. This idea is probably not possible in Batari. For the car, it just seems WASTEFUL to use 2 sprites to draw it. Since it is static and unmoving, and you were using wide pixels, might as well draw it with PF and take advantage of the automatic mirroring. This one is just a no-brainer to me. But I am aware that Batari has certain limitations that must be accomodated... I only do ASM coding.... EDIT TO ADD: I think a very fine version of this game could be don in assembly, too. But I am not volunteering, LOL. I had never really thought about it until I saw these recent threads..... Edited June 21 by glurk 1 Quote Link to comment Share on other sites More sharing options...
ComputerSpaceFan Posted June 21 Share Posted June 21 Can't wait to see how you do with this project! 1 Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 21 Author Share Posted June 21 @glurk Thanks for the clarification about the overlapping markers. About using the PF to draw the car. Here are two issues. One, the PF is only 11x32. Those are some big pixels! Two, the ball will be the same color as the PF. So, if the car is yellow, we will end up with some yellow road markers that were drawn using the ball. @ComputerSpaceFan Me too! Thanks for the encouraging words! Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 22 Author Share Posted June 22 White Road Markers - Flicker Tests Spoiler We lose missile0 when we choose the paddle kernel options. Using missile1 and the ball, we test the flicker with 6 and 8 white road markers. 6 stationary white road markers - flicker test 0002_paddles_6_stationary.bas 0002_paddles_6_stationary.bas.bin 8 stationary white road markers - flicker test 0002_paddles_8_stationary.bas 0002_paddles_8_stationary.bas.bin With phosphor turned on (hit Alt+p in Stella), it looks better. So far, it seems that a 1:3 ratio of sprites to objects results in acceptable flicker. Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 22 Author Share Posted June 22 Design Update - Adjusting for the Loss of Missile0 Spoiler I now realize that in order to use the paddle controllers, we will lose missile0. Missile0 was going to be used to draw white road markers. So to compensate for its loss, we will get rid of some things that we had planned and use the sprites we will save to draw white road markers. Here is the list of the changes. Get rid of the digital display on top of the screen. That frees up the P1 sprite, which was going to be used to draw the 3 digit MAX SPEED readout in the upper left corner. Instead, P1 will draw white road markers. The P0 sprite, which draws your car, can be free 50% of the time to also help draw road markers. Previously, the P0 sprite was going to draw the 2 digit TIME REMAINING digital display in the upper right corner using flicker. The result is that now we will have 3.5 sprites available to draw white road markers. missile1 the ball the P1 sprite and 50% of the time, the P0 sprite (the other 50% of the time, it will be used to draw your car) From early tests, it seems that a 1:3 ratio of sprites to objects results in acceptable flicker. Therefore, with 3.5 sprites, we can plan on having 5 pairs of white road markers. The 3 digit total distance travelled (AKA your score) will be displayed using the 3 left-most digits of the 6 digit display. The 2 digit time remaining in seconds will be displayed in the 2 right-most digits of the 6 digit display. A blank space will be created in the 4th digit to separate the two numbers. Advantages of This Design The game will still be played using the paddle controllers. I think people will appreciate that. We keep the beautiful-looking yellow car drawn by the P0 sprite. Five pairs of white road markers: I think that's not a bad number. The road should be looking pretty good, I think. Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 22 Author Share Posted June 22 White Road Markers - Calculations Spoiler Using the Center Point in the Road as the Reference for Calculations We use the Mad Bomber analogy again. Pretend that the Mad Bomber is dropping white road markers from Night Driver. As the road markers fall, they become larger and spread farther apart. XM (x "middle") is the point in the center of the road. The width of the road is equal to 2xDELTA. If we know XM and we know DELTA, then we know the x-coordinates of the two white road markers on either side. Approximating a Quadratic Equation with Linear Equations Given: XM and a particular y value Find: the x-coordinates of the left and right white road markers Normally, a curved line such as the one, below, would be described by a quadratic equation (x = Ay^2 + By + C). However, I have a feeling that such mathematical calculations would probably be too demanding of the 6502 processor and not be worth their high cost in processor cycles. An alternate kind of computation that might use fewer processor cycles would be this. Instead of using one quadratic equation to describe the whole curve, we can break up the curve into, say, three or four regions and approximate each region with a straight line (x = ym + B). Then, for a given value of y, first, we can use a series of If...Then statements to determine the region. Once we know the region, we plug y into that region's linear equation to find DELTA. Finally, we can use DELTA to find the x-coordinates of the left and right white road markers of that particular pair. Repeat the above calculations for all of the other pairs and you will have the (x,y) coordinates of all of the white road markers. Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 22 Author Share Posted June 22 Collision Detection Spoiler Given: The x-coordinates of the left and right white road markers at the moment when they "fell off" the bottom of the screen. Given: The value of the paddle at that same moment. Find: Did either white road marker touch the player's car? We can use If...Then statements. In words: If the x-coordinate of the left road marker is equal to or greater than the x-coordinate of the left edge of the player's car plus the paddle then there was a collision on the left side of the road. If the x-coordinate of the right road marker is equal to or less than the x-coordinate of the right edge of the player's car plus the paddle then there was a collision on the right side of the road. Quote Link to comment Share on other sites More sharing options...
Out_of_Gas Posted June 23 Share Posted June 23 (edited) Classic Label Edited June 23 by Out_of_Gas 2 Quote Link to comment Share on other sites More sharing options...
Out_of_Gas Posted June 23 Share Posted June 23 Silver Label 2 Quote Link to comment Share on other sites More sharing options...
Out_of_Gas Posted June 23 Share Posted June 23 I prefer the joystick version as it looks more 3-D 1 Quote Link to comment Share on other sites More sharing options...
+Living Room Arcade Posted June 23 Author Share Posted June 23 @Out_of_Gas I'm honored! It's beautiful! I'll do my best. But, uh, could you please make artwork that says paddle controllers? That's what it is at the moment. 1 Quote Link to comment Share on other sites More sharing options...
Out_of_Gas Posted June 23 Share Posted June 23 3 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.