Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

2024 Participants: Hannah Ackermans * Sara Alsherif * Leonardo Aranda * Brian Arechiga * Jonathan Armoza * Stephanie E. August * Martin Bartelmus * Patsy Baudoin * Liat Berdugo * David Berry * Jason Boyd * Kevin Brock * Evan Buswell * Claire Carroll * John Cayley * Slavica Ceperkovic * Edmond Chang * Sarah Ciston * Lyr Colin * Daniel Cox * Christina Cuneo * Orla Delaney * Pierre Depaz * Ranjodh Singh Dhaliwal * Koundinya Dhulipalla * Samuel DiBella * Craig Dietrich * Quinn Dombrowski * Kevin Driscoll * Lai-Tze Fan * Max Feinstein * Meredith Finkelstein * Leonardo Flores * Cyril Focht * Gwen Foo * Federica Frabetti * Jordan Freitas * Erika FülöP * Sam Goree * Gulsen Guler * Anthony Hay * SHAWNÉ MICHAELAIN HOLLOWAY * Brendan Howell * Minh Hua * Amira Jarmakani * Dennis Jerz * Joey Jones * Ted Kafala * Titaÿna Kauffmann-Will * Darius Kazemi * andrea kim * Joey King * Ryan Leach * cynthia li * Judy Malloy * Zachary Mann * Marian Mazzone * Chris McGuinness * Yasemin Melek * Pablo Miranda Carranza * Jarah Moesch * Matt Nish-Lapidus * Yoehan Oh * Steven Oscherwitz * Stefano Penge * Marta Pérez-Campos * Jan-Christian Petersen * gripp prime * Rita Raley * Nicholas Raphael * Arpita Rathod * Amit Ray * Thorsten Ries * Abby Rinaldi * Mark Sample * Valérie Schafer * Carly Schnitzler * Arthur Schwarz * Lyle Skains * Rory Solomon * Winnie Soon * Harlin/Hayley Steele * Marylyn Tan * Daniel Temkin * Murielle Sandra Tiako Djomatchoua * Anna Tito * Introna Tommie * Fereshteh Toosi * Paige Treebridge * Lee Tusman * Joris J.van Zundert * Annette Vee * Dan Verständig * Yohanna Waliya * Shu Wan * Peggy WEIL * Jacque Wernimont * Katherine Yang * Zach Whalen * Elea Zhong * TengChao Zhou
CCSWG 2024 is coordinated by Lyr Colin (USC), Andrea Kim (USC), Elea Zhong (USC), Zachary Mann (USC), Jeremy Douglass (UCSB), and Mark C. Marino (USC) . Sponsored by the Humanities and Critical Code Studies Lab (USC), and the Digital Arts and Humanities Commons (UCSB).

[Code Critique] NBA Jam Source Code - Bulls can't beat the Pistons in the last five seconds

I stumbled into this on Instagram and then ended up down a rabbit hole, but the creator of the video game NBA Jam was a massive Pistons fan and was bitter about how good the Bulls were. He says he wrote code that would prevent the Bulls from making a game-winning shot in the last five seconds of the game.

I have started digging through the code but haven't found this spot in the code just yet. I thought this crew would likely be able to find it quickly! But there's other really interesting things in this code as well - the designers built themselves into the game, and there a number of other cool nuggets in there too.

I can't post a code snippet here because I don't know where this moment in the code is, but once we find it maybe we can edit this post?

Source Code on GitHub (in Assembly):

Turmell Talking about it here:

GDC Presentation by Turmell where he mentions it (but doesn't point to code):


  • A couple of initial thoughts:

    1) This may just be a version of the code that doesn't have this function in it.

    2) It seems that searching for mentions of "brick" might be useful, given that Turmell says that what he did was increase the chances of a last-second shot by the Bulls agains the Pistons being a brick. I have found mention of a #nobrick function that decreases the chances of a shot being a brick...but that's all at this point.

  • The player.asm file has the following comment:

    * 1. If 4th or overtime qrtr has 5 seconds or less remaining and
    *   a. If score is already tied or I am ahead, do nothing.
    *   b. This shot (2 or 3) would tie the score, then make it go in 75% of
    *      the time.  (Regardless of shot distance)
    *   c. This shot (2 or 3) would win the game, then make it go in at
    *      least 30% of the time (Close in would be higher, but even bombs
    *      go in 30%)
    *   d. If this shot would pull me to within 1/2 points, then make it go
    *      in 90% of the time for max excitement without putting him ahead.

    The code is:

        move    @game_time,a1,L
        cmpi    >400,a1         ;!!! ;Last seconds of qrtr?
        jrgt    #nohelp         ; br=no
        move    @gmqrtr,a3
    move    a2,a0           ;Game tied?
    jrnz    #notie          ; br=no
    subk    3,a3            ;In 4th qrtr or OT?
    jrlt    #nohelp         ; br=no
    movi    50,a9           ;!!! ;Last second shot of a tie game
    jruc    #nohelp         ; should almost never go in

    This suggests that a last second shot of a tie game should almost never go in, regardless of the teams playing...

  • edited February 23

    I'm just starting to look through this code but this little passage from MAIN.ASM jumped out at me for its colorful comments:

        .if IMGVIEW
    ;Allow me to exit TV and go into IT to tweak these mofo's
        PUSH    a14
        movi    SYSCINIT,a14
        xori    02000h,a14
        move    a14,@SYSCTRL
        ori 02000h,a14
        move    a14,@SYSCTRL
        PULL    a14

    Not what we're looking for, but evidence of some lockerroom atmostphere in the development space. Of course, it's easiest to take on the comments first. Plunging deeper...

  • There's a bunch of that stuff in there, Mark. Definitely worth digging into.

    I have a hunch that Turmell is telling stories (some youtube commenters think this too). It reminds me a bit of Pat LeMieux's work on Super Mario Clouds.

  • That makes me feel better, @jamesjbrown I spent the day pouring over this code and found little more than what you did. I mean he does have his fingers on the scales of the players, though not unjustly perhaps...

    PLYR.ASM includes this:

    ;FIX!!  This should also do an adjustment based on who it is and how good
    ;they are at 3 ptrs!  Hill doesn't even shoot 'em!  Rodman should be a 0!
    ;Store another flag for guys who don't even shoot them...

    But again, stats might back that up and it is not 4th quarter dependent.

  • edited February 24

    Also based on this comment, the bias against the Bulls, might really just be the bias against anyone taking last minute shots, as in the code you've found. Quoting from this article:

    According to the lead designer and programmer Mark Turmell, that is by design. If you’re a the Chicago Bulls and you’re in a close game against the Detroit Pistons, you’re going to miss the last shot. That’s because Turmell who grew up in Michigan, is a Pistons fan. After decades of speculation, he admitted t it to Ars Technica in their ‘War Stores’ video about the legendary NBA game. “If the Bulls were taking a last-second shot agains the Pistons, it would miss those shots.”

    So it's not just about the Bulls, but any team trying to do that. And now I'm thinking about all of MJ's game winning, last-minute shots for the Bulls in the years around the release of this game.

Sign In or Register to comment.