Jump to content

Photo

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


33 replies to this topic

#1 easmith OFFLINE  

easmith

    Chopper Commander

  • 244 posts
  • Location:Alexandria, VA

Posted Thu Mar 7, 2019 7:18 PM

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

 

http://atariage.com/...-asm/?p=4243252

 

 

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 


Edited by easmith, Fri Mar 22, 2019 6:34 PM.


#2 eebuckeye OFFLINE  

eebuckeye

    Stargunner

  • 1,262 posts

Posted Thu Mar 7, 2019 8:25 PM

That looks really cool!



#3 MemberAtarian OFFLINE  

MemberAtarian

    Moonsweeper

  • 266 posts

Posted Fri Mar 8, 2019 6:43 AM

Looks promising. :) The key is physics, I was never too good at it. :D



#4 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Fri Mar 8, 2019 9:37 AM

I added dunks !  Can't have a basketball game without dunks.   If you are the left or right of basket, you can move left or right in the air to dunk ball.  Also registers if you are directly in front of basket.



#5 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 28,963 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Mar 8, 2019 11:03 AM

When the ball goes in the net, maybe you could use a sound similar to this:

 

Attached File  basketball_net_sound_attempt_01_2019y_03m_08d_1159t.bin   4KB   20 downloads

 

Somebody could probably come up with something better. That's the best I could do in a few minutes.



#6 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Fri Mar 8, 2019 6:20 PM

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, Sat Mar 9, 2019 10:07 PM.


#7 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Sat Mar 9, 2019 6:07 PM

stole a couple of hours to make some adjustments.

 

Added shot blocks!  and fixed a few bugs .  I have maxed out both 8K banks at this point.   Getting very close unless I decide to go to 16K


Edited by easmith, Mon Mar 11, 2019 2:03 PM.


#8 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Sat Mar 9, 2019 8:35 PM

Oh yes , pretty important: now after a change of possession you can't shoot until the ball is taken back court past the middle 3 point line 



#9 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Sat Mar 9, 2019 10:06 PM

sorry I posted the wrong bin. correct now posted



#10 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 21,890 posts
  • Location:The land of Gorch

Posted Sun Mar 10, 2019 3:30 AM

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, Sun Mar 10, 2019 3:51 AM.


#11 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Sun Mar 10, 2019 7:38 AM

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.



#12 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Mon Mar 11, 2019 2:13 PM

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.

 


 

 

 

 

 

Attached Files


Edited by easmith, Tue Mar 12, 2019 3:30 PM.


#13 cvga OFFLINE  

cvga

    River Patroller

  • 4,535 posts
  • Location:Sector 36

Posted Mon Mar 11, 2019 9:26 PM

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!



#14 KevinMos3 OFFLINE  

KevinMos3

    Stargunner

  • 1,605 posts
  • Founder of the Timothy Dalton as Bond fan club
  • Location:Behind YOU!

Posted Tue Mar 12, 2019 8:18 AM

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.

#15 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Tue Mar 12, 2019 9:01 AM

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.



#16 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Tue Mar 12, 2019 9:11 AM

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, Tue Mar 12, 2019 3:54 PM.


#17 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Tue Mar 12, 2019 3:55 PM

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, Wed Mar 13, 2019 2:06 PM.


#18 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Wed Mar 13, 2019 2:07 PM

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

 

Attached Files


Edited by easmith, Mon Mar 18, 2019 7:38 PM.


#19 SpiceWare OFFLINE  

SpiceWare

    Draconian

  • 12,698 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Wed Mar 13, 2019 2:34 PM

Looking good!

 

 

most recent  .bin in lower post

 

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

Screen Shot 2019-03-13 at 3.30.11 PM.png

 

You'll get a pop-up:

Screen Shot 2019-03-13 at 3.30.20 PM.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
 



#20 KevinMos3 OFFLINE  

KevinMos3

    Stargunner

  • 1,605 posts
  • Founder of the Timothy Dalton as Bond fan club
  • Location:Behind YOU!

Posted Fri Mar 15, 2019 3:27 PM

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:
OneonOne3112019_sm.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:

#21 ZeroPage Homebrew OFFLINE  

ZeroPage Homebrew

    Dragonstomper

  • 565 posts
  • Location:Vancouver Canada

Posted Fri Mar 15, 2019 5:31 PM

Am I missing something or are all the .bin files deleted for this WIP? I'm looking forward to trying it as I loved One on One on the C64.



#22 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Fri Mar 15, 2019 7:11 PM

sorry. been playing Whack-a-Mole with bugs.  I think it is ok now ( fingers crossed)



#23 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Fri Mar 15, 2019 7:19 PM

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......  



#24 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Sat Mar 16, 2019 9:20 AM

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/...-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



#25 easmith OFFLINE  

easmith

    Chopper Commander

  • Topic Starter
  • 244 posts
  • Location:Alexandria, VA

Posted Mon Mar 18, 2019 3:49 PM

A few more improvements:  I went to 16K.  http://atariage.com/...-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.






1 user(s) are browsing this forum

1 members, 0 guests, 0 anonymous users