Today, I learned that Chrono Trigger's title screen's pendulum was NOT an Object, and that Bowser was part of the background the whole time. Fascinating stuff! :D
Basically on the SNES if something rotates or scales very smoothly with that certain look to it, it's probably Mode 7. ( Speaking of Bowser, it looks like Nintendo was just showing off every time Bowser would fly away or towards the screen. *Look at our cool mode 7!* )
Mode 7 replaces the background layer, which is obvious in several stages and boss fights in Super Castlevania IV (i.e. swinging chandeliers, rock golem boss). Early SNES games pushed Mode 7 rather heavily. Some games used it well, others just came off as gaudy. D-Force, a helicopter shoot-em-up by Asmik Ace, used Mode 7 very heavily, and justified its usage by allowing the player to change altitude, effectively zooming the background in and out. It kinda looked cool, but ended up feeling like a gimmick.
One thing to keep in mind, is when you typically see something scaling and/or rotating, and it looks like the background is just a very basic solid color (usually black), or gradient, it's more than likely having whatever is being scaled or rotated as a background and using Mode 7 to manipulate it. There is some very ugly examples of this too, like Dragon's Lair's boss fights having this really terrible looking blue and red gradient and using the background for the boss. If you see something scaling/rotating, but there is still a background (like Megaman X2 Crystal Snail boss, or many things in Yoshi's Island), it's using an expansion chip to do that instead (CX4 chip for Megaman X2, Super FX2 for Yoshi's Island).
@@XBladenoJutsu Not always entirely true. There are games that have relatively elaborate backgrounds combined with a scaling 'sprite', there can be a lot of stuff going on sometimes. But that actually shouldn't be a huge surprise depending on the situation; (mickey's magical quest has some relatively elaborate examples of such things going After all, the SNES can draw 128 sprites, and if you use 64x64 sprites you can fill the entire screen using 16 such sprites. (Granted you only have enough unique sprite tiles on one frame to make 4 unique 64x64 sprites.) Or, 64 sprites that are 32x32 would also accomplish the same trick. Obviously this is a bad idea, because you'd have no leeway for drawing anything else. like, say, the player's sprites. But it's definitely a thing that could be done. - you've then got sprites composing a background, and a mode 7 background acting as a 'sprite'. Actually with split-screen effects you can do even weirder stuff. HDMA can mostly automate a lot of these effects too. For instance, a large proportion of games demonstrate a midscreen graphics mode switch when using mode 7. The most dramatic example I know of is in Contra 3... But pretty much any mode 7 racing game does it too. In this case your 'mode 7' effect is restricted in terms of which part of the screen it can occupy... But it's pretty flexible, especially if you combine it with that 'sprites as background' concept - which gets easier when you have less of the screen to cover. For that matter, you can have multiple, independent mode 7 effects going at once if you feel inclined to. again, this depends on midscreen register changes, and thus objects cannot cross the boundary lines of where you performed such changes... There are plenty of weird ways you can disguise the limitations of mode 7... Many of which have been used in a bunch of different games...
Yeah. I actually HATED that Linear Transformation because professor gave totally no idea about how 4 numbers in big bracket made plane something.... very strange happen. And finally I watch the best explanation I ever seen! Professors must use this video for linear algebra class. shit i was born too early
I hate to have to wait again for another part of background modus in this case part 2 of mode 7. Why becsuse the last part became very interesting, i gonna die from all the occupied waiting and waiting,pfff.
Rule of thumb for SNES graphics: If something has that odd scrolly/wavy/blocky look, it's Mode 7. I could tell what was Mode 7 in games, I just had no idea it was basically a static image with a camera doing all of the action.
@@satsun Replying to a two years old comment, but what's shown here is simply a visualization. It could also be visualized via the background moving. One visualization isn't necessarily more accurate than the other. As for the what's going on inside the hardware, X' and Y' are calculated based on X and Y for each pixel, and then the expected color at X' and Y' is looked up from the tilemap, which ultimately goes back to actual tiles and palettes. Overall, it's an arithmetic calculation, not a geometric one. All games are like this. All geometric calculations are made by first converting them to arithmetic equivalents.
....this is the first practical use of the culmination of everything I've been learning in classes over years. I'm actually interested in graphics now, and at a crossroads where I can pursue that. Thank you so much for these videos.
Oh I'm sure, this is just the first time I've gotten to see it in an applied context. Its like collecting jigsaw pieces and finally seeing a picture with them.
You might want to have a look at how graphics works in the 2d canvas javascript API too, it uses a lot of affine transformations as well, so there's a similar modern-day application for it there. So do regular 3D graphics, though of course those transformations aren't 2D like these ones, and some tricks get used to portray things with perspective since that transformation isn't affine.
It was nice to finally put my linear algebra skills actually to use! :P And wow I had no idea that the Chrono Trigger Pendulum swing was created through mode 7 transformations. I will never be able to unsee that.
Yea, there have been a few games that get around it. You can, for instance, set the out of bounds background bit to a sky color, then paint the area around bowser that same sky color. From there you can add some cloud sprites, and if you wanted, use mode 7 in priority mode so he can fly behind or in front of the clouds/player as you transform him. The end result is a fancy daytime battle. I could be wrong, but I think Dyna Blade used this trick in Kirby Super Star.
I find this extremely engrossing but I'm to stupid to understand all the information presented. Its important work though to preserve this information.
As a developer I really like your presentation of this information. If I didn't already have a hobby, making a homebrew game would have been a fun way to go.
Dynasty Lobster I think the entire SNES homebrew community pretty much resides in the "SNESDev" section of NESDev. One member did actually make a game engine for others to use, but I think it's pretty barebones currently.
Pretty good explanation. After studying the available documentation thoroughly, as well as remembering what I learnt a long time ago in relation to software 3d engines, I came to the conclusion that Mode 7 is the fuoundation of a hardware texture mapping routine. It has a few design quirks and limitations compared to an actual texture mapping implementation, but fundamentally it's basically the same thing. It maps a texture directly into a 4 sided polygon defined entirely in screen space. If you know how a texture mapper works you'd notice that a texture mapper is basically a generalisation of this exact thing... So... Yeah, SNES has hardware texture mapping, but no 3d geometry support. XD
Yes, 3D rendering a texture amounts to feeding a CRT raster with pixels from slanted lines on the texture. Also, the slanted lines are walked by repeatedly adding the line step instead of multiplying by the slope for each pixel. This simplicity is the reason raster rendering dominates, but modern rendering gets so much more hairy...
Not really, at least if I understand correctly. I'm fairly sure that there would be no way to input values for the different z-coordinates, in other words, while you could try to use perspective (X/Z)*FOV, it would look off, as the texture would be mapped in a 2d way, not a 3d one.
I think the most interesting part of the video was by far 15:50 onwards where you showed how it was applied on real games, but it was also the shortest part of the video. Are these visualizations too hard or time consuming to do? Could you do a video addendum showing more like these? I'd be extremely interested to see games like Mario Kart or F-Zero. Anyway, fantastic video as always!
When you said X naught and Y naught the first things that popped into my head were the X-Nauts from TTYD and Wynaut from Pokemon. Very interesting series. Lot of cool stuff. Probably not gonna remember any of it, but it's still really cool.
Oh my God, man, this is probably the best technical channel in the whole RUclips. I can not get over your knowledge AND they way you present it to us. I have no words, pure amazing!
Donald in The Magic Cap (ドナルドダックの魔法のぼうし (Donarudodakku no mahō no bōshi), Epoch) has a level with Mode 7 and in this level, Donald can be half in front and half behind the leaves, meaning the extended background must have been used.
Thanks for explaining the mystery and using familiar examples. I've been wanting to learn how mode 7 worked. I this would also be a good learning tool for math teachers. Kids don't give a crap about angles or graph formulas but get videogames involved and you got their attention.
@@CarbonRollerCaco Bold of Nintendo to reference the English name of a character that wouldn't be created for over 12 years, from a franchise that wouldn't exist for over 6, way back when they were developing the SNES in the late 80s.
This is so well-researched and edited! Amazing attention to detail. I do chiptunes with the SPC700 all the time, and I'd be happy to double-check your points when you get to that topic! Or, like, give auditory examples of how different things work, like the echo effect and loop points.
This video just helped me figure out how to find a point on a sprite after stretching and rotating it for a game I'm making. Thank you so much, it was giving me a headache for weeks.
Now THIS is one of your best videos! There was one of the background mode videos where you only gave a few examples, then went to talk about the modes, and left me very wanting with seeing no examples. This one is super thorough and easy to understand!
For the next video you cover on HDMA with Mode 7, I'd love to see a reference to Terranigma's underworld and overworld maps (concave and convex curvatures on either map respectively). Love this series of SNES videos mate!
one thing i've always wondered is how the neon night riders stage in TMNT4 manages to have what appears to be two parallax scaling and rotating mode 7 layers on top of each other, even though nintendo themselves claimed that this was impossible on the SNES and used that as the excuse for why we didn't get it in f-zero til the later GBA f-zero games.
Lars Amble Uh? But there is nothing that do mode 7 besides the track on this level. If you are talking about the enemies, they are just scalling animation frame by frame.
yeah, it appears as though there's the road you're traveling on and then the ground far below and beneath it scaling and rotating independently on another level than the road itself - basically what f-zero was supposed to look like since the tracks there were supposed to be elevated there too, but nintendo claimed they couldn't pull off two independently scaling and rotating layers. i've always felt like i'm the only one who's ever noticed this in TNMT4. heh
Also, just want to add something in I’ve heard of: The usage of Mode 7 during SMW’s final boss is why much of the HUD disappears, due to the mode’s background restrictions or something like that. That’s inspired certain other games to use the disappearance of the UI as something shocking, to make you focus on what’s happening rather than game elements; see TvTropes’ “Dramatic Disappearing Display”.
I have to say, I have seen stuff at school and never really understood the reason why until I saw your videos! I will watch all the others for sure! Thank you for sharing such awesome information. Also, your visual explanations are incredible! Thanks!
As a developer I find this really fascinating! It's unbelievable what past developers came up with to get their work done in terms of limitations. Really impressive. Also I love your videos! Subbed, liked and shared with all I know!
I won't lie, without the visual to reference and my FULL attention the way the function call works would have taken me forever to understand. This is fantastic work!
I've really enjoyed these videos. SNES was my first console and will always have a special place in my heart. Thanks for showing me all the cool things that they used to make the games I love!
This is such a great application of linear algebra - and so well-explained!! I did not expect to find this application when I clicked on the video. So worth my time!
The intuitive way you explain algebra reminds me of 3blue1brown videos. I actually think 3blue1brown would love to see this as a direct application of linear algebra
The last part was the best part, as it was more clearer to see how & what’s going on,i wish you also showed one of those koopa kids once they get defeated because they will then rotate. Also it would be cool if you could explain how some games do use sprite scaling VIA SOFTWARE rather then added hardware. But either way thanks for uploading this.
The math goes a bit fast, but that's not entirely a problem if one already understands the general concept of Matrix transformations. Seeing the final formulas makes for a handy reference if I wanted to manually implement such a thing. Also, your visual representations of each of the transforms was very helpful. I always had a hard time wrapping my head around how matrix skewing worked. I might have been more helpful to also manually show each pixel being copied and pasted so that people can see how the output image is formed. Your explanation did not visually make it clear that matrix transforms are applied one pixel at a time. And instead of saying "X-nauts and Y-nauts," I prefer to think of the process in terms of input pixels and output pixels, or input coordinates and output coordinates. So as you build the output left-to-right, top-to-bottom, line by line, the matrix transformation determines which pixel you're reading for each of those output pixels. I'm looking forward to your next video since I have attempted to re-create a mode-7 style effect before, but I couldn't figure out how to create convincing perspective with line-scrolling. It'll be interesting to see how that's calculated.
Awesome explanation. I don't really understand math that well but the visuals were so clean that I got it! Very amazing tech they were making due with back in the day. Great series!!
I find it funny how for older consoles, their highest end/most interesting features are only known by their technical names, and usually didnt get directly promoted. It gives them a unique charm, since their names are so authentic
This is all introduction level stuff compared to 3D graphics. At that point, literally everything is just a flood of linear algebra. (Though, tbh, though it looks really bad at first, it's not actually that bad. When you try to track all the numbers individually, it can get crazy to think about, but there's actually a fair number of nice patterns involved in much of the math in computer graphics and once you get the hang of them it isn't actually that bad.)
Humbird00 Unfortunately older RPG Makers didn’t have hardware acceleration for graphics. I bet the sky would be the limit if we managed to leverage the graphics hardware in it.
I've been tinkering with Adobe Animate and the CreateJS libraries at work lately. I'd been struggling to understand the concept of a transformation matrix for the longest time (since you can use them in CJS) and this really helped. Totally didn't expect to learn something useful to my everyday life from this video.
I use After Effects. And don't worry, automated most of it with scripts--I just have to input the parameters themselves, and it will draw it correctly for me!
Very neat video of Mode 7! But one aspect you did not cover was how stage 4-3 of Super Castlevania 4 happens. The one with the rotating tunnel you walk through. Where the top and bottom are stretched out but the center is more squished. Based on our examples, I cannot figure out how to equate this unless there are more equations of Mode 7 that just did not get covered in this video. Other than that, GREAT JOB!
Most mode 7 effects also use HDMA to create non-linear transformations. I only showed pure mode 7 effects in this video, since HDMA will be introduced in part 7.
BaddMatt HDMA basically lets you write to a small group of PPU registers before each horizontal line of pixels is drawn. If you change say the Hscroll stuff, using a table of different values, you can imagine skewing the original image. Or, combine line scrolling and stretching, to draw things like roads that appear to have perspective, and bend around the corners. ;) (probably not exactly how it works, but you get the idea. lol) A lot of effects are done that way, and many of them don't even use Mode 7 specifically. Can't wait for the next vid, and I'll have to watch this a few times just to absorb it. :p
Retro Game Mechanics Explained I was working on a SNES FPGA core last year, and managed to get most of CPU, and basic DMA stuff working. I then hooked up the trusty DE1 dev board to a real SNES motherboard (with its CPU and WRAM removed), so I could send commands to the PPU and APU. It worked well enough to actually run Super Mario World, and play through a few levels, but it wasn't very reliable, due to marginal timings between the boards... drive.google.com/file/d/0B1grqFdAErsraThVS0tRSkhtSjA/view?usp=drivesdk
Yeah, I recently learned that all those old racing games were actually using a line-scrolling trick to create their twisting "3D" roads. The actual 3D is just a pre-drawn image and the line-scrolling just pushes different parts of the image left or right. It's actually astoundingly simple once you realize what's going on. Now... when they add "vertical hills" on the other hand... I have a little trouble fully grasping how that's done. But I guess it's a matter of shifting some of the pixels of the pre-drawn image up or down. The trick seems to be figuring out which line of pixels to shift upward, and when to do it.
Are you going to do a video explaining the glitched 1-UP sound you use for your intro? I've heard of the glitch before, but I've always wondered how it works.
I think I recall it being two different sound effects writing to the same address, causing it to load the mushroom sound in reverse followed by the 1UP sound, or something.
Good to see there's no shortage of X-Naut and Wynaut jokes in the comments. Makes me wonder if X nought and Y nought were the inspirations behind those names. (Woudln't be unheard of from Nintendo. After all, the hexadecimal color code #00CC00 got a nod in Twilight Princess.)
I have another point of curiosity on SNES background stuff: In Chrono Trigger, just after you defeat Magus for the first time (in his lair, when he says he only summoned Lavos but didn't create it), there's a scene with a giant time gate where the background appears to split and one of the layers is rotating around in a mosaic effect. I'm curious to know how this particular effect was done. I can easily make out that there are three or four active layers here: One for the static Magus Lair background, another for the time gate (unless that's done with objects), another for the border around the time gate (I know that's a BG layer, heavily masked), and one more for the warping copy of the background. That layer is using both transparency and the mosaic effect, that much I can tell, but it also appears to spin around and zoom in and out, which looks like a Mode 7 effect. Since Mode 7 takes up all four layers of space, or can only be displayed with a very limited second layer, obviously this scene couldn't be using Mode 7. Any insight on what that "spin" is? Thanks. :)
One of the best visual presentations of affine transformations I have seen so far! As usual, both with SNES and GBA, scaling the map makes it smaller instead of bigger, which is an inverse affine transformation (very expensive to calculate). And it is quite expensive to scale using (1.0 / scale) on both hardware platforms. I had hoped you would bring that up in the video, and how some games get around this. Ah well...
Second-Generation Tuxedon Thanks for the reply! I kinda understand what you're saying! Can't wait for your video on HDMA! Edit: so could 4 player split screen be theoretically possible, but be limited by the CPU?
Chris Kurz If I'm not mistaken, every line you'd want to rewrite any of the Mode 7 parameters, the CPU would be spending 100% of its time waiting for when to write (when the video hardware reaches a certain horizontal position). Full screen 4 player would leave only vblank, which you'd spend updloading tile data, so you'd have absolutely no CPU time. I wonder if you could get by with a coprocessor doing all the game logic though.
Drew Sebastino The SNES already has a few co-proccessor chips built for it (CX-4, SA-1, the SuperFX family, not to mention the fan-built one used in the SD2SNES flashcart), so if someone were to convert Mario Kart's Mode7 code to one of those chips, 4-player splitscreen on the game would be possible :) You'd just have to code support for the Multitap as well, but I think that's pretty easy!
Zillion Taborda The SA-1 is actually just an overclocked SNES processor if I'm not mistaken, so that could be used. Converting SMK to be 4 player would be far from trivial though. A lot of the code will run natively on the SA-1, but you still need to modify the code to use a coprocessor. Then, you'd need to modify the game logic for using 4 viewports, with each one being only half the width of the normal game. (Of course, there's the CPU side writing to the Mode 7 registers.) Making the game use a multitap shouldn't be difficult though.
@@drewsebastino2889 Cant you add another coprocessor on game carts themselves? I think SMB3 did this and thats why it has such good graphics for a NES game
Engineer 1: "It's so hard trying to set up Mode 7! I just can't get the math right..." Engineer 2: "Yo, why not?" Engineer 1: "Of course! You're brilliant!"
@@UChS4Dq15wHu8vkvWsaLzvPg It was four months ago that I made my comment, but I think it was a joke based on, for example, after 12:57, where Yo (Y, subscript zero), with the zero subscript pronounced as "nought", thus Y-naught. Hence, "Yo, why not?" Maybe not the most comprehensible joke...
This is almost exactly how window geometry is formatted in Xorg-you define the scale of the shape, and the location, using a set of numbers, and the same goes for transformation. The only thing it doesn't do is skew or rotate like a vector image.
8:42 - It shouldn't be necessary to do the linear algebra for every pixel on the screen. By calculating the points at the start and end of a scanline and using Bresenham's line algorithm in between, you would need very little calculation to find where to look up each pixel. All of it would be integer, with no multiplication or division.
I hope one day we can stop attributing mode 7 to every cool thing on the snes (ie throwing enemies at the screen in TMNT 4 or the vertical stage line scrolling effect in Axelay etc)
Today, I learned that Chrono Trigger's title screen's pendulum was NOT an Object, and that Bowser was part of the background the whole time.
Fascinating stuff! :D
Basically on the SNES if something rotates or scales very smoothly with that certain look to it, it's probably Mode 7.
( Speaking of Bowser, it looks like Nintendo was just showing off every time Bowser would fly away or towards the screen. *Look at our cool mode 7!* )
I know right!
Mode 7 replaces the background layer, which is obvious in several stages and boss fights in Super Castlevania IV (i.e. swinging chandeliers, rock golem boss). Early SNES games pushed Mode 7 rather heavily. Some games used it well, others just came off as gaudy.
D-Force, a helicopter shoot-em-up by Asmik Ace, used Mode 7 very heavily, and justified its usage by allowing the player to change altitude, effectively zooming the background in and out. It kinda looked cool, but ended up feeling like a gimmick.
One thing to keep in mind, is when you typically see something scaling and/or rotating, and it looks like the background is just a very basic solid color (usually black), or gradient, it's more than likely having whatever is being scaled or rotated as a background and using Mode 7 to manipulate it.
There is some very ugly examples of this too, like Dragon's Lair's boss fights having this really terrible looking blue and red gradient and using the background for the boss.
If you see something scaling/rotating, but there is still a background (like Megaman X2 Crystal Snail boss, or many things in Yoshi's Island), it's using an expansion chip to do that instead (CX4 chip for Megaman X2, Super FX2 for Yoshi's Island).
@@XBladenoJutsu Not always entirely true. There are games that have relatively elaborate backgrounds combined with a scaling 'sprite', there can be a lot of stuff going on sometimes.
But that actually shouldn't be a huge surprise depending on the situation;
(mickey's magical quest has some relatively elaborate examples of such things going
After all, the SNES can draw 128 sprites, and if you use 64x64 sprites you can fill the entire screen using 16 such sprites. (Granted you only have enough unique sprite tiles on one frame to make 4 unique 64x64 sprites.)
Or, 64 sprites that are 32x32 would also accomplish the same trick.
Obviously this is a bad idea, because you'd have no leeway for drawing anything else. like, say, the player's sprites.
But it's definitely a thing that could be done. - you've then got sprites composing a background, and a mode 7 background acting as a 'sprite'.
Actually with split-screen effects you can do even weirder stuff.
HDMA can mostly automate a lot of these effects too.
For instance, a large proportion of games demonstrate a midscreen graphics mode switch when using mode 7.
The most dramatic example I know of is in Contra 3...
But pretty much any mode 7 racing game does it too.
In this case your 'mode 7' effect is restricted in terms of which part of the screen it can occupy...
But it's pretty flexible, especially if you combine it with that 'sprites as background' concept - which gets easier when you have less of the screen to cover.
For that matter, you can have multiple, independent mode 7 effects going at once if you feel inclined to.
again, this depends on midscreen register changes, and thus objects cannot cross the boundary lines of where you performed such changes...
There are plenty of weird ways you can disguise the limitations of mode 7...
Many of which have been used in a bunch of different games...
You just tricked all SNES gamers into learning some linear algebra I'm sure they hated at university lol. Well done man!
Yeah. I actually HATED that Linear Transformation because professor gave totally no idea about how 4 numbers in big bracket made plane something.... very strange happen. And finally I watch the best explanation I ever seen! Professors must use this video for linear algebra class. shit i was born too early
same to me man :)
I hate to have to wait again for another part of background modus in this case part 2 of mode 7.
Why becsuse the last part became very interesting, i gonna die from all the occupied waiting and waiting,pfff.
Мандибрики і Цирупопики lol. So that is how we teach kids math.
Garage Loot the best way to do it, I'd say :)
The quality of these videos is absolutely insane.
That sums up my thoughts perfectly. I feel like I should've paid for this.
He's got a patreon, so you can pay for it.
www.patreon.com/rgmechex
I'm just sitting here wondering how the explanatory graphics were made...
I had no idea the pendulum in CT was a mode-7 background, this video just blew my mind.
Rule of thumb for SNES graphics: If something has that odd scrolly/wavy/blocky look, it's Mode 7. I could tell what was Mode 7 in games, I just had no idea it was basically a static image with a camera doing all of the action.
@@satsun Replying to a two years old comment, but what's shown here is simply a visualization. It could also be visualized via the background moving. One visualization isn't necessarily more accurate than the other.
As for the what's going on inside the hardware, X' and Y' are calculated based on X and Y for each pixel, and then the expected color at X' and Y' is looked up from the tilemap, which ultimately goes back to actual tiles and palettes. Overall, it's an arithmetic calculation, not a geometric one.
All games are like this. All geometric calculations are made by first converting them to arithmetic equivalents.
It's pretty obvious when you consider how large of a sprite it would've been just to be put onto a blank background
@@satsun _Doraemon 2_ uses HDMA for 3D effects.
....this is the first practical use of the culmination of everything I've been learning in classes over years. I'm actually interested in graphics now, and at a crossroads where I can pursue that. Thank you so much for these videos.
Sneakstir Linear algebra is extremely useful
Oh I'm sure, this is just the first time I've gotten to see it in an applied context. Its like collecting jigsaw pieces and finally seeing a picture with them.
You might want to have a look at how graphics works in the 2d canvas javascript API too, it uses a lot of affine transformations as well, so there's a similar modern-day application for it there. So do regular 3D graphics, though of course those transformations aren't 2D like these ones, and some tricks get used to portray things with perspective since that transformation isn't affine.
200th like :)
Brilliant visual communication as always!
Cyrule xd
>the pendulum never swinged at all
dam man
there is no pendulum.....
But in the end, the Pendulum refused to swing
and you're still hungry
*swung
"swangded"
It was nice to finally put my linear algebra skills actually to use! :P
And wow I had no idea that the Chrono Trigger Pendulum swing was created through mode 7 transformations. I will never be able to unsee that.
So that's why Bowser fight takes place at a dark bg with no detail?
Yes
i got the same thought.
It's probably why he looks so strange and miscoloured as well.
Yes, also like the stone golem boss in Castlevania IV
Yea, there have been a few games that get around it. You can, for instance, set the out of bounds background bit to a sky color, then paint the area around bowser that same sky color. From there you can add some cloud sprites, and if you wanted, use mode 7 in priority mode so he can fly behind or in front of the clouds/player as you transform him.
The end result is a fancy daytime battle. I could be wrong, but I think Dyna Blade used this trick in Kirby Super Star.
This is the best Mode 7 video ever created!
I find this extremely engrossing but I'm to stupid to understand all the information presented. Its important work though to preserve this information.
As a developer I really like your presentation of this information. If I didn't already have a hobby, making a homebrew game would have been a fun way to go.
I think it's time for two hobbies then.
Working on my own software project already
well, making an snes homebrew is POSSIBLE, but don't expect to get any help learning ASM, or any players, the homebrew community is small
Dynasty Lobster I think the entire SNES homebrew community pretty much resides in the "SNESDev" section of NESDev. One member did actually make a game engine for others to use, but I think it's pretty barebones currently.
Pretty good explanation.
After studying the available documentation thoroughly, as well as remembering what I learnt a long time ago in relation to software 3d engines, I came to the conclusion that Mode 7 is the fuoundation of a hardware texture mapping routine.
It has a few design quirks and limitations compared to an actual texture mapping implementation, but fundamentally it's basically the same thing.
It maps a texture directly into a 4 sided polygon defined entirely in screen space.
If you know how a texture mapper works you'd notice that a texture mapper is basically a generalisation of this exact thing...
So... Yeah, SNES has hardware texture mapping, but no 3d geometry support. XD
Yes, 3D rendering a texture amounts to feeding a CRT raster with pixels from slanted lines on the texture.
Also, the slanted lines are walked by repeatedly adding the line step instead of multiplying by the slope for each pixel.
This simplicity is the reason raster rendering dominates, but modern rendering gets so much more hairy...
Not really, at least if I understand correctly. I'm fairly sure that there would be no way to input values for the different z-coordinates, in other words, while you could try to use perspective (X/Z)*FOV, it would look off, as the texture would be mapped in a 2d way, not a 3d one.
I think the most interesting part of the video was by far 15:50 onwards where you showed how it was applied on real games, but it was also the shortest part of the video.
Are these visualizations too hard or time consuming to do? Could you do a video addendum showing more like these? I'd be extremely interested to see games like Mario Kart or F-Zero.
Anyway, fantastic video as always!
Hopefully you've checked back since, since now he does quite a bit
When you said X naught and Y naught the first things that popped into my head were the X-Nauts from TTYD and Wynaut from Pokemon.
Very interesting series. Lot of cool stuff. Probably not gonna remember any of it, but it's still really cool.
Oh my God, man, this is probably the best technical channel in the whole RUclips. I can not get over your knowledge AND they way you present it to us. I have no words, pure amazing!
When I think of Mode 7, games like Mario Kart and F-Zero come to mind, as well as any Squaresoft game that has that implemented for the Airship...
Speedrunner: it's called a subpixel
Programmer: it's called a fixed-point number
Subpixel
s are just one use of fixed-point numbers.
Thesis: It's a subpixel
Antithesis: It's a fixed-point number
Synthesis: A subpixel is a fixed-point number.
Speedrunners 🤝 Programmers
I love your videos. So well researched, well spoken, and well polished. Thank you for such hard work
Yes and welcome back to finishing up this series, I was waiting for the day I could binge watch SNES hardware videos once more.
Question, tho. Where did he learn all this stuff.
What? I want to see more about others.
Donald in The Magic Cap (ドナルドダックの魔法のぼうし (Donarudodakku no mahō no bōshi), Epoch) has a level with Mode 7 and in this level, Donald can be half in front and half behind the leaves, meaning the extended background must have been used.
Also worth pointing out, despite what people think, Axelay does not use Mode 7 for its screen 'melting' effect. That is done by line scrolling.
XBladenoJutsu Yesss!! Mode 7 was just used in this game for cutcenes and the giant robot boss in stage 2 (a horizontal level).
XBladenoJutsu ~ oh really? ~ well.... that blew my mind.
link? I'm not familiar with Axelay
ThePharphis - lol your on RUclips. Just search for it.
Thanks for explaining the mystery and using familiar examples. I've been wanting to learn how mode 7 worked.
I this would also be a good learning tool for math teachers. Kids don't give a crap about angles or graph formulas but get videogames involved and you got their attention.
I really want to make a "why not?" joke, but all that math seems to have melted my brain and I can't come up with anything.
Wynaut?
@@CarbonRollerCaco Bold of Nintendo to reference the English name of a character that wouldn't be created for over 12 years, from a franchise that wouldn't exist for over 6, way back when they were developing the SNES in the late 80s.
This is so well-researched and edited! Amazing attention to detail.
I do chiptunes with the SPC700 all the time, and I'd be happy to double-check your points when you get to that topic!
Or, like, give auditory examples of how different things work, like the echo effect and loop points.
There is a podcast on Soundcloud that covered this in an episode: soundcloud.com/retrogameaudio/the-snes
The SPC700 doesn't actually generate any of the sound, it just sends commands to the DSP that does.
Drew Sebastino but the spc700 is the CPU, ram and DSP all together
intron9 It's part of the Nintendo S-SMP that contains all of those things; the SPC 700 core itself does not.
If i had this video for my Linear Algebra class :(
This video just helped me figure out how to find a point on a sprite after stretching and rotating it for a game I'm making. Thank you so much, it was giving me a headache for weeks.
Now THIS is one of your best videos! There was one of the background mode videos where you only gave a few examples, then went to talk about the modes, and left me very wanting with seeing no examples.
This one is super thorough and easy to understand!
Dude, I don't know how you make all those animations but it's really awesome and they really help understand. Keep up the amazing work!
This is so well made and designed. I'm always so impressed by your videos! This is such a simply and easy to digest explanation. Thank you so much!
For the next video you cover on HDMA with Mode 7, I'd love to see a reference to Terranigma's underworld and overworld maps (concave and convex curvatures on either map respectively).
Love this series of SNES videos mate!
I can agree with this. Terranigma's underworld had that curvature, and it looked like it was rendering an additional surface as well.
subbed...in an instant another good youtube channel that is interesting.
good voice, good visual and very well explained.
P.S. there is a series of gameboy hardware videos that wasn't continued any chance you could make something like that?
one thing i've always wondered is how the neon night riders stage in TMNT4 manages to have what appears to be two parallax scaling and rotating mode 7 layers on top of each other, even though nintendo themselves claimed that this was impossible on the SNES and used that as the excuse for why we didn't get it in f-zero til the later GBA f-zero games.
Lars Amble Uh? But there is nothing that do mode 7 besides the track on this level.
If you are talking about the enemies, they are just scalling animation frame by frame.
Oh i get it! You are talking about the texture out of the road that seems to move differently, right?
This is pure tile and color animation.
yeah, it appears as though there's the road you're traveling on and then the ground far below and beneath it scaling and rotating independently on another level than the road itself - basically what f-zero was supposed to look like since the tracks there were supposed to be elevated there too, but nintendo claimed they couldn't pull off two independently scaling and rotating layers. i've always felt like i'm the only one who's ever noticed this in TNMT4. heh
Animation is fantastic in these videos. Real movie magic, as I have no idea how you compiled some of these visualizations - great job!
Do you have a paypal address for one-off donations?
Yes, you can find it at the bottom of my web page at dotsarecool.com/rgme.
How do you like this comment more than once? Do I have to donate?
Donations are always optional, but it helps him get more stuff done :3
I've been SO looking forward to this one!
Also, just want to add something in I’ve heard of: The usage of Mode 7 during SMW’s final boss is why much of the HUD disappears, due to the mode’s background restrictions or something like that. That’s inspired certain other games to use the disappearance of the UI as something shocking, to make you focus on what’s happening rather than game elements; see TvTropes’ “Dramatic Disappearing Display”.
Amazing work in this video! I am blown away by your ability to explain and provide visuals for all these concepts.
I love how you can control the mode 7 Logo, in the 7Up cool spot game!
I have to say, I have seen stuff at school and never really understood the reason why until I saw your videos! I will watch all the others for sure! Thank you for sharing such awesome information. Also, your visual explanations are incredible! Thanks!
Look at all this matrix multiplication and trigonometry and hex. And I still understand it. Are you a wizard?
The production values of these is great
27 years waiting for this to happen, excellent job explaining mode 7!
As a developer I find this really fascinating! It's unbelievable what past developers came up with to get their work done in terms of limitations. Really impressive.
Also I love your videos! Subbed, liked and shared with all I know!
I won't lie, without the visual to reference and my FULL attention the way the function call works would have taken me forever to understand. This is fantastic work!
Dude, sick video. Thanks for making this.
So happy this was finally released!!
So excited to see this pop up. I was worried you wouldn't continue the series!
I've really enjoyed these videos. SNES was my first console and will always have a special place in my heart. Thanks for showing me all the cool things that they used to make the games I love!
This is such a great application of linear algebra - and so well-explained!! I did not expect to find this application when I clicked on the video. So worth my time!
This is by far the most educational, smartest gaming channel on RUclips. Awesome work!
The intuitive way you explain algebra reminds me of 3blue1brown videos. I actually think 3blue1brown would love to see this as a direct application of linear algebra
The last part was the best part, as it was more clearer to see how & what’s going on,i wish you also showed one of those koopa kids once they get defeated because they will then rotate.
Also it would be cool if you could explain how some games do use sprite scaling VIA SOFTWARE rather then added hardware.
But either way thanks for uploading this.
Ah, taking me back to my diff. eq. and linear algebra days in college. Thanks for this refresher and nice, practical application of those concepts.
The math goes a bit fast, but that's not entirely a problem if one already understands the general concept of Matrix transformations. Seeing the final formulas makes for a handy reference if I wanted to manually implement such a thing.
Also, your visual representations of each of the transforms was very helpful. I always had a hard time wrapping my head around how matrix skewing worked.
I might have been more helpful to also manually show each pixel being copied and pasted so that people can see how the output image is formed. Your explanation did not visually make it clear that matrix transforms are applied one pixel at a time.
And instead of saying "X-nauts and Y-nauts," I prefer to think of the process in terms of input pixels and output pixels, or input coordinates and output coordinates. So as you build the output left-to-right, top-to-bottom, line by line, the matrix transformation determines which pixel you're reading for each of those output pixels.
I'm looking forward to your next video since I have attempted to re-create a mode-7 style effect before, but I couldn't figure out how to create convincing perspective with line-scrolling. It'll be interesting to see how that's calculated.
Awesome explanation. I don't really understand math that well but the visuals were so clean that I got it! Very amazing tech they were making due with back in the day. Great series!!
the Chrono Trigger pendulum was pretty mind-blowing, and i will never unsee it
really good stuff
Glad i'm taking trigonometry so i can understand this
Just wait until you get to college and take linear algebra / linear systems.
erica wait til its 20 years after you've left higher education and never used the maths you've learned and then try to keep up.
I find it funny how for older consoles, their highest end/most interesting features are only known by their technical names, and usually didnt get directly promoted. It gives them a unique charm, since their names are so authentic
I don’t understand half of what you say in your videos, but I still love them. Keep up the great work, dude!
Even though I don't understand half the things you talk about, it's really well put and you keep it interesting. Another good video, dude :)
All this math is why you don't have Pilotwings fan games.
Fans have already re-created the mode-7 effect for RPG Maker games. Don't underestimate them.
Pilotwings also uses an extra chip.
This is all introduction level stuff compared to 3D graphics. At that point, literally everything is just a flood of linear algebra.
(Though, tbh, though it looks really bad at first, it's not actually that bad. When you try to track all the numbers individually, it can get crazy to think about, but there's actually a fair number of nice patterns involved in much of the math in computer graphics and once you get the hang of them it isn't actually that bad.)
Humbird00 Unfortunately older RPG Makers didn’t have hardware acceleration for graphics. I bet the sky would be the limit if we managed to leverage the graphics hardware in it.
I've been tinkering with Adobe Animate and the CreateJS libraries at work lately. I'd been struggling to understand the concept of a transformation matrix for the longest time (since you can use them in CJS) and this really helped.
Totally didn't expect to learn something useful to my everyday life from this video.
Wikipedia have nice explanation too with matrix formulas
Ah, affine transformations! That explains the signature sort-of-in-perspective nature of the 3D effect!
I really hope you didn't actualyl hand-do all that rotation and stretchign stuff in the second window. What do you edit these vids with anyhow?
I use After Effects. And don't worry, automated most of it with scripts--I just have to input the parameters themselves, and it will draw it correctly for me!
Brilliant, and might I ask what type of easing you use? It's fairly pronounced (definitely more dramatic than quadratic).
YESSSSS. I've been waiting for a new video from you! And it's about one of the topics that has been more intriguing to me on the SNES!
Very neat video of Mode 7! But one aspect you did not cover was how stage 4-3 of Super Castlevania 4 happens. The one with the rotating tunnel you walk through. Where the top and bottom are stretched out but the center is more squished. Based on our examples, I cannot figure out how to equate this unless there are more equations of Mode 7 that just did not get covered in this video.
Other than that, GREAT JOB!
Most mode 7 effects also use HDMA to create non-linear transformations. I only showed pure mode 7 effects in this video, since HDMA will be introduced in part 7.
Awesome! Can't wait!
BaddMatt
HDMA basically lets you write to a small group of PPU registers before each horizontal line of pixels is drawn.
If you change say the Hscroll stuff, using a table of different values, you can imagine skewing the original image.
Or, combine line scrolling and stretching, to draw things like roads that appear to have perspective, and bend around the corners. ;)
(probably not exactly how it works, but you get the idea. lol)
A lot of effects are done that way, and many of them don't even use Mode 7 specifically.
Can't wait for the next vid, and I'll have to watch this a few times just to absorb it. :p
Retro Game Mechanics Explained
I was working on a SNES FPGA core last year, and managed to get most of CPU, and basic DMA stuff working.
I then hooked up the trusty DE1 dev board to a real SNES motherboard (with its CPU and WRAM removed), so I could send commands to the PPU and APU.
It worked well enough to actually run Super Mario World, and play through a few levels, but it wasn't very reliable, due to marginal timings between the boards...
drive.google.com/file/d/0B1grqFdAErsraThVS0tRSkhtSjA/view?usp=drivesdk
Yeah, I recently learned that all those old racing games were actually using a line-scrolling trick to create their twisting "3D" roads. The actual 3D is just a pre-drawn image and the line-scrolling just pushes different parts of the image left or right. It's actually astoundingly simple once you realize what's going on.
Now... when they add "vertical hills" on the other hand... I have a little trouble fully grasping how that's done. But I guess it's a matter of shifting some of the pixels of the pre-drawn image up or down. The trick seems to be figuring out which line of pixels to shift upward, and when to do it.
Are you going to do a video explaining the glitched 1-UP sound you use for your intro? I've heard of the glitch before, but I've always wondered how it works.
I think I recall it being two different sound effects writing to the same address, causing it to load the mushroom sound in reverse followed by the 1UP sound, or something.
Is there a video or article about this? It's the first I've even heard of this.
If you haven’t seen it yet, he uploaded a video on it yesterday.
Wonderfully clear handling of a difficult subject.
0:14 wow _unique_ *AND* _different_ !?
I love the SNES, but now I love it even more.
And you tricked me into watching linear algebra.
And apparently Bowser is a background element.
Huh, never realized that the CT intro was a background... Well I guess I makes sense! Thanks for the upload keep em coming!!!!
Man, this is the best one yet! Thanks for all your hard work and thorough explanation!
It'd be awesome if you could create a video just showing off various transformations from other games! That section left me hungry for more.
Nothing I can say that hasn't been said, but I'll still say thank you so much for making these videos, they're so damn good!
No dislikes so far (10 hours after upload), I'm definitely impressed. Great video as always, love the way you present the information.
FINALLY :D
Good to see there's no shortage of X-Naut and Wynaut jokes in the comments. Makes me wonder if X nought and Y nought were the inspirations behind those names. (Woudln't be unheard of from Nintendo. After all, the hexadecimal color code #00CC00 got a nod in Twilight Princess.)
I have another point of curiosity on SNES background stuff: In Chrono Trigger, just after you defeat Magus for the first time (in his lair, when he says he only summoned Lavos but didn't create it), there's a scene with a giant time gate where the background appears to split and one of the layers is rotating around in a mosaic effect.
I'm curious to know how this particular effect was done. I can easily make out that there are three or four active layers here: One for the static Magus Lair background, another for the time gate (unless that's done with objects), another for the border around the time gate (I know that's a BG layer, heavily masked), and one more for the warping copy of the background. That layer is using both transparency and the mosaic effect, that much I can tell, but it also appears to spin around and zoom in and out, which looks like a Mode 7 effect. Since Mode 7 takes up all four layers of space, or can only be displayed with a very limited second layer, obviously this scene couldn't be using Mode 7. Any insight on what that "spin" is?
Thanks. :)
Great video and amazing visuals!
One of the best visual presentations of affine transformations I have seen so far! As usual, both with SNES and GBA, scaling the map makes it smaller instead of bigger, which is an inverse affine transformation (very expensive to calculate). And it is quite expensive to scale using (1.0 / scale) on both hardware platforms. I had hoped you would bring that up in the video, and how some games get around this. Ah well...
0:45 The game shown as the example is Yoshi's Safari
3:00 The game shown is The Legend of Zelda: A Link To The Past
It's about time! 😁 I've been waiting for this video. Looking forward to the rest
Lots of skill on show in the creation of this video. Love it.
Damn, you could make your own SNES game with these skills and knowledge!
Umm... need a designer?
Awesome video. I love this series! I want to know how split screen was done in Mario cart!
Second-Generation Tuxedon
Thanks for the reply! I kinda understand what you're saying! Can't wait for your video on HDMA!
Edit: so could 4 player split screen be theoretically possible, but be limited by the CPU?
Chris Kurz If I'm not mistaken, every line you'd want to rewrite any of the Mode 7 parameters, the CPU would be spending 100% of its time waiting for when to write (when the video hardware reaches a certain horizontal position). Full screen 4 player would leave only vblank, which you'd spend updloading tile data, so you'd have absolutely no CPU time. I wonder if you could get by with a coprocessor doing all the game logic though.
Drew Sebastino The SNES already has a few co-proccessor chips built for it (CX-4, SA-1, the SuperFX family, not to mention the fan-built one used in the SD2SNES flashcart), so if someone were to convert Mario Kart's Mode7 code to one of those chips, 4-player splitscreen on the game would be possible :) You'd just have to code support for the Multitap as well, but I think that's pretty easy!
Zillion Taborda The SA-1 is actually just an overclocked SNES processor if I'm not mistaken, so that could be used. Converting SMK to be 4 player would be far from trivial though. A lot of the code will run natively on the SA-1, but you still need to modify the code to use a coprocessor. Then, you'd need to modify the game logic for using 4 viewports, with each one being only half the width of the normal game. (Of course, there's the CPU side writing to the Mode 7 registers.) Making the game use a multitap shouldn't be difficult though.
@@drewsebastino2889
Cant you add another coprocessor on game carts themselves?
I think SMB3 did this and thats why it has such good graphics for a NES game
Y∅ - I keep hearing and thinking "why not"
Engineer 1: "It's so hard trying to set up Mode 7! I just can't get the math right..."
Engineer 2: "Yo, why not?"
Engineer 1: "Of course! You're brilliant!"
y-not?
@@UChS4Dq15wHu8vkvWsaLzvPg It was four months ago that I made my comment, but I think it was a joke based on, for example, after 12:57, where Yo (Y, subscript zero), with the zero subscript pronounced as "nought", thus Y-naught. Hence, "Yo, why not?" Maybe not the most comprehensible joke...
@@Rationalific I understood it lol
Thanks for the time and effort you put into producing these amazing videos!
Wow. Excellent explanation and visualisation. Kudos.
Great video. At the end I would have loved to see a couple more examples, like F-Zero.
Perspective effects like in F-Zero use HDMA in combination with mode 7, which will be covered in part 7.
Production quality is awesome
Wow great video! I've been looking forward to this for months!!!
This is almost exactly how window geometry is formatted in Xorg-you define the scale of the shape, and the location, using a set of numbers, and the same goes for transformation. The only thing it doesn't do is skew or rotate like a vector image.
8:42 - It shouldn't be necessary to do the linear algebra for every pixel on the screen. By calculating the points at the start and end of a scanline and using Bresenham's line algorithm in between, you would need very little calculation to find where to look up each pixel. All of it would be integer, with no multiplication or division.
Excellent work on these. Very well done.
Better explained and visualized here in 18 minutes here, than in a number of university colleges on computer graphics and linear algebra!
Love this series and the level of detail
it's look like the graph confusingly wasn't always precise. but an excellent video explaining this topic. thank you!
I thought my geometry homework was confusing, this is that, but more confusing.
Good job.
I hope one day we can stop attributing mode 7 to every cool thing on the snes (ie throwing enemies at the screen in TMNT 4 or the vertical stage line scrolling effect in Axelay etc)