Jump to content
IGNORED

One on One (Atari 2600 ASM) 1 or 2 players


easmith

Recommended Posts

( see later post for most recent, 1 player-option version)

 

https://atariage.com/forums/topic/288985-one-on-one-atari-2600-asm-1-or-2-players/?do=findComment&comment=4278820

 

After an obsessive week of manic programming, I have a playable prototype. Game is 2 player only and will likely remain so . A few bugs still to work out.

 

Thanks to NukeyShay who basically wrote the kernel.

 

Here are the current features :

 

-- game can be played to any score less than 100

-- 3 pointers ( have to work on getting the curved parts of 3 point line to register correctly.

--- fouls and steals . If you get three fouls , additional fouls result in points to the opponent.

-- shots vary in make probability based on region of court and point of release ( best to release at top of jump)

 

-- currently the players have the same abilities. I could alter the abilities ( I believe the Dr J vs Bird game had bird slower but better outside shooter??)

 

here is what is still in progress:

 

-- HORSE mini game

-- sound for missed shot

-- more rebound variation

 

-- shot blocks

 

-- refining 3 point line recognition

 

--- making it so that you have to take the ball back court or beyond 3 line before shooting ( although with 2 player game you can set these rules)

 

--- "winners outs " option

 

 

 

 

most recent .bin in lower post

 

Also posting KungFuCombat for anyone who has not tried it

  • Like 8
Link to comment
Share on other sites

Thanks. I think I have something close to this sound.

 

Made a few more improvements/bug fixes. There is a delay now after score or foul. Ball now falls through net after score.

 

I also think I have the 3 point detection pretty decent now near the curved part of the three point line. This was a bit of a challenge.

 

I need to take a break for a day or so or my marriage might dissolve:)

 

Also I have almost exhausted the 8K and have never gone beyond that . I think , other that shot blocks, it is a pretty playable basketball game. Of course I have no one to play with at home , so I would appreciate any feedback if someone can play against an opponent.

 

 

 

Edited by easmith
Link to comment
Share on other sites

You gotta start using index registers instead of having the accumulator do all the work. This is just an example of how all the program code between $16E0 and $18C8 can be trimmed to be a loop instead:

L16E0
    ldx     ram_A6                  ;3
    bne     L1709                   ;2³
L16E4
    inx                             ;2
    cpx     #$0F                    ;2
    beq     L1707                   ;2³
    lda     ram_BD                  ;3
    sec                             ;2
    sbc     Check1-1,x              ;4
    bcc     L16E4                   ;2³
    lda     ram_B7                  ;3
    sbc     Check2-1,x              ;4
    bcc     L16E4                   ;2³
    lda     ram_BB                  ;3
    sbc     Check3-1,x              ;4
    bcs     L16E4                   ;2³
    sec                             ;2
    lda     ram_B9                  ;3
    sbc     Check4-1,x              ;4
    bcs     L16E4                   ;2³
L1707
    stx     ram_8A                  ;3
L1709

Here's the data tables (should not be located across page breaks to avoid the 1-cycle penalties)

Check1
    .byte $46,$14,$5A,$02,$8C,$46,$14,$5A,$02,$8C,$3C,$14,$64,$02
Check2
    .byte $28,$28,$28,$28,$28,$0A,$0A,$0A,$0A,$0A,$00,$00,$00,$00
Check3
    .byte $5A,$46,$8C,$14,$A0,$5A,$46,$8C,$14,$A0,$64,$3C,$8C,$14
Check4
    .byte $4B,$4B,$4B,$4B,$4B,$28,$28,$28,$28,$28,$0A,$0A,$0A,$0A

391 bytes saved.

 

There is similar bloat among many of the routines

Edited by Nukey Shay
Link to comment
Share on other sites

You gotta start using index registers instead of having the accumulator do all the work. This is just an example of how all the program code between $16E0 and $18C8 can be trimmed to be a loop instead:

L16E0
    ldx     ram_A6                  ;3
    bne     L1709                   ;2³
L16E4
    inx                             ;2
    cpx     #$0F                    ;2
    beq     L1707                   ;2³
    lda     ram_BD                  ;3
    sec                             ;2
    sbc     Check1-1,x              ;4
    bcc     L16E4                   ;2³
    lda     ram_B7                  ;3
    sbc     Check2-1,x              ;4
    bcc     L16E4                   ;2³
    lda     ram_BB                  ;3
    sbc     Check3-1,x              ;4
    bcs     L16E4                   ;2³
    sec                             ;2
    lda     ram_B9                  ;3
    sbc     Check4-1,x              ;4
    bcs     L16E4                   ;2³
L1707
    stx     ram_8A                  ;3
L1709

Here's the data tables (should not be located across page breaks to avoid the 1-cycle penalties)

Check1
    .byte $46,$14,$5A,$02,$8C,$46,$14,$5A,$02,$8C,$3C,$14,$64,$02
Check2
    .byte $28,$28,$28,$28,$28,$0A,$0A,$0A,$0A,$0A,$00,$00,$00,$00
Check3
    .byte $5A,$46,$8C,$14,$A0,$5A,$46,$8C,$14,$A0,$64,$3C,$8C,$14
Check4
    .byte $4B,$4B,$4B,$4B,$4B,$28,$28,$28,$28,$28,$0A,$0A,$0A,$0A

391 bytes saved.

 

There is similar bloat among many of the routines

 

Thanks. Man, I'm afraid these advanced techniques are a bit above my level. You are dealing with a guy whose formal programming learning consists of 3 classes ( Pascal, C, and Motorola 68000 assembly) from the early 90s. I know nothing about advanced data structures. I am pretty happy to be able to get working games by "brute force." But I do see a few large routines where I duplicate it for Player 0 and for Player 1 which I should be able to reduce to a loop. This should free up a lot of space.

Link to comment
Share on other sites

Ok, Managed to free up enough space to add most of what I wanted, including additional game options such as Winner's Outs, option for not having to take ball backcourt after rebounding opponent's miss, and added the other game options of HORSE and Around the world . Still have to figure out swapping priority for players when P1 is below P0.

I suggest you read the instructions below.

 

 

Gameplay Information / Game options

To change game option, hit select switch ( score must be 0-0 , otherwise press reset to restart game).

For HORSE, the tens digit in scores will change to “H”. For Around The World, will change to “A”.

Game 1 ( default)

One-On-One

To shoot: press and hold button to jump. Release button to shoot. If you do not release button before landing this will result in travelling and change of possession.

--Releasing the button at the top of jump improves probability of making shot.

-- Closer to basket = higher probability of making shot

-- Players can dunk by contacting ball to basket without releasing button. If you are to immediate right or left of goal you can move in the air toward the basket.

Backcourt Rules: Upon rebounding opponent’s miss, ball must be taken beyond the 3 point line before you can shoot. This can be disabled by Setting P0 difficulty to A.

Winner’s- Outs vs. Loser’s Outs ( aka Make it- Take it) .

-- default is loser’s outs . Setting P1 difficulty to A changes to Winner’s Outs.

Steals: Players can steal ball from opponent by moving hands in contact with ball.

-- steal will not always occur . Sometimes nothing will happen and sometimes a foul will occur

Blocks: Players can block opponent’s shots by contacting shot while jumping.

--- must be immediately after shot is released , and blocks will not always occur with apparent contact.

Fouls : While attempting to steal , player can commit a foul. After foul, players are reset to starting position. After 3 fouls have been committed, additional fouls will result in one point being added to opponent’s score and opponent keeping possession.

Scoring: 2 points or 3 points for baskets. 1 point for being fouled after 3rd time

Game will not end. Players must decide on a score to play to .

 

Game option 2: HORSE

Doesn’t everyone know how horse works?

Players must self-police shots and move to correct positions .

Fouls are disabled in HORSE . so if the wrong player has the ball, the other player just needs to steal ball.

Scoring: First player to earn “E” loses.

 

 

Game option 3: Around the World

Not sure if many people played this as kids, but I played it a lot.

---- -This game is self -policing . Players must keep track of their shots and must move to correct positions.

Rules: Player 0 starts at left three point line position and shoots.

If shot is made, then player moves to position 2. If miss, then player can take a second shot or stay in place and allow next player to begin turn.

If second shot is made, then player moves to next position. If second shot is missed, then player must return to position 1 and start all over .

--- First player to make shots at all 10 positions wins .

Fouls are disabled in Around the World . So if the wrong player has the ball, the other player just needs to steal ball.

Positions ( these are suggested positions – players can add or alter positions as desired , as there is no set ending to game):

 

See attached for diagram.

 


 

 

 

 

 

Edited by easmith
  • Like 2
Link to comment
Share on other sites

I loved one-on-one for the Commodore 64 when it came out and later (for me) for the Atari 7800.

 

Timing your jump shot and proximity to the basket can improve the probability of making a shot. Does distance from the defender also enter into the equation? Seems like a wide open jump shot should have a higher probability compared to a closely contested shot.

 

Great work btw!

Link to comment
Share on other sites

This came together very nicely. It sounds like you're about out of space, but it sure would be nice to have the breaking backboard for some dunks. That was the big appeal to the other versions for me: trying to break that backboard and seeing the janitor tell you off as he passes by to sweep it up. :lol:

 

The other things is AI. I've not gotten anyone to play Atari with me in about 29 years, so other than just to look at for a minute (this one looks quite good), 2-player-only games don't get any play for me and only provide the frustrating "wish it had AI"...

If it's just a space constraint, it would definitely be worth going to 16K to include that.

Link to comment
Share on other sites

Thanks

 

This came together very nicely. It sounds like you're about out of space, but it sure would be nice to have the breaking backboard for some dunks. That was the big appeal to the other versions for me: trying to break that backboard and seeing the janitor tell you off as he passes by to sweep it up. :lol:

The other things is AI. I've not gotten anyone to play Atari with me in about 29 years, so other than just to look at for a minute (this one looks quite good), 2-player-only games don't get any play for me and only provide the frustrating "wish it had AI"...
If it's just a space constraint, it would definitely be worth going to 16K to include that.

 

Thanks. I thought about the backboard breaking, but this is not doable I am afraid based on how I am drawing the backboard.

 

As far as the 2 player thing, I have the same problem. I still haven't played against an opponent to test out the gameplay, although I hope to soon ( I have only been working on it for two weeks though).

If you play the Around the World game ( game 3) , you can shoot around by yourself and the ball returns to you after a make. It's kind of cool just to shoot around. (?) :(

 

Programming a smart AI opponent I think would just be too hard. Also to get it where you could play either player in a single player game. Would require allowing joystick 0 to control P1 and all other sorts of things. I want to make a game that is played, but I don't think I could pull of the AI. I did AI on my other game Kung Fu Combat, and it was very difficult to get it right to where you wouldn't either always win or always lose.

Link to comment
Share on other sites

I think I have successfully pulled it off so that if Dr J player (P1) is below Bird player then he changes to P0 graphic so that he shows in front ( P0 has priority over P1 so before even if Dr J was below Bird then Bird would be "on top").

This affected a lot of other logic that had to be adjusted when this occurs. I think I caught all of the things that were affected but not sure.

This version now has the brown/white color scheme which I prefer except for the white ball :(

 

Edited by easmith
Link to comment
Share on other sites

I loved one-on-one for the Commodore 64 when it came out and later (for me) for the Atari 7800.

 

Timing your jump shot and proximity to the basket can improve the probability of making a shot. Does distance from the defender also enter into the equation? Seems like a wide open jump shot should have a higher probability compared to a closely contested shot.

 

Great work btw!

It does now. thanks for the suggestion

 

 

 

changing the player priority introduced bugs . have to try to fix them :(

 

reverting to last known good version

Edited by easmith
Link to comment
Share on other sites

I have it working now to where the priority swap only happens when J has ball and is below B. At least this shows J on top when has ball.

 

that really threw a wrench in the works for a while

 

 

3/17/19

 

when I switched shadow to M1 , forgot to change 3 point routine which needs shadow of ball ( not player ) behind line in the curved section of 3 point line. fixed now

 

3/18/19

 

added backboard break , animation of legs, "jump ball" , and adjustable color scheme. Edited instructions

 

Edited by easmith
  • Like 1
Link to comment
Share on other sites

Looking good!

 

 

most recent .bin in lower post

 

if you click on the # at the upper-right of the reply:

post-3056-0-18364300-1552509131.png

 

You'll get a pop-up:

post-3056-0-36434400-1552509135_thumb.png

 

Copy the text in the box and you can make a link that'll take the reader directly to it. I suggest putting that link at the very top of your initial post so people don't have to search for it. As an example see the Draconian topic.

Link to comment
Share on other sites

Thanks. I thought about the backboard breaking, but this is not doable I am afraid based on how I am drawing the backboard.

...Programming a smart AI opponent I think would just be too hard. Also to get it where you could play either player in a single player game. Would require allowing joystick 0 to control P1 and all other sorts of things. I want to make a game that is played, but I don't think I could pull of the AI. I did AI on my other game Kung Fu Combat, and it was very difficult to get it right to where you wouldn't either always win or always lose.

You could do the backboard, but it would probably require bumping up your rom space to 16K, since you'd have to add several more playfields.

Like this:

post-9364-0-92553000-1552685056.gif

Followed by the janitor coming across the screen. The debris could just disappear when he reaches it.

 

Programming a smart AI opponent I think would just be too hard. Also to get it where you could play either player in a single player game. Would require allowing joystick 0 to control P1 and all other sorts of things. I want to make a game that is played, but I don't think I could pull of the AI. I did AI on my other game Kung Fu Combat, and it was very difficult to get it right to where you wouldn't either always win or always lose.

I certainly understand that. It's definitely more than I could do. :dunce:
  • Like 4
Link to comment
Share on other sites

You could do the backboard, but it would probably require bumping up your rom space to 16K, since you'd have to add several more playfields.

Like this:

attachicon.gifOneonOne3112019_sm.gif

Followed by the janitor coming across the screen. The debris could just disappear when he reaches it.

 

I certainly understand that. It's definitely more than I could do. :dunce:

very cool , but

1. I have no idea how you did that !

2. I just got squared away on how to correctly do 8k bankswitch where the game starts up correctly in both banks.

 

Let me try to get all the bugs out in the current 8K version . Then perhaps we can collaborate on this......

Link to comment
Share on other sites

I think I have the gameplay pretty bug free at this point. Need to play it a bit against someone other than myself.

 

http://atariage.com/forums/topic/288985-one-on-one-atari-2600-asm/?p=4237442

 

Just in case , I did add in a "jump ball feature" for if something weird happens . If either score is nonzero, pressing select will place the ball at the bottom of the screen in a random spot and will "reset " without affecting current scores or foul counts. Then players can race to the ball. If scores are both zero , select will still select game option

  • Like 1
Link to comment
Share on other sites

A few more improvements: I went to 16K. http://atariage.com/forums/topic/288985-one-on-one-atari-2600-asm/?p=4237442

 

Added:

---backboard shatters upon dunk , about 20% of time ( currently does not have animation , but still cool I think) . Need a better sound........

---animation of legs when players move.

---more rebound angles.

--- changing TV type will toggle between white court lines, backboard, and ball or orange court lines backboard , and ball.

  • Like 4
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...