Is Pixel Perfect Collision Impossible? - CODING SECRETS

Поділитися
Вставка
  • Опубліковано 2 лис 2024

КОМЕНТАРІ • 463

  • @scotts918
    @scotts918 6 років тому +581

    Programmers - if you tell them something can't be done, even if you're the developer of the hardware....
    They. Will. Find. A. Way.

    • @pumpkin6429
      @pumpkin6429 5 років тому +6

      Scott S 👏 👏 👏 👏 👏

    • @imdone8243
      @imdone8243 5 років тому +12

      I'm still trying to figure out how to be happy. Scuffs

    • @alakani
      @alakani 4 роки тому +8

      ​@@imdone8243 We could use CRISPR/Cas12a to make you happy, but being happy all the time would actually be pretty antisocial. I suspect you would automatically be happy without any personal code changes, if the genes responsible for narcissism were supressed in the general population, but the resulting loss of genetic diversity might lead to the extinction of our species if the environment changes too rapidly.

    • @CrossoverGameReviews
      @CrossoverGameReviews 4 роки тому +1

      Just like players playing your game. "I've tested this for bugs and exploits. You can't cheat your way out." But they always find an exploit.

    • @decrodedart2688
      @decrodedart2688 4 роки тому

      yeah bro haha its probably a good reverse psychology trick!
      haha

  • @NoahNCopeland
    @NoahNCopeland 6 років тому +619

    It amazes me the ingenuity you guys had back in the day.

    • @ficolas2
      @ficolas2 6 років тому +8

      Noah Copeland indeed, nowadays something like that is as simple as a broadphase and then checking for sprite collision.
      Even possible for 3d meshes

    • @ficolas2
      @ficolas2 6 років тому +23

      Big part of game developement nowadays is code monkeying.

    • @bangerbangerbro
      @bangerbangerbro 6 років тому +2

      ficolas2 How do you just "check" for a sprite collision when most modern hardware are blitter systems. The only thing the hardware really does on its own is draw images and distort them in different ways.

    • @ficolas2
      @ficolas2 6 років тому +2

      No one You know cpu, not gpu.
      Thats the thing, with a broadphase checking boundix box collisions and calculating the collision areas, modern CPUs are capable of doing this. Ofc it depends on how many collisions will have to be checked.

    • @VulpisFoxfire
      @VulpisFoxfire 6 років тому +8

      Yeah...devs are relatively lazy these days, since they generally have processing and storage to spare instead of having to cram it all into very small parameters like they did on older machines.

  • @matt4193
    @matt4193 6 років тому +254

    Working with limited hardware and space sure made things tricky and at times almost infuriating, but man, do we get some amazing dev diaries explaining their struggle and clever ways to get even further than what the machines were capable of.

    • @jc_dogen
      @jc_dogen 6 років тому +13

      Matt using features built into the hardware isn't exactly exceeding the capabilities of the machine

    • @digiorniboy
      @digiorniboy 6 років тому +15

      Matt *than what we thought the machines were capable of

    • @riddleiddle
      @riddleiddle 6 років тому +6

      Sometimes I think their limitations sparked their creativity and brought us the best aspects in gaming.

    • @johneygd
      @johneygd 6 років тому

      Math Helper i guess those hardware limitations did not only sparket creativity but it may also have sparked the idea to produce systems more economically.
      For example if my first revision of a speak & spell gedjet contains a 1bit DAC for voices,,, but once i will descover that it is also possible to mimic 1Bit voices on a much cheaper PSG soundchip by using tricks, then i will implement that PSG chip in my 2nd revision of my speak & spell gedjet, and so on, this is just simply amezinf, seeing,doing more with less.

    • @euphorik3120
      @euphorik3120 10 місяців тому

      obviously & evidently not further than what the machines are capable of.

  • @Diveji
    @Diveji 6 років тому +195

    Videos about techniques and how (and why) were they developed are the most interesting in my opinion.

    • @ChronoPhoenix
      @ChronoPhoenix 4 роки тому

      you should watch how Chrono Trigger music was done for a magic experience.

  • @phrygianphreak5408
    @phrygianphreak5408 6 років тому +14

    The amiga offered some interesting shortcuts. I always used three pass hit detection:
    Are two objects in the same region?
    If so, do their bounding boxes over lap?
    If so, do their pixels overlap?
    If so, collision detected.
    The main problem I found with collision detection is you spend way more time figuring out two things aren't colliding than you do are colliding. This is even true on the cpu level; the cpu will usually figure out two pixels are overlapping faster than finding out no pixels are overlapping. I figured if I just give the program plenty of easy opportunities to bail out of detecting collision between two objects that clearly aren't colliding most of the resources wasted on detection would be freed up

  • @RobertSzasz
    @RobertSzasz 6 років тому +114

    This is one of those titles where the initial answer is easy (of course it can be done, it just takes resources you want for other things), but the workarounds are the interesting bit.

    • @paulmarko
      @paulmarko 6 років тому +14

      Yeah, sadly even interesting videos have to use click-bait headlines in order to get views. "Coding pixel-perfect collision on Amiga hardware" just doesn't have the same zing to it.
      Cracked.com is famous for this. They always have something interesting to say, but it's wrapped in the most sensational click-baity title, because that's often the difference between 20,000 and 80,000 views.

    • @ENCHANTMEN_
      @ENCHANTMEN_ 6 років тому +6

      IMPOSSIBLE multiplication hack! Can the SEGA Genesis do math? CODING SECRETS!

    • @okarowarrior
      @okarowarrior 6 років тому +4

      THESE 2 DISGUSTING SECRETS AMIGA CEOS DONT WANT YOU TO KNOW 4k flak rare version Frozen Spiderman Despacito 2.0

    • @sonicmastersword8080
      @sonicmastersword8080 Рік тому

      @@paulmarkoClick-bait needs to die. When everything is competing for attention with absurd statements and excessive editing, nothing is perceptible as legitimate anymore.

    • @paulmarko
      @paulmarko Рік тому

      @@sonicmastersword8080
      Thats the tragedy of the commons. Unless it stops working or until some top-down market control can be implemented, there's no way to prevent the arms race that is click-bait, sadly. :(

  • @thosediamonddreams
    @thosediamonddreams 6 років тому +4

    this channel is so damn good. I'm not a programmer of any sort and these breakdown videos are so fascinating, emphasized by the hardware limitations of old times. so clever. I love it.

  • @fedup7496
    @fedup7496 6 років тому +58

    This channel always has the most fascinating videos.

  • @BdR76
    @BdR76 6 років тому +22

    Wow, very clever use of the hardware there. Reminds me of an article "Contra Collision Detection" about clever use of hitboxes in Contra on NES, a system with only limited CPU power.

    • @KuraIthys
      @KuraIthys 6 років тому +6

      BdR76 Mmh. NES doesn't have hardware collision either.
      Though never underestimate a 6502 for doing the seemingly impossible. XD

  • @benbaez6044
    @benbaez6044 6 років тому +1

    This is not an empty compliment. This is not a blatant thank you. THANK. YOU. FOR. BEING. SO. DANG. CLEVER. This stuff is probably the single most intriguing thing I have ever found on the internet. Simply. AMAZING!

  • @KallyNui
    @KallyNui 4 роки тому +2

    Shoutouts to that artist for making such beautiful art with only SEVEN colors.

  • @TheGuruMeditation
    @TheGuruMeditation 6 років тому +2

    That was a great video, thank you! You made something that is very technical extremely easy to understand for a noob like me. That takes a lot of skill. This is my first video of yours that I watched. I am very glad I found your channel and can't wait to watch more!

  • @JackBz
    @JackBz 6 років тому

    This is just a classic and concise coding secrets video. Your channel is such a joy

  • @Holammer
    @Holammer 6 років тому +253

    Was the Megadrive version easier to write, or did it introduce new challenges?

    • @XBladenoJutsu
      @XBladenoJutsu 6 років тому +29

      EA ported the game to MD, so I seriously doubt Jon would know.

    • @Imgema
      @Imgema 6 років тому +40

      He worked on other games on MegaDrive though, like Mickey Mania and Sonic 3D Blast, so i'm sure he has an idea.

    • @GameHut
      @GameHut  6 років тому +210

      XBladenoJutsu Actually we ported it, so I would know...

    • @GameHut
      @GameHut  6 років тому +242

      Was easier to write as it had better hardware so we could do more without worrying so much about the frame rate.

    • @XBladenoJutsu
      @XBladenoJutsu 6 років тому +19

      @GameHut
      Huh... Ok. Didn't know that. I figured it was earlier than when you started up with the Genesis. I admit though, I never played it. I was always put off by EA games, even back then lol

  • @Larry
    @Larry 6 років тому +293

    What was the reason to rename it from Leander to Legend of Galahad?

    • @SirRigbyBaconKaiser
      @SirRigbyBaconKaiser 6 років тому +61

      Basically: EA.

    • @GameHut
      @GameHut  6 років тому +204

      Larry Bundy Jr EA preferred an Arthurian Legend spin for the US Market so we changed the game intro sequence and the name.

    • @badreality2
      @badreality2 6 років тому +2

      Watch the Top Hat Gaming Man. He made a video, focusing on you, Billy Mitchell, AND Channell Awesome. It is interesting. Good for you, for staying with Channel Awesome, even though they never promoted your channel, and you grew your own fanbase, with your UA-cam Channel.

    • @badreality2
      @badreality2 6 років тому

      NuvYou You're welcome.

    • @hdofu
      @hdofu 6 років тому +1

      +NuvYou rumor are Doug and Rob aren't sticking with the channel (there were 3 prerecorded shows from what I heard, he's also changed his face book status to say worked for Channel Awesome)

  • @jstock2317
    @jstock2317 6 років тому +16

    These types of videos are always so interesting! It's so cool to see how the hardware dictated game design and was used to leverage what was given. Thanks!

  • @Yourname942
    @Yourname942 6 років тому +2

    I love the logic of your coding. Thanks for sharing with us!

  • @Gikkman
    @Gikkman 4 роки тому

    These videos of yours are just mesmerizing. Thank you so much for sharing all these insights! It makes me view many of these old games in a new light, and appreciate them even more

  • @USJbroly
    @USJbroly 6 років тому

    I love these explanations. It's great to hear about the technical stuff in the background of games. Thanks so much for sharing!

  • @TheRealE1337ist
    @TheRealE1337ist 4 роки тому

    It's incredible that you manage to find elegant solutions to a lot of the challenges you're faced with. I don't think I would have done the same.

  • @OrioPrisco
    @OrioPrisco 6 років тому +139

    but does that mean that if another's objetc box toucher your box but doesn't overlap your pixels WHILE another object overlaps one of your pixel the collision detection returns that you're hitting both objetcts ?

    • @GameHut
      @GameHut  6 років тому +200

      In theory, but in practice it doesn't really happen due to how I placed the enemies and collectables.

    • @OrioPrisco
      @OrioPrisco 6 років тому +73

      so you were aware of that little flaw. Very interesting video

    • @607
      @607 6 років тому +11

      Orio Prisco Background objects overlapping would probably introduce other problems, so it makes sense that he designed the levels so it wouldn't happen. :)

    • @GrimRize
      @GrimRize 6 років тому +7

      I was a bit perplexed till I realized this was made on ancient hardware hahahaha, these days you can check against everything a million times and not skip a beat with these kinds of games.

    • @Templarfreak
      @Templarfreak 6 років тому +2

      Maybe something that could help iron out more issues is also figuring out which objects are closest, and if multiple boxes overlap then only the closest one would actually deal damage and perform knockback. That, and some invulnerability frames which I believe are already in the game right?

  • @banggugyangu
    @banggugyangu 4 роки тому

    Just plowed through 5 videos.... This is a fascinating channel.

  • @MattLacey
    @MattLacey 6 років тому

    Easily one of the most interesting series of videos I've ever found on UA-cam. Keep it up!

  • @froilanrivero2826
    @froilanrivero2826 4 роки тому

    your channel is amazing you deserve way more subscribers! I always get such nice insights from this channel. thank you so much in advance

  • @munchymcmouthington298
    @munchymcmouthington298 4 роки тому

    feeling awestruck to see this up on youtube. Leander was one of my favourite amiga games of all time :)

  • @marceltiel7919
    @marceltiel7919 3 роки тому

    Me and a friend were very impressed by Leander back in the Amiga days, loved the gameplay and the graphics plus the nice intro!

  • @caharkness
    @caharkness 6 років тому +2

    Very clever use of hardware for the time. I always imagined pixel-perfect collision detection to be unnecessarily expensive, but I didn't know there was ever a hardware-level implementation of collision detection made until now. I'd have to say that collision boxes are still my preferred way of collision detection, as we have plenty of CPU time to handle the collision of even hundreds of on-screen entities on today's hardware. Often times, I have both a vertical and horizontal collision box for player-like entities so that vertical and horizontal collisions aren't confused when calculating where to move the player (for things like walls and floors).

    • @flatfingertuning727
      @flatfingertuning727 4 роки тому

      Pixel-perfect collision detection in software isn't hard if one can spare some space for pre-shifted shape tables. If monsters can be up to 29 pixels wide and players up to 20, store four copies of each monster shape, shifted horizontally 0, 1, 2, or 3 pixels, and four for each player shape, shifted horizontally 0, 4, 8, or 12 pixels. Select a proper tables, figure out the starting offsets and amount of overlap, and the actual collision detection would be three instructions per row of overlap.

  • @chrisf1600
    @chrisf1600 4 роки тому

    I started programming in the 80s, and as soon as you said you'd found a way to solve the score collision problem, I guessed it had to involve chasing the raster :) That technique opened the door to so many clever hacks. Great video!

  • @Lilithe
    @Lilithe 6 років тому

    No wonder you got to work on so many great things. You come up with some really clever solutions!

  • @Islandswamp
    @Islandswamp 6 років тому

    I feel like you are a genius at this. I don't have any programming skills but your videos still amaze me.

  • @jon4715
    @jon4715 6 років тому

    Incredible, please don’t stop making these!

  • @dancannova
    @dancannova 6 років тому

    Thank you. It's been a blast watching your videos.

  • @denisevans213
    @denisevans213 4 роки тому

    Great, short easy-to-follow technical explanation from a gaming pioneer - thanks! - I LOVED Leander - The music, smoothness, tight control - superb classic!
    PS - Only just discovered your channel, will be subscribing!

  • @markduncan7638
    @markduncan7638 3 роки тому

    I've spent so many hours playing this game, loved it, and the music.

  • @nekononiaow
    @nekononiaow 6 років тому

    Thanks for the video Jon! I am very happy to see some Amiga related videos and indeed Leander is impressively colorful for a dual playfield game.I hope we will see more Amiga videos coming.

  • @AlexVideoPlayer
    @AlexVideoPlayer 6 років тому

    Thanks for the very interesting video and the brilliant Leander. I still play it every now and then.

  • @yabbaso
    @yabbaso 6 років тому

    Love hearing these coding secrets. Thank you so much for sharing.

  • @GanjsmostPrime
    @GanjsmostPrime 6 років тому

    You have been such a blessing to the UA-cam space. Keep doing you man, we love your insight

  • @BOLL7708
    @BOLL7708 4 роки тому

    I found this just now, and I think it's a great showcase of how something can be done when optimized/developer for a specific hardware platform. Mostly thinking of PC vs console regarding this, but this was easy to understand and fascinating at the same time 😁 Thanks!

  • @anothergol
    @anothergol 6 років тому +2

    I'm way more in favor of multi-rectangle (or poly's) collisions, though. Makes a lot more sense for gameplay. To start with, you only want your blade to act as a weapon, not the character's ponytail. Then, games that favor the player by enlarging their hit boxes & shrinking the enemy's, are more fun to play.
    Then different box IDs are useful to mark spots from which bullets are shot, items are held, etc.
    Having multiple boxes isn't even much time-consuming, as a pre-test using the largest bounding box already eliminates most of the objects.

    • @Cowcatgames
      @Cowcatgames 6 років тому

      I'm a consoles gamedev and I was expecting more comments like this. On a gameplay side, it makes much more sense to use multiple rectangles rather than precise collisions because you WANT to make the player able to defeat enemies easier (and the opposite for enemies) This is what I fixed for the consoles versions of Xenon Valkyrie+ and Riddled Corpses EX to make their gameplay more enjoyable. And what you said about the blade not extending to the entier character body makes perfect sense. Precise collisions should be used for things like terrain, not characters/objects interactions.

    • @DIGITALSWOON
      @DIGITALSWOON 4 роки тому

      The guy in the video, near the end, is mostly talking about saving time computing collisions by only calculating them when the player character's pixels are rendered on screen. I'm sure you can implement whatever method of collision you want this way, right?

  • @sheik124
    @sheik124 6 років тому

    I thought the level select crash handler was the best clever game design I'd seen, but this is better. Love your videos

  • @RussDnB
    @RussDnB 4 роки тому

    Amiga fan here!
    Whilst I knew the Amiga was a special machine, and knew of its wonderful chipset, I never got into coding on it (Okay, a bit of AMOS, but not a lot).
    It’s videos like this that I absolutely love to see after all these years.
    More on Amiga projects please 😊

  • @Valegator
    @Valegator 6 років тому

    Even thou I have no experience in coding and have no idea what you are talking about 50% of the time, I still find your videos fascinating.

  • @seronymus
    @seronymus 6 років тому

    This is gold. You're like a wise elder bequeathing his knowledge to the next generations. Every video just gets better!

  • @TheRealKaiProton
    @TheRealKaiProton 5 років тому

    Another amazing insight into how games work.

  • @RabbitEarsCh
    @RabbitEarsCh 6 років тому

    Brilliant hardware solution! I love this kind of out of the box thinking. Fascinating stuff.

  • @tcindie
    @tcindie 5 років тому

    That you were an Amiga developer was enough to earn my subscription. :) Great content is a nice bonus

  • @feosTAS
    @feosTAS 6 років тому +19

    So somebody was using it!

  • @jackfrost884
    @jackfrost884 6 років тому

    Great work my guy!
    Just found your channel and its sick

  • @randomizer2240
    @randomizer2240 6 років тому

    I sometimes wonder how people fit so much into their days? I assume as well as being a lead developer at Traveller’s Tales and a movie producer that you have a family and children you spend a lot of time with? And then you have enough free time to have a hobby making technical UA-cam videos and making director’s cuts of your old games.
    Anyway hats off to you man, I can barely get out of bed in the morning. Let alone work on that game I always planned to develop but never did. Love your channel keep up the great work!

  • @79toddy
    @79toddy 6 років тому

    I totally dig the use of copper to flag the screen elements - mind blown!

  • @howieb4217
    @howieb4217 6 років тому

    Man, that takes me back! I remember saying to my brother, back when Leander came out on the Amiga, that games would never look better than this. Top game! Cheers for the memories.

  • @androidgameplays4every13
    @androidgameplays4every13 6 років тому

    So you were the creator of Leander? WOW, I've spent my childhood playing and enjoying that game, nice to you see you here :)

  • @notthere83
    @notthere83 6 років тому

    This approach reminded me of how I kept thinking about today's tech "But surely, there must be a way to use stencil buffers or something like it for collision detection!". Unfortunately, I don't have a lot of time to spare for game dev experiments and my limited research efforts have resulted in "Nope, not possible [possibly as in 'not feasible']" so far.

  • @ripoutyourprejudice
    @ripoutyourprejudice 6 років тому

    This was a brilliant and insightful video.

  • @sadcrowcaws
    @sadcrowcaws 6 років тому

    These videos make the perfect companion to my morning coffee, love it!

  • @mykel723
    @mykel723 6 років тому

    It's cool learning about just how much hardware affected the development of games, and how a clever programmer can take advantage of various system resources to make things run that you wouldn't expect would be able to.

  • @Thevaporwaveraver
    @Thevaporwaveraver 6 років тому +1

    thank you for the regular uploads ! :)

  • @youplaboum
    @youplaboum 6 років тому +8

    Hi Jon. As a European dev, do you have any insight you could share about the challenges brought by systems being 50Hz/60Hz and the differences in aspect ratio? For example, the port of this game on the Megadrive (The legend of Galahad) has the same code on both the EU and NA cartridges. Usually this means that the game was designed to be played at 60Hz and the EU release was simply not optimised. However, in Galahad the Psygnosis logo circles are drawn correctly in 50Hz mode, as is the crystal ball in the level briefs. But while the the music is adjusted to play at the correct tempo, the gameplay speed is different between 50/60Hz, and the increase in vertical resolution isn't used. So what was meant? Faster taller 60Hz or slower fatter 50Hz?

    • @KuraIthys
      @KuraIthys 6 років тому +3

      Now that's an interesting question.
      The whole conversion stuff is such a mess, even 20 years later it still gives me headaches working with retro systems.
      (though in fact the biggest single headache is you can often write code on a PAL machine that works fine but is impossible to run properly on an NTSC machine to the point that you basically have to start over. The reverse is almost never true, but you do get that slowdown and other issues.)
      I could be wrong, but intuitively I'd assume European developers are creating PAL games first, while US and Japanese devs are creating NTSC games first.
      The reasons for why that is should be kinda obvious.
      Keep in mind in the 80's working with the opposite system to your region would mean having a TV or monitor that could support that as well as the other region's hardware.
      Not actually a trivial thing to arrange. - imports would be expensive.
      Psygnosis is a European developer/publisher, so you can probably assume the logo is correct on PAL machines because it was designed for PAL machines, NOT NTSC ones.
      However if you made the game with an international audience in mind you'd probably avoid creating it in a way that outright wouldn't run on an NTSC machine, which is what would happen quite easily if you started using PAL specific features too much.
      (Long story short, due to a design quirk PAL machines are usually vastly more capable for many tasks than their NTSC counterparts. The reasons for this are a total accident, but it does have serious consequences if a program has to run on both.)

    • @flatfingertuning727
      @flatfingertuning727 4 роки тому

      @@KuraIthys From what I understand, many older black and white sets could be made to show either 50Hz or 60Hz video by turning the vertical-hold knob; some might require a resistor change if the knob's range wasn't sufficient, but given that many sets used capacitors with +/-20% tolerance, the easiest way to make a 60Hz set that would be guaranteed usable would be to design it so that if all parts are in the middle of their ranges, the vertical hold knob could adjust vertical refresh rate from e.g. 45Hz to 75Hz. Even if component variations made the refresh rate 20% higher or lower than targeted, shifting the knob's range from 58Hz to 88Hz, or from 32Hz to 62Hz, would make the set would be usable. If components are near center, the range may extend down to 50Hz without any modifications; at worst, one may need to swap out a resistor in a way which would still leave the set usable for both refresh rates.

  • @DrTexx
    @DrTexx 6 років тому

    So awesome, your channel is one of my favourites 😃

  • @brynshannon6692
    @brynshannon6692 6 років тому +9

    Yunno, I think I enjoy learning about how older games on older systems were made because the same kind of ingenuity comes into play when I'm optimising my builds on Armored Core games. Well, not exactly the same, but clever tricks and work-arounds abound in both situations.

  • @BluecoreG
    @BluecoreG 6 років тому +35

    Pixel Perfect, my worst nightmare.

    • @akpokemon
      @akpokemon 6 років тому +3

      speed running?

    • @stephanemorel130
      @stephanemorel130 6 років тому +13

      He's talking about a mix between the movies Pixels and Pitch Perfect

    • @BluecoreG
      @BluecoreG 6 років тому +18

      I'm talking about the collision system

    • @gimmedataids
      @gimmedataids 6 років тому +7

      @@BluecoreG Ahhh. I see. You're referring to the Faith No More song "Collision" being covered by the band System of Down. I have to agree, that would be terrible.

  • @RaymuHakurei
    @RaymuHakurei 6 років тому +13

    Always enjoy these. Thanks for making them. on a side note, have you any plans on continuing those Genesis coding lesson videos further?

  • @EmanuelFrias
    @EmanuelFrias 6 років тому

    Great video as always! Thanks for sharing some good knowledge with us! Take care

  • @thepirategamerboy12
    @thepirategamerboy12 6 років тому

    Somewhat off-topic, but I just wanted to say that I think it's really awesome you included twin fire buttons support. Such a nice thing to have on an Amiga game.

  • @lahma69
    @lahma69 4 роки тому

    A very clever and elegant solution! There is nothing more satisfying than figuring out how to accomplish a task such as this in such an efficient manner requiring very little overhead or wasted CPU cycles. Obviously though, it takes an intelligent individual to come up with these types of clever tricks otherwise (most likely) most games would have been utilizing the same workarounds.

  • @KuraIthys
    @KuraIthys 6 років тому +3

    Huh. I know about that feature on a lot of older systems, but I personally never really understood what it gets you that's worth bothering with.
    Interesting solution, certainly.
    Probably my lack of appreciation for it stems from learning to code on PC which lacks any such feature, (and since we're talking pentium 2/3 era stuff checking bounding boxes for a few dozen objects is kinda trivial).
    Also for the retro hardware I work with...
    SNES has no hardware collision support.
    And the Atari 800XL...
    Well it does, but it does collisions based on which background/sprite palette pair is involved...
    Probably still has some utility I guess.
    Pixel perfect collision isn't always desirable of course, so it does require caution.
    Part of what rendered E.T. on the 2600 so broken was the pixel perfect collision between the player sprite and the pits in the game, which had an effect which was counter-intuitive.
    Then again that kind of orthogonal top-down perspective actually calls for ignoring collisions with the ground and walls for most of the sprite;
    Only the base of the sprite should collide with ground based obstacles.
    (yet the whole sprite should collide with enemies).
    Collision detection is such an overlooked topic...

  • @tgrush1253
    @tgrush1253 4 роки тому +2

    Minecraft Block collision:
    I'm 4 parallel universe ahead of you

  • @enigma776
    @enigma776 6 років тому +32

    So why was the name of the game changed to The Legend of Galahad on the Mega Drive?

    • @Unplanted
      @Unplanted 6 років тому +6

      The port was so different, I assume they just went with a new name to honor the differences and work they made.

    • @enigma776
      @enigma776 6 років тому

      Ulmo need to play the Amiga version then

    • @GameHut
      @GameHut  6 років тому +38

      EA thought it would be more successful in the US being based on Arthurian legend rather than obscure Greek/Japanese influence I guess. It was their call.

    • @enigma776
      @enigma776 6 років тому +3

      Well after owning the Mega Drive version and now spending an evening with the Amiga game, I got to say I prefer the Amiga version, even though I can only select music or SFX. Just something more responsive in the Amiga version.

    • @bangerbangerbro
      @bangerbangerbro 6 років тому +1

      GameHut I didn't realise that the name "Leander" was anything to do with any mythology

  • @ArtificialDjDAGX
    @ArtificialDjDAGX 6 років тому +4

    Is there a way to perform this collision detection today, but without the box checking, so that we can be assured everything will be pixel perfect without any situational flaws?

  • @sauzeefy
    @sauzeefy 6 років тому +8

    Good Lord, this is insane! I'm so impressed!

  • @retrofraction
    @retrofraction 6 років тому

    Leander had larger sprites than most games at the time, was really impressed with it. Makes sense since you were able to optimize it better.

  • @faisalwho
    @faisalwho 4 роки тому

    In 2003 I developed a 2d game engine for my game programming class where I touted pixel perfect collision detection. The idea was while the GPU rendered the sprites on the screen using directx, I software rasterized all the objects/level into an 8 bit buffer, where each object had an 8 bit value. When the player shot a bullet (hitscan), I bresenham line traced the path through the rasterized software buffer, and when I read a pixel, the value of the pixel would identify the collidable object for me.
    Though I touted "pixel perfect" collision detection, in order to minimize fillrate, I actually blitted the 8bit masks at half resolution (so a 128x128 Sprite had a 64x64 byte mask blitted to the software buffer)

  • @MrVolksbeetle
    @MrVolksbeetle 4 роки тому

    Man, that was fascinating. I genuinely wish I knew more about programming...

  • @TheBcoolGuy
    @TheBcoolGuy 6 років тому

    Woah. I think we take modern collision for granted. Thanks for yet another intriguing look into a veteran programmer's masterpieces!

  • @blackattack1840
    @blackattack1840 6 років тому

    this channel is a game programming goldmine 😍

  • @namakudamono
    @namakudamono 6 років тому +2

    Many thanks for this fascinating explanation Jon!
    Leander was an absolutely beautiful game back in the day, and it still holds up incredibly well today - a fantastic achievement given the modest hardware of the time. I’m curious as to whether there are any changes you would make to the game today? Perhaps there features you would have liked to have implemented, but simply ran out of time, or memory? I really appreciate watching your videos, but those featuring Amiga titles are the most enjoyable, as it is the machine I grew up with. Thanks again, keep up the great work!

  • @Xalusc
    @Xalusc 6 років тому

    Hell yes, I love Leander so much
    Thanks, Jon!

  • @Klausterfull
    @Klausterfull 6 років тому +2

    Hey Jon, great explanation! Is there a possibility you make a video series commenting the Sonic 3D Blast source code? It will be very interesting for all your programmers subscribers :)

  • @therealseanw.stewart2071
    @therealseanw.stewart2071 6 років тому +12

    I really like your voice. Friendly and pleasant. I like British accents too. :3

    • @Maffoo
      @Maffoo 6 років тому

      All British accents? How about Glaswegian neds? Or scousers? Teeside? Valleys welsh. Ulster northern Irish?

    • @Retrobution
      @Retrobution 6 років тому +3

      Would be funny to have a very agressive and authentic sounding scottish accent narrate one of these videos lol

    • @pumpkin6429
      @pumpkin6429 5 років тому +1

      Maffoo It's been established that when people say British accents, they usually mean English. 👍

  • @novafawks
    @novafawks 6 років тому

    Wow, very informative! This helps me a lot, as a beginner programmer

  • @104d_3rr0r_vince
    @104d_3rr0r_vince 6 років тому +20

    I wish you made a new Amiga game.

  • @AdamvanAlderwerelt
    @AdamvanAlderwerelt 6 років тому

    I don't know a darn thing about coding, but I love your videos anyway. Keep up the good work!

  • @almaelma11
    @almaelma11 6 років тому

    Loved this. Keep up the great videos!

  • @sablesanctum
    @sablesanctum 6 років тому

    You made one of my favorite games of all time? I salute you, sir!

  • @VenusHeadTrap2
    @VenusHeadTrap2 4 роки тому

    Sometimes these secrets amaze me so much that I think you were born to code video games

  • @Tinfoiltomcat
    @Tinfoiltomcat 6 років тому

    This is my favorite youtube channel

  • @gfdgdfgdfgdfggfdgdfgdfgdfg9709
    @gfdgdfgdfgdfggfdgdfgdfgdfg9709 4 роки тому

    after having programmed many games, distance is the best collision detection. Because it is circular. It's perfect and fast. The problem with boxes is you can't rotate them well and they are unprecise compared to the entity. For my fighting game and space ship shooter I used dist (circles), because even for something long straight like a laser I just place distance tests along the line. the advantage over line colision is that it works 100% the time. With line colision detection I had the problem of lines going through other lines sometimes. I guess rounding errors. Anyway, the other advantage of distance colision over other colisions is, that you have different colision zones for different effects.
    Pretty cool video. Amiga coders are the best. Also best artists and music.

  • @xXYannuschXx
    @xXYannuschXx 6 років тому

    It continously amazes me how much work went into the programming of such games at the time to solve complex problems and make the game as good as possible on the hardware, while today we have Ubisoft struggling to render mirrrors...

  • @fluffycritter
    @fluffycritter 6 років тому

    It's worth noting that the VIC-II chip in the Commodore 64 would set a sprite-to-sprite and sprite-to-background collision mask as part of its regular rasterization process, and so that system would give pixel-perfect collision for free (with one frame of latency).
    There was also a game development library for Turbo Pascal called AniVGA which gave a pretty close approximation to pixel-perfect collision, where it would preprocess sprites with both horizontal and vertical span information and would do the collision based on those span overlaps. There were plenty of situations where this would generate a false positive but they almost never came up in actual gameplay (and was still better than box-to-box).

  • @syrus3k
    @syrus3k 4 роки тому

    Leander.. this game is forever in my memory.. mostly for the incredible music.

  • @antjarvis
    @antjarvis 6 років тому

    Leander was my favourite game, still have it! Thanks Jon :O)

  • @Possi_ball
    @Possi_ball 6 років тому

    You have done Leander too?!?!? I accidentally subscribed to the channel of a legendary pioneer!

  • @Mviews-hb4ib
    @Mviews-hb4ib 2 роки тому

    I remember years back on the amiga with Amos I found a way to just add 1- 4 points on screen I'd check during a swipe frame. It worked really well if you knew what to check for :) it was so fast .. the character even had a point so if an enemy walked into the end of your weapon then they got slight damage

  • @anactualmotherbear
    @anactualmotherbear 6 років тому

    man every time you talk about a trick you used it is like "this, but, fortunately, but, fortunately, but, fortunately."
    As someone who coded on 80s hardware in the 90s this series is fascinating.

  • @PhantomHarlock78
    @PhantomHarlock78 6 років тому

    This remind that in Racing the Beam they talk how the sprite collision in Atari 2600 was detected by hardware, what make 2600 games very precise.

  • @peterjohnson9438
    @peterjohnson9438 6 років тому +1

    These days, you usually use a three-prong approach to collisions:
    First, get a rough candidate set using something like an octree. Then, do a coarse box check pass. Then, do a by-polygon collision mesh test.
    I wonder if this "global exact first" type of approach could still be used somehow?

  • @IuriFiedoruk
    @IuriFiedoruk 6 років тому

    Nice. Atari 2600 had very similar features, as pixel-perfect collision detection and code running for each line drawn on the tv screen.

  • @McMacMastaMan
    @McMacMastaMan 6 років тому +1

    Thank you very much for your informative video. I feel like i understand the topic at least a bit compared to zero ideas beforehand.
    The only thing i have to critique is the intro music. FOR THE LOVE OF GOD ALLMIGHTY, make it so it matches the volume of your speak in the video!

  • @brynshannon6692
    @brynshannon6692 6 років тому +12

    Oh, that's a question/idea. Have you or are you planning on doing an episode with one or more of your former coworkers from Traveller's Tales?