ZX Spectrum Jetpac - Game Deconstruction

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 มิ.ย. 2024
  • Retro games make great coding projects for beginner games programmers. They were usually written by one or two people without massive teams of designers, musicians, coders, etc.
    Jetpac was one of the best games written for the ZX Spectrum, BBC Micro and VIC20 in the early 80's. It's a mixture of a shoot-em-up and platform game where you have to build and fuel your spaceship whilst fighting off hoards of hostile aliens.
    This video is one of my game deconstruction episodes where I take the game and break it down to see how it works. The idea is to give you all the information you need to remake the game for yourself. I examine each aspect of the game and give you hints on how you might solve the programming challenges. I don't assume any language or development system so you can use the information to rebuild using Python, Javascript, TIC80, PICO8 or whatever you're familiar with.
    If you're new to games coding and want to learn how to become a programmer check out my beginner coding courses. Space Invaders is for complete beginners, whilst Asteroids is my level 2 beginner course. If you've completed the Space Invaders course you'll have all the skills needed to rebuild Jetpac!
    Make sure you check out the project page on my website.
    bytesnbits.co.uk/zx-spectrum-...
    Have fun programming!

ความคิดเห็น • 28

  • @tehf00n
    @tehf00n 8 หลายเดือนก่อน +5

    When I was 6 I skipped school for the only time in my life, just to play this game. What I didn't know was that it was the exact day my parents had hired a friend to decorate the house. I was caught and wasn't allowed to play it for a month. It was part of the inspiration for me becoming a game developer.

    • @BytesNBits
      @BytesNBits  8 หลายเดือนก่อน +1

      I think it's great to choose a career where no-one will tell you off for playing games at work.

    • @tehf00n
      @tehf00n 8 หลายเดือนก่อน +1

      @@BytesNBits Well I'm the boss now so I can only tell myself off. Which I actually do. I'm kind of strict about my game/development ratio. It's often easy to slip into a month or two of gaming and wonder where the time went. Especially with so many releases and GaaS titles these days :)

    • @b213videoz
      @b213videoz 4 หลายเดือนก่อน

      In that case the guy made the WRONG choice: instead of becoming a game developer he should have become a game tester 🤪
      A dev. isn't supposed playing games during working hours - unlike a tester.

    • @tehf00n
      @tehf00n 4 หลายเดือนก่อน

      @@b213videoz When you are a game programmer, you are a game tester also. It's part of the process. The only time a full time quality assurance employee is required is for the second pair of eyes as the deadline looms. Often a programmer is trying to fix things, or develop critical systems, to a timeline based on the project management so doesn't get to do the little jobs or go back and sequentially test. We tend to fix things as we see them or jot it down for later because of priority issues. Still, you have to unwind and my hobby is gaming. Otherwise you burn out and a burned out coder is no good to anyone.

    • @b213videoz
      @b213videoz 4 หลายเดือนก่อน

      @@tehf00n WRONG! A recipe for disaster: involving INDEPENDENT QA too late in the cycle will uncover HEAPS of bugs that a developer gladly overlooked 🤪
      A judge cannot be a prosecutor as much as a Dev cannot be a tester. Independent testing EARLY in the cycle is a must

  • @johnny5805
    @johnny5805 3 ปีที่แล้ว +5

    Ooo, I thought was going to be an actual disassembly of the code. Which come to think of it, wouldn't have made an interesting video to anyone not a master of Z80 assembly code :-)

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +1

      Hi. I'm not that deep into the machine code end of things. It's much easier and faster to rework the games in a modern development system.

  • @marinaru68
    @marinaru68 2 ปีที่แล้ว

    Thank you for this video, Bytes n Bits! Robert - Romania.

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว +1

      You're welcome

  • @harrivayrynen
    @harrivayrynen 7 หลายเดือนก่อน

    Great video! And nice memories, this was one of the first Speccy games I played. One kid in our neighborhood got Spectrum before us and he did have this game. But his cassette player was not working with Spectrum, but I did have a better cassette player and was number 1 visitor to his home, because without my player the game did not load. And during evenings many kids were behind the door and asked if they can also come to play, but the "room was full" already. Later I got own Spectrum and nice games. Now waiting for Spectrum Next v.2 from Kickstarter.

    • @BytesNBits
      @BytesNBits  7 หลายเดือนก่อน

      Thanks. They were great fun. Keep an eye out for the next video. You might like it!

  • @RoulDukeGonzo
    @RoulDukeGonzo 3 ปีที่แล้ว +4

    Nobody ever know about the hover key

  • @vast634
    @vast634 ปีที่แล้ว

    How did they move the sprites smoothly? Was that redrawn for each sprite each frame? It would require like updating 4 character to account for overlap. Or can the spectrum directly write the pixels in a screen memory?

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว +1

      The 8 bit computers used memory mapped displays so a block of memory directly related to what was being displayed. This was a single buffered system so as soon as the memory was written to the new image would be shown on the next display refresh.
      To animate a sprite you had to remove it from the memory map and then redraw it at it's next position. If you look closely you'll see the the moving sprites never go over the background images and are always on a black background. This makes it easy to erase a sprite - just write a black rectangle over it.
      When you write directly to the video RAM you can individually set pixels so character cells aren't an issue but you do need to be aware of how the screen pixels and colours are represented within the memory map.

    • @vast634
      @vast634 ปีที่แล้ว

      @@BytesNBits I remember that the XZ Spectrum, at least to have a multi color mode, used two colors defined per 8x8 block. And those blocks where populated by bitmaps that where using the same memory as the fonts. So in order to draw a scene in jetpack it would use unused letters in the font and edit its bitmap, plus set the two colors this 8x8 screen region had. To make a sprite move by single pixels, they would have to dynamically update those bit-masks in the "letters", and their neighbors.

    • @Elesario
      @Elesario 11 หลายเดือนก่อน +2

      For advanced games where there was a background too they would have a sprite mask, essentially a silhouette of the sprite, and use it to cut out part of the background and save it, and then write the sprite into the cut out space, and then they could revert the background after and repeat the process for the next sprite position. Thereby being able to move about sprites without having to do large redraws every frame.

    • @nicolaishestakov
      @nicolaishestakov 9 หลายเดือนก่อน +2

      It can, but not pixels. 1 byte represents 8x1 monochrome pixel line. The colors are set separately for 8x8 blocks, including ink and paper colors and a flashing flag. To output a sprite pixel accurate you need specials techniques like shifting the sprite bytes by a certain number of bits to adjust it to the desired offset. For that reason many games move sprites with a color block accuracy (8x8 pixels) only.

    • @KieronEdwards
      @KieronEdwards 8 หลายเดือนก่อน +1

      You can see that the drawing isn't synchronised to the flyback interrupt so it's tearing as you move. To get really smooth drawing you'd drive your drawing code from an interrupt that was fired when the whole screen had been drawn and then try to get everything refreshed on screen before the end of the flyback period (the time it took for the cathode ray to return to the top left of the screen). I remember one developer used to wipe the screen by using the stack pointer - it wrote 2 bytes in the shortest time - so he put it at 16384 (IIRC) and PUSHED zeros until the screen was wiped. He then restored the SP to it's proper place in memory.@@BytesNBits

  • @lehuy8660
    @lehuy8660 2 ปีที่แล้ว

    how did you do it can you share with me , thank you

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      This breakdown is just looking at how the game is built. I didn't disassemble the actual code. If you record the gameplay and view it frame by frame you'll see how the animations are created.

  • @daveduvergier3412
    @daveduvergier3412 7 หลายเดือนก่อน

    The issue that stymied me was the bizarre screen memory layout of the Spectrum; I assumed you had to do all your processing in terms of screen memory addresses, which would have been inordinately complicated. It literally never occurred to.me that you could maintain object positions in terms of simple x-y coordinates and do all your movement, collision detection etc in terms of that, and convert to screen memory locations at the point of actually doing the video update 🙄

    • @BytesNBits
      @BytesNBits  7 หลายเดือนก่อน +1

      Yes. It's easier to model the physics and then translate to the final display.

  • @knkn5049
    @knkn5049 8 หลายเดือนก่อน

    do you know what happened to jetpack 2? why it is so absurdly unintuitive and unplayable? maybe it is programm glitches?

    • @BytesNBits
      @BytesNBits  8 หลายเดือนก่อน

      I had never come across Jetpack 2. Seems like it's very loosely based on the original 8 bit game.

  • @mikaeladoyle9301
    @mikaeladoyle9301 2 ปีที่แล้ว

    how did you do it can you share with me , thank you

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      How can I help you?