Just in case you forgot there are number of people who absolutely love your content. We may not comment or engage enough but you really are the only person who shares the information and it helps boost creativity on hardware even today. I think it's a great asset to have these videos posted and I'm sure you have a busy life outside of RUclips but hopefully you never feel it's a waste of time for making these videos because the audience isn't massive. This is content you cannot get elsewhere and your a fantastic wealth of knowledge. Keep up the good work and hope you are staying safe during the pandemic. Take care
@@NeoTechni That's neither here nor there. It's possible to create approximations of it. Some systems are worse for it than others. The SNES and Amiga both have bitplane based graphics, which are a pain. (on SNES in the worst case you might have to modify 8 bytes of graphics memory to set a single pixel) Of course, on anything under 256 colour graphics you're also dealing with multiple pixels per byte when your CPU almost certainly doesn't efficiently handle less than 8 bits at a time... Many early systems did have actual bitmap modes though. The Atari 8 bit microcomputers have 1.5 (aka 2 shades of the same colour), 4, and 16 colour bitmap modes. Unfortunately when dealing with a 1.79 mhz 8 bit cpu with no multiply/divide circuitry, doing graphics on the CPU is not a good idea. With a 160x192 resolution you've got 30,720 pixels to manipulate, and you can't even clear the screen for free. While a screen clear lets you clear 4 pixels at once due to how they are arranged in memory, you'd have to write to 7680 bytes just to clear the screen. 1.79 mhz cpu. Absolute best case 4 cycles per instruction (in practice probably 8 or more even for something as trivial as clearing a screen) Best case you can write 447,500 pixels worth of data in a second (and that's assuming you have no game logic and no complex graphics. I wrote a line drawing algorithm for this CPU and it came to about 200 cycles per pixel drawn). At 60 frames per second that's 7458 bytes. In short, you can only just barely clear the entire screen each frame, much less do anything much more complex. Sure you can lower the framerate, use cleverer tricks, but it's still not going to impress anyone. Now, a 7.16 mhz 68000 cpu sounds better, but realistically, it's not that much better. My own ballpark estimates based on this led me to the conclusion that to start doing non-trivial graphical tasks with a CPU without major compromises would require a 30-40 mhz CPU, give or take. And sure enough, that's roughly the kind of clock speeds where the PC started having games like Doom, Descent, Magic Carpet and so on... You can find workarounds for weird graphics formats. But it's much harder to do anything when your CPU just isn't that powerful, relatively speaking...
@@KuraIthys it is totally relevant because APA graphics are the easiest way to do it. Anything else requires a bunch of more complex/impressive hoops, such as the ones in the video.
@@KuraIthys: SNES CPU can go up to ~3.58 MHz. (The SA-1 runs at 10.74 MHz and includes bitplane conversion functions. The Super FX GSU runs at the full 21.477 MHz.)
Same, Genesis has some crude polygon games, even some relatively quick, smooth ones like Kawasaki Superbike Challenge. So I figured we were looking at a flat plane of polygons, or some similar vector drawing scheme. Which it kind of is, behind the scenes, it just uses the vectors to figure out which tiles to use. Wizardry.
This video helped me understand something I always knew: Old games were cool and endearing because of the artistic trickery they clearly had to resort to to achieve the effects they were going for. I just couldn't grasp how deep the rabbit hole went.
What impressed ME is that I immediately recognized that the music for this game was made by Jesper Kyd. It sounds much like the music he produced for the Hitman games, and the one heard in the Batman and Robin Genesis game! I immediately recognized that it was him, and I've never played or researched this game before. What a legend.
The animation at 5:20 explaining the tile stepping process is awesome, thank you for making that. That really helped me understand what is going on behind the scenes.
Now do the indoors parts, that's where most of the fun is with all the layer trickery (also I think the indoors wall renderer may be related to the outdoors water renderer)
You know a game is going to have something clever under the hood when the intro brags about all the cool stuff they were able to pull off. Would love to see some more videos about this one!
Red Zone is such a hidden gem... You could tell those devs put in their 110%. Also, the musics you played sounds different than the ones in the release version! Is there a dump of that beta?
The were many later Genesis games that were wonderful games. Unfortunately, by then the 16-bit era was coming to a close, and everyone was drooling at 32-bit.
The same teams did Scorcher and AMOK on the Sega Saturn. AMOK even uses music from Red Zone. Those games would be worth a video too, Scorcher double rotating backgrounds (one of the few games to do so), 15bit colour, and transparent polygons, while AMOK runs a full voxel engine and some hidden top-down levels. In fact AMOK started as a 32x title and you can see it on the legendary 32x Zyrinx demotape.
Theres a ton of mid or per scanline something something video memory raster effect 7.3 Liter 8 cylinder voodoo going on. The fact these people did most of this stuff in assembly blows my mind.
I don't think enough time was taken to explain and illustrate the concepts properly. He tends to go over some stuff too quickly. I understand the small layered sprites, but the tile mapping explanation lost me.
Might be surprising, but the FMV scenes are being made in the same way as the water in-game! You can see all the different 8x8 shapes in Vram. There's a LOT of them.
When you show what the video ram looks like, I think it would look better if you turned off the image interpolation so we can more easily see the actual pixels.
I wished for it to be gone, and enjoyed the video without it, as it's such a sad tune, and quite a short loop. Too short to continuously play during a ten minute video.
I would have loved to have an insight on how those line border tiles are picked. This is where the magic happens from this rotation effect. The algorithm must be pretty impressive.
I second this. I can think of several cocktail napkin methods but there’s got to be one out there that is the fastest. ( maybe AND it against every tile and see which one has the largest value aka largest common overlap?? )
Subtract the angle of object from the angle of camera, you get apparent angle on screen - it's an index of your sprite (you store them incrementally angle-wise). You use the same step counter from tile rotation routine to position the sprite accounting for camera rotation.
@@michaelbuckers there are several tile of the same angle with different fill ratio. The water rotating plane is like a grid of 8x8 bitmaps. Also, calculating angles on a 8mhz mc68000 having only integer arithmetic for 40-50 tiles 30 times per second appears to be costly. The game is not only doing rendering, there's a lot of action going on etc... The trick is probably clever as shit, like a weird DDA algo or something like that using a look up table. I'm pretty curious about it.
I remember suggesting this game in the comments a while back. Just blown away by the game rotation and how that was even possible on a sega genesis. thank you Coding Secrets.
I watched a video on how amazing this game looked for a Megadrive game, but this was an amazing breakdown. Never ever would I have imagined they were using tiles with different angles to draw the water edge.
I remember "discovering" the Puggsy pseudo rotation trick back in the day when I was messing around with sprite blitting. That full screen rotation is genius though -- I love the breakdown and detective work you do on these games!
I would love a Puggsy video. I fondly remember it as one of the more wonderfully odd games of my childhood and it came to mind immediately when you mentioned large rotation effects. I was pleasantly surprised when you just casually mentioned you made it!
@@KungKras No, that was Donkey Kong Country. Vectorman used tweened orb sprites to create super smooth animation. It also mixed in a lot of differently rotate sprites, and a metric ton of crazy raster effects (every other level has some unique special effect, starting as soon as the SEGA logo, it's nuts. And there are prototypes around which show that they had to cut a bunch of even more impressive stuff cut from the game).
Finally some new content. I hated to have to rewatch all the re-uploads of all your old videos, well actually I really enjoyed to watch them again... Keep the amazing videos coming! This is one of my top channels on youtube, I really hope you will continue making this style of videos for a long time!
I second that, I loved binge watching all of the videos when I first found this channel. Jon's voice with that background music is just so satisfying, and it is truly amazing to see what devs managed to pull off back in the day to get around hardware limitations
The geometry of the foreground layer is so simple, and screen moves so slowly; I wonder if they could have implemented a "true" polygon renderer in VRAM by calculating exactly which pixels need to be changed and only writing those, rather than redraw the whole thing every time.
Might've been possible. However it's far from trivial calculating which pixels need updating. Since polygon rendering in this context is CPU bound in general, you'd need to consider if the calculations to work out what needs updating are simple enough to outweigh just updating the whole thing directly....
Not with ~7 MHz of single core processing power & less than 0.5 IPC - even if you dedicate the entire processor to just rotating the screen it'll be ~140 CPU clock cycles per pixel, it's not nearly enough. At least there wasn't RAM lag like on today's machines which causes CPU to idle 90% of the time unless you use special memory access techniques (flat gapless arrays etc). Same story with GPU, it's so easy to stall it's ridiculous, you feed it commands at full speed and it still idles 70% of the time. You need to avoid switching shaders models textures etc at all costs - you must use megatextures, one-size-fits-all shaders, baked static geometry literally everywhere. Don't get me even started on the drivers, they're so finicky, in order to get good shader speed you must find some random way to trigger driver's fast pathway (the driver was coded to trigger for some AAA game shaders which otherwise run godawfully slow because the devs are lazy and/or idiots).
Your videos are among the most informative on RUclips, at least in the gaming genre. Another great video, thank you so much for taking the time to explain these things.
Me and my brother just LOVED pugsy, i remember showing all my friends the amazing intro to the game. Back in the 16bit era this really was mindblowing. Thank you for helping to code a piece of my childhood 😊
Awesome video. Thank you very much for lowering the music. It is now much clearer to hear you. I really like that you managed to keep it as your opening theme too. I guess everybody is happy now!
I just LOVE this man's break downs of these Genesis games. As a consumer going from Alex Kidd: Enchanted Castle to advanced games like this show just how much gets learnt about a piece of console hardware throughout it's like cycle. Its like the programmers really learnt how to bend the console to their will. Fascinating stuff!!
The way the tile map is stepped and composed each frame is extremely similar to the final pass section of the technique used in the SNES's Mode 7, with the biggest difference being that the Genesis is doing it all in software. SNES Mode 7 does a lot of calculations ahead of reading the background layer to determine the bounds of its quadrilateral viewport, then basically just transforms each screen pixel to the corresponding location in the quad and reads the color of the background pixel at that position. The line/angle-step routine demonstrated in this video is basically a very simplified version of that.
A lot of the music produced by demoscene coders (including the team that made this game) sounds like that - they may have done work on the Amiga (another 68k based system) and some of that knowledge carried over.
Excellent video as always. Would love to see you take a crack at what is happening under the hood on Xeno Crisis, especially with the soundtrack as I think they used a similar technique to the one used in Toy Story. It would be really cool to see what old techniques were still valid and what new twists a developer was able to come up with for a mega drive game made in 2018.
Most of the programmers were from the Amiga demo scene, so no surprise on the ingenuity. Also the music was done by Jesper Kyd.. another Amiga demo scene legend. quite cool!
Old video, but I have to comment that to me, the really impressive part of Red Zone is that it does all this at a fairly consistent and smooth 30 FPS. A lot of games did crazy 3D stuff in the 4th generation of game consoles, but to do this they frequently had to drop the framerate to 20, 18, 15, 12, even 10 FPS. Stunt Race FX comes to mind. At a glance, HardWired/Red Zone looks just as 3D as those games most of the time, yet runs so much more smoothly.
This is really clever and leads to an impressive looking game. It's amazing how you can make things look like they have a 3d engine while still being 2d.
The magic trick is always just a little less amazing when you learn how the woman in the box is sawed in half. Still, it feels like a whole lot of work went into making this effect, and I have to give Zyrinx credit for that at least.
Another great video. These are especially interesting as we have a tilemap mode on the new ZX Next and these methods are very doable on a z80 at 28mhz.
Well done! This makes a lot of sense; I may have to try it out for some of my games to see how it looks on modern hardware. Only needing to do something on a macro level to get a good-looking effect seems to be the basis of many retro games, and they usually pulled it off quite well! Keep it up with the awesome videos; I'll be there for the next one!
"Contra - Hard Corps" has a lot of cool graphical effects, and a lot of them look exactly like Mode 7; like for example the highway fight against Dead-Eye Joe, and the plane fight in the sky.
Scavenger's Zyrinx team are techinical geniuses back then with finding ways into pushing the Genesis hardware. Here's the fun fact. The game first started out as a prototype which is a racing game called Super Spin. It used the same top-down engine as the chopper sections in Red Zone. The racing prototype that I mentioned is actually dumped online for us to enjoy which is awesome.
That was an impressive means of short-cutting rotation and play into the Genesis' strength--its processor. It is far from perfect, but it is at least foolproof.
One thing I'd really love to see you cover is comparing the code from an early-get Genesis games to a late-gen game by the same/overlapping devs (e.g. Sonic 1 vs Sonic 3 or Leander vs 3D Blast for your own games) and showing the changes in the general tricks and how that improvement in understanding allowed better graphics, performance, and such.
Great work as always Jon! The terrain gradient is very subtle... I think that the game looks good even without it. Anyways, I recommend you to try the Exodus emulator, is a charm to debug and reverse engineer those kind of effects. Thanks for posting!
Thank you for this. It's simultaneously enlightening and disappointing to see my favourite games from back in the day picked apart. Disappointing in that it's like having my childhood dreams of coding magic being revealed as all smoke and mirrors 😆
There is so much tricky going on using different techniques on top of each other to pull it off. Quite impressive really that different devs were coming up with completely different things to pull of all sorts of things with hardware of the day. It is my favourite generation for that as even the most obscure games can do things no other games can at times.
Zyrinx is a well known developer bringing out awesome game and pushing the Genesis/megadrive graphics to its limits like Subterraria and Red Zone, oh don’t forget their awesome soundtracks! Genesis DOES have “mode 7”.
I love this channel... I’ve been trying to research how to code good 2.5d roads for driving games. Really need to break down how it works well on very low powered hardware. There are quite a few techniques, I’d love a video that explores this.
7:41 These cylindrical towers are using a familiar trick. It's at least similar to the one you used in Toy Story to get the effect of depth on certain objects.
YES! This game! Yes! I really want to know how they pulled off that FMV at the beginning, because it really looks like black polygons! I believe a few Sega genesis games actually had polygons, like Cyber Cop. Though I guess it could be really clever sprite work like in Toy Story.
@@maskedmonocle1991 Cyber Cop had a real 3D face in it. It was very low poly, but it moved around in 3D. Also Hard Drivin was ported to the Sega genesis. The framerate was awful, but that was 3D racer.
The B&W in the intro is just animation... there’s no polygons to it. It’s likely done with color cycling and tile animation. This channel did a demo of it before. You can get what looks like fluid motion from preplotting your animation this way
I'm amazed at how far developper could go back in the day to achieve this kind of effect without having it implemented in the hardware. Some years ago, I was impressed to discover Contra 3 stored a lot of sprites angles to achieve the "rotating mode 7" boss while you could rotate yourself but this is another level. Storing tiles of different shapes just to draw the different shapes at different angles is as close as having fully calculated rotation on the 68k as possible.
I played a lot of Sub-Terrania as a kid after Gamepro gave it straight 5’s. I listened to about 2 bars of the background BGM on this video and immediately knew it was the same composer, along with Batman and Robin of course. This developer was on another level in the early 90s. I don’t remember this one though!
One argument about "Mode 7" on SNES though, sprites don't rotate there either. An SNES can rotate 1 background, different helper ICs (Often extra Processors on cart) could split that up (like in Mario Kart where they achieved 2 by updating it halfway through the screen) but that's it.
You don't need a second CPU to do that. You can update it every single scanline with the base hardware. In fact, that's kind of the point. That perspective effect everyone associates with mode 7 only works because the mode 7 effect is being adjusted dynamically every single scanline. HDMA exists for this purpose, to automate it. Many, MANY games did splitscreen based effects without any additional hardware. F-Zero is a mode 1 display up to about 20% down the screen then switches to mode 7. Contra does this in reverse at some point with a mode 7 display on the top half and a mode 1 display on the bottom. The reason Mario Kart uses a co-processor is to deal with placing scaled sprites into the environment in believable positions and handling the calculation of 8 moving players and a bunch of objects in the world. (DSP-1 is purpose-built to perform 3d transformations, such as perspective projection, scaling, etc.) You don't need that to split a mode 7 display; You need it to calculate placement of dozens of moving points in 3d space. Of course, mode 7 has been used for 'sprites' repeatedly; It's a trick, but at the end of the day sprites and backgrounds are a relatively arbitrary division. If you use your sprites to represent a background, you can use mode 7 to represent a large scaling and rotating sprite. Mode 7 rotates and scales a single background, but all the parameters for rotation, scaling, and positioning can be altered per scanline in base hardware. Perspective works by adjusting the scaling factor every scanline. As long as you don't alter the actual scaling, you can pre-compute these factors once and use HDMA to adjust it automatically. (HDMA exists for the sole purpose of automating effects that happen on a per scanline basis) You wanna change graphics modes 8 times on a single screen? That's something you can pre-calculate on SNES, and send the pre-calculated list to the PPU. Wanna do really complex rotating textured 3d effects using mode 7? As long as those effects align to horizontal scanlines, you can precompute the whole thing and simply use HDMA to copy the lists each frame to make that effect happen. The expansion chips are doing calculations that the standard CPU would struggle with. However, the splitscreen effect is trivial. You want a 4 way horizontal splitscreen on SNES? Completely trivial. 4 sets of mode 7? Mode 7 + mode 6 + mode 3? No problem. Easy. What isn't easy is creating a 2 player racing game with 8 racers, and dozens of environmental objects that scale based on their position relative to the camera and have to remain in contact with the ground the whole time...
@@StaticTV80 Well, obviously more people cared about the SNES than about the Genesis. 50 Million SNES sold vs 30 Million Genesis... And it is not as if the SNES had no action games
I think that this game came around a time when Sega was trying very hard to keep up with the Super Nintendo whose system was always flexing its ability to easily do scaling, rotation and mode 7 techniques through games like Pilot Wings and Contra 3 Wars. Now, THAT was when we started seeing more games trying to do the scaling and rotation on the Sega Genesis.
I would like to see a series of breakdown on how platformers achieved scrolling. How did early games do it on Genesis and why was Sonic so much faster in comparison. Seeing how the knowledge and experience evolved over the Genesis's life span would be a valuable lesson in coding.
Ever look into Panorama Cotton? New to ur channel so Im not familiar with all of your videos, but that's got some really cool effects I'd like to see someone like u dive into 👍
Not quite Mode-7, where the SNES (designed many years later) can just rotate (and scale) naturally. However, this was very clever trickery to make it appear it can do what it can't, naturally. There is a video of someone who made F-Zero with a hard-coded "Mode-7" display, but they doubled the pixels horizontally to get the smoothness the SNES can do on it's own. Still impressive.
It always felt a little sinister to me at the time - it didn't have any of Desert Strike's lighter feel. Very dark, violent and this weird graphical frippery that looked like nothing else on the system. But the intro video was the most amazing thing I ever saw my Mega Drive do ...though I didn't have Sonic 3D ;)
Nice writeup John! TBH I thought the coastline was polygons similar to Operation Harrier on the Atari ST and Amiga. The tile cycling was done quite a bit on the NES with the mmc3 but this takes it to a new level! Interestingly, you can get a good mode7 effect with simple line scrolling as in Vectorman level 2, and I'm guessing that the fzero demo uses a proper mode7 transform - there was a also a demo on the ST that did it (Rumpelkammer)
Imagine being a Red Zone developers and you have to wait 26 years for somebody to really appreciate your work.
That's how a lot of clever coding goes, tbf.
@PXLTRON it's been 30 years, you can let it go
@Sonny Henry Yea, I've been using Flixzone for since november myself =)
@Sonny Henry Yea, have been using Flixzone for months myself :)
@NALTO Recently I've only heard people appreciate tricks on the mega drive?
Just in case you forgot there are number of people who absolutely love your content. We may not comment or engage enough but you really are the only person who shares the information and it helps boost creativity on hardware even today. I think it's a great asset to have these videos posted and I'm sure you have a busy life outside of RUclips but hopefully you never feel it's a waste of time for making these videos because the audience isn't massive. This is content you cannot get elsewhere and your a fantastic wealth of knowledge. Keep up the good work and hope you are staying safe during the pandemic. Take care
I thought the cost line was going to be very rudimentary polygons. Everything was tile manipulation. Crazy.
I thought so too. Then I remembered how old systems didn't really have all-points-accessible graphics.
@@NeoTechni That's neither here nor there. It's possible to create approximations of it.
Some systems are worse for it than others.
The SNES and Amiga both have bitplane based graphics, which are a pain. (on SNES in the worst case you might have to modify 8 bytes of graphics memory to set a single pixel)
Of course, on anything under 256 colour graphics you're also dealing with multiple pixels per byte when your CPU almost certainly doesn't efficiently handle less than 8 bits at a time...
Many early systems did have actual bitmap modes though.
The Atari 8 bit microcomputers have 1.5 (aka 2 shades of the same colour), 4, and 16 colour bitmap modes.
Unfortunately when dealing with a 1.79 mhz 8 bit cpu with no multiply/divide circuitry, doing graphics on the CPU is not a good idea.
With a 160x192 resolution you've got 30,720 pixels to manipulate, and you can't even clear the screen for free.
While a screen clear lets you clear 4 pixels at once due to how they are arranged in memory, you'd have to write to 7680 bytes just to clear the screen.
1.79 mhz cpu. Absolute best case 4 cycles per instruction (in practice probably 8 or more even for something as trivial as clearing a screen)
Best case you can write 447,500 pixels worth of data in a second (and that's assuming you have no game logic and no complex graphics. I wrote a line drawing algorithm for this CPU and it came to about 200 cycles per pixel drawn).
At 60 frames per second that's 7458 bytes.
In short, you can only just barely clear the entire screen each frame, much less do anything much more complex.
Sure you can lower the framerate, use cleverer tricks, but it's still not going to impress anyone.
Now, a 7.16 mhz 68000 cpu sounds better, but realistically, it's not that much better.
My own ballpark estimates based on this led me to the conclusion that to start doing non-trivial graphical tasks with a CPU without major compromises would require a 30-40 mhz CPU, give or take.
And sure enough, that's roughly the kind of clock speeds where the PC started having games like Doom, Descent, Magic Carpet and so on...
You can find workarounds for weird graphics formats. But it's much harder to do anything when your CPU just isn't that powerful, relatively speaking...
@@KuraIthys it is totally relevant because APA graphics are the easiest way to do it. Anything else requires a bunch of more complex/impressive hoops, such as the ones in the video.
@@KuraIthys: SNES CPU can go up to ~3.58 MHz. (The SA-1 runs at 10.74 MHz and includes bitplane conversion functions. The Super FX GSU runs at the full 21.477 MHz.)
Same, Genesis has some crude polygon games, even some relatively quick, smooth ones like Kawasaki Superbike Challenge. So I figured we were looking at a flat plane of polygons, or some similar vector drawing scheme. Which it kind of is, behind the scenes, it just uses the vectors to figure out which tiles to use. Wizardry.
This video helped me understand something I always knew: Old games were cool and endearing because of the artistic trickery they clearly had to resort to to achieve the effects they were going for. I just couldn't grasp how deep the rabbit hole went.
What impressed ME is that I immediately recognized that the music for this game was made by Jesper Kyd. It sounds much like the music he produced for the Hitman games, and the one heard in the Batman and Robin Genesis game! I immediately recognized that it was him, and I've never played or researched this game before. What a legend.
Jesper used the same melody for Sub-Terrania, Red Zone and Blood Money
ok!
@@johanjohan5881 shut the fuck up
@@poble Probably a 12 year old, those shits ruined RUclips
@_ Pobert-Eii _ ok!
This really does look like a 32x game
The animation at 5:20 explaining the tile stepping process is awesome, thank you for making that. That really helped me understand what is going on behind the scenes.
Now do the indoors parts, that's where most of the fun is with all the layer trickery (also I think the indoors wall renderer may be related to the outdoors water renderer)
ok!
They probably used the same technique used for Toy Story's 3D effect during gameplay for the shelves.
@@pacsonic9000 Actually it's a little more complex than that.
Ooooooo.
You know a game is going to have something clever under the hood when the intro brags about all the cool stuff they were able to pull off. Would love to see some more videos about this one!
Red Zone is such a hidden gem... You could tell those devs put in their 110%.
Also, the musics you played sounds different than the ones in the release version! Is there a dump of that beta?
The were many later Genesis games that were wonderful games. Unfortunately, by then the 16-bit era was coming to a close, and everyone was drooling at 32-bit.
The developers released the proto as public domain, you can grab it here:
www.zophar.net/pdroms/genesis/hardwired.html
ok!
@@jillcrungus
This is awesome!
Thanks for the heads up.
💪🏿🙃🤙🏿
The same teams did Scorcher and AMOK on the Sega Saturn. AMOK even uses music from Red Zone. Those games would be worth a video too, Scorcher double rotating backgrounds (one of the few games to do so), 15bit colour, and transparent polygons, while AMOK runs a full voxel engine and some hidden top-down levels. In fact AMOK started as a 32x title and you can see it on the legendary 32x Zyrinx demotape.
One game that really amazed me back then was Gunstar Heroes. There are some cool effects there. Any chance to break it down?
Theres a ton of mid or per scanline something something video memory raster effect 7.3 Liter 8 cylinder voodoo going on. The fact these people did most of this stuff in assembly blows my mind.
x2
Great game. I’d like to see a video on this too.
Same as Contra Hard Corps..
@@graphicsgod DEFINITELY HARD CORPS
Having 0 experience in this field at all I can firmly verify that "ya that's probably how they did it idk tho"
Sounds like a plan, then. Off we go to build some sick games with all we've just learned! Are ya with me?
I don't think enough time was taken to explain and illustrate the concepts properly. He tends to go over some stuff too quickly. I understand the small layered sprites, but the tile mapping explanation lost me.
@@Prizm44Might be a two year old comment... but..
You want a 2 hour in depth tutorial? Because if so... Those exist...
Red Zone is in my genesis top 5, so glad to find someone finally analyzing its technical achievements, thanks!
ok!
I would love to see how that FMV is done in a future video!
ok!
Probably the same way as the Sonic 3D Blast intro.
they def using the two-tone coloring to their advantage
pretty sure it's the same as the 3d blast logo/game over fmvs
Might be surprising, but the FMV scenes are being made in the same way as the water in-game!
You can see all the different 8x8 shapes in Vram. There's a LOT of them.
When you show what the video ram looks like, I think it would look better if you turned off the image interpolation so we can more easily see the actual pixels.
+
yes.
this.
The music's back! Hurrah!
ok!
I wished for it to be gone, and enjoyed the video without it, as it's such a sad tune, and quite a short loop. Too short to continuously play during a ten minute video.
Yeah. Was happy to see it.
Your videos bring me a nostalgic joy I can not define. Please do not stop!
You made Puggsy? That game was awesome and extremely hard sometimes. Love it!
I would have loved to have an insight on how those line border tiles are picked. This is where the magic happens from this rotation effect. The algorithm must be pretty impressive.
I second this. I can think of several cocktail napkin methods but there’s got to be one out there that is the fastest.
( maybe AND it against every tile and see which one has the largest value aka largest common overlap?? )
They must be proud
Subtract the angle of object from the angle of camera, you get apparent angle on screen - it's an index of your sprite (you store them incrementally angle-wise). You use the same step counter from tile rotation routine to position the sprite accounting for camera rotation.
@@michaelbuckers there are several tile of the same angle with different fill ratio. The water rotating plane is like a grid of 8x8 bitmaps.
Also, calculating angles on a 8mhz mc68000 having only integer arithmetic for 40-50 tiles 30 times per second appears to be costly. The game is not only doing rendering, there's a lot of action going on etc...
The trick is probably clever as shit, like a weird DDA algo or something like that using a look up table. I'm pretty curious about it.
@@emmanueloverrated It's a lookup table yes. You can always compute pretty accurate values but rarely does it ever makes practical sense.
I remember suggesting this game in the comments a while back.
Just blown away by the game rotation and how that was even possible on a sega genesis.
thank you
Coding Secrets.
I watched a video on how amazing this game looked for a Megadrive game, but this was an amazing breakdown. Never ever would I have imagined they were using tiles with different angles to draw the water edge.
This is why I love old school tech, limited and yet not limited.
I remember "discovering" the Puggsy pseudo rotation trick back in the day when I was messing around with sprite blitting. That full screen rotation is genius though -- I love the breakdown and detective work you do on these games!
I would love a Puggsy video. I fondly remember it as one of the more wonderfully odd games of my childhood and it came to mind immediately when you mentioned large rotation effects. I was pleasantly surprised when you just casually mentioned you made it!
the wizard is back! please talk about Vectorman!
ok!
Yes!
Isn't vectorman just pre-rendered sprites using 3D modelling software and then treated just as regular sprites in the megadrive hardware?
@@KungKras No, that was Donkey Kong Country. Vectorman used tweened orb sprites to create super smooth animation. It also mixed in a lot of differently rotate sprites, and a metric ton of crazy raster effects (every other level has some unique special effect, starting as soon as the SEGA logo, it's nuts. And there are prototypes around which show that they had to cut a bunch of even more impressive stuff cut from the game).
Finally some new content. I hated to have to rewatch all the re-uploads of all your old videos, well actually I really enjoyed to watch them again...
Keep the amazing videos coming! This is one of my top channels on youtube, I really hope you will continue making this style of videos for a long time!
I second that, I loved binge watching all of the videos when I first found this channel. Jon's voice with that background music is just so satisfying, and it is truly amazing to see what devs managed to pull off back in the day to get around hardware limitations
The geometry of the foreground layer is so simple, and screen moves so slowly; I wonder if they could have implemented a "true" polygon renderer in VRAM by calculating exactly which pixels need to be changed and only writing those, rather than redraw the whole thing every time.
Might've been possible. However it's far from trivial calculating which pixels need updating.
Since polygon rendering in this context is CPU bound in general, you'd need to consider if the calculations to work out what needs updating are simple enough to outweigh just updating the whole thing directly....
It's a good bet many have already tried and failed. The rush for 3D was on for everyone.
Not with ~7 MHz of single core processing power & less than 0.5 IPC - even if you dedicate the entire processor to just rotating the screen it'll be ~140 CPU clock cycles per pixel, it's not nearly enough. At least there wasn't RAM lag like on today's machines which causes CPU to idle 90% of the time unless you use special memory access techniques (flat gapless arrays etc). Same story with GPU, it's so easy to stall it's ridiculous, you feed it commands at full speed and it still idles 70% of the time. You need to avoid switching shaders models textures etc at all costs - you must use megatextures, one-size-fits-all shaders, baked static geometry literally everywhere. Don't get me even started on the drivers, they're so finicky, in order to get good shader speed you must find some random way to trigger driver's fast pathway (the driver was coded to trigger for some AAA game shaders which otherwise run godawfully slow because the devs are lazy and/or idiots).
Thank you for bringing the old music back...
Your videos are among the most informative on RUclips, at least in the gaming genre.
Another great video, thank you so much for taking the time to explain these things.
Nowhere near enough subs.
Keep up the good work fella. Love these retrospective breakdowns.
Brilliant! Love your videos. So informative.
Never stop being amazed by these videos explaining coding tricks for technologies from 80s/90s.
Wow, it's pretty crazy to think about all the sorta hacky stuff they had to do back in the day to make these effects on that hardware.
ok!
yeah indeed, and I'm kinda sad I never got to experience coding that, nowadays it's so easy
@@embodyingocean189 you can still code for old systems like Genesis, but it isn't too practical
@DPAD-FTW Yako
@@xyzzy-dv6te I've been trying to figure out how to code java games for the nokia button phones, don't know where to start as there are no tutorials
Good to hear Chris is back for the music again
I love this kind of videos when people find solutions in limited hardware
Me and my brother just LOVED pugsy, i remember showing all my friends the amazing intro to the game.
Back in the 16bit era this really was mindblowing.
Thank you for helping to code a piece of my childhood 😊
This channel demonstrates again and again that amazing coding tricks don't have anything to do with good gameplay.
Awesome video. Thank you very much for lowering the music. It is now much clearer to hear you. I really like that you managed to keep it as your opening theme too. I guess everybody is happy now!
Incredible sprite work, love it. Thank you for all of the fascinating videos.
I love these videos so much. This is exactly the stuff I'm curious about.
Wow this was impressive, I had to watch this a few times to understand the coding secrets! Good stuff sir!
Totally in awe, here. The programming tricks on display are simply brilliant!
I just LOVE this man's break downs of these Genesis games. As a consumer going from Alex Kidd: Enchanted Castle to advanced games like this show just how much gets learnt about a piece of console hardware throughout it's like cycle. Its like the programmers really learnt how to bend the console to their will. Fascinating stuff!!
The way the tile map is stepped and composed each frame is extremely similar to the final pass section of the technique used in the SNES's Mode 7, with the biggest difference being that the Genesis is doing it all in software. SNES Mode 7 does a lot of calculations ahead of reading the background layer to determine the bounds of its quadrilateral viewport, then basically just transforms each screen pixel to the corresponding location in the quad and reads the color of the background pixel at that position. The line/angle-step routine demonstrated in this video is basically a very simplified version of that.
I love the music in Red Zone. IMO it sounds quite unique, and "danceable" if that makes sense.
A lot of the music produced by demoscene coders (including the team that made this game) sounds like that - they may have done work on the Amiga (another 68k based system) and some of that knowledge carried over.
Excellent video as always. Would love to see you take a crack at what is happening under the hood on Xeno Crisis, especially with the soundtrack as I think they used a similar technique to the one used in Toy Story. It would be really cool to see what old techniques were still valid and what new twists a developer was able to come up with for a mega drive game made in 2018.
Most of the programmers were from the Amiga demo scene, so no surprise on the ingenuity. Also the music was done by Jesper Kyd.. another Amiga demo scene legend. quite cool!
That game looks amazing for its time
Just found your channel subbing because you gave me so much fun as a kid thanks for your work
Holy shit i am so happy i found this channel because it is truly amazing. Thank you for the videos.
Old video, but I have to comment that to me, the really impressive part of Red Zone is that it does all this at a fairly consistent and smooth 30 FPS. A lot of games did crazy 3D stuff in the 4th generation of game consoles, but to do this they frequently had to drop the framerate to 20, 18, 15, 12, even 10 FPS. Stunt Race FX comes to mind. At a glance, HardWired/Red Zone looks just as 3D as those games most of the time, yet runs so much more smoothly.
This is really clever and leads to an impressive looking game. It's amazing how you can make things look like they have a 3d engine while still being 2d.
The magic trick is always just a little less amazing when you learn how the woman in the box is sawed in half. Still, it feels like a whole lot of work went into making this effect, and I have to give Zyrinx credit for that at least.
Another great video. These are especially interesting as we have a tilemap mode on the new ZX Next and these methods are very doable on a z80 at 28mhz.
Oh, cool, you're here. I really liked your 'Remember When' MOD song. Was it originally made as .MOD or .XM?
Nikku4211 Thanks - yeah originally a MOD written on the Amiga.
Awesome stuff! I love seeing a pro analyze stuff like this. Love these videos!
Gotta say this is STILL impressive today and shows you what "Parallax Scrolling" is capable of.
I love your channels please do more awesome coding secrets !!!
Now that you showed us the crazy pallette, I can see the jitteriness in the subdued pallette, while I couldn't before.
i am in awe in each of your videos... i cannot believe i am complaining about how Media Molecule Dreams is treating me bad sometimes :)
Never ever heard of that game. Absolutely stunning work.
Well done! This makes a lot of sense; I may have to try it out for some of my games to see how it looks on modern hardware. Only needing to do something on a macro level to get a good-looking effect seems to be the basis of many retro games, and they usually pulled it off quite well!
Keep it up with the awesome videos; I'll be there for the next one!
I love that you start to analyze other games then your own as well :)
That rotating sega logo is pretty dope.
"Contra - Hard Corps" has a lot of cool graphical effects, and a lot of them look exactly like Mode 7;
like for example the highway fight against Dead-Eye Joe, and the plane fight in the sky.
Scavenger's Zyrinx team are techinical geniuses back then with finding ways into pushing the Genesis hardware.
Here's the fun fact. The game first started out as a prototype which is a racing game called Super Spin. It used the same top-down engine as the chopper sections in Red Zone. The racing prototype that I mentioned is actually dumped online for us to enjoy which is awesome.
That was an impressive means of short-cutting rotation and play into the Genesis' strength--its processor. It is far from perfect, but it is at least foolproof.
Great game! And Great video! Reminds me of the Micro Mages 40kb guide video, which is super interesting
Great video! Always love seeing these
One thing I'd really love to see you cover is comparing the code from an early-get Genesis games to a late-gen game by the same/overlapping devs (e.g. Sonic 1 vs Sonic 3 or Leander vs 3D Blast for your own games) and showing the changes in the general tricks and how that improvement in understanding allowed better graphics, performance, and such.
I played this game back in the day and was amazed at these graphical effects.
Gameplay was also good.
Great work as always Jon! The terrain gradient is very subtle... I think that the game looks good even without it. Anyways, I recommend you to try the Exodus emulator, is a charm to debug and reverse engineer those kind of effects. Thanks for posting!
I used Exodus to change the palette to highlight the tiles
Thank you for this. It's simultaneously enlightening and disappointing to see my favourite games from back in the day picked apart. Disappointing in that it's like having my childhood dreams of coding magic being revealed as all smoke and mirrors 😆
After watching videos from Jon, you should believe that all coding is just smoke and mirrors.
dude, that music is on point. kickass.
There is so much tricky going on using different techniques on top of each other to pull it off. Quite impressive really that different devs were coming up with completely different things to pull of all sorts of things with hardware of the day. It is my favourite generation for that as even the most obscure games can do things no other games can at times.
Zyrinx is a well known developer bringing out awesome game and pushing the Genesis/megadrive graphics to its limits like Subterraria and Red Zone, oh don’t forget their awesome soundtracks! Genesis DOES have “mode 7”.
I love this channel... I’ve been trying to research how to code good 2.5d roads for driving games. Really need to break down how it works well on very low powered hardware. There are quite a few techniques, I’d love a video that explores this.
Subbed. Didn't realise you were of Traveller's Tales origin. Still waiting on Tigranda! ;)
7:41
These cylindrical towers are using a familiar trick. It's at least similar to the one you used in Toy Story to get the effect of depth on certain objects.
That's just 2 circles a top of another.
yeah those are just two circles with parallax
Outstanding video
Extremely nice tecnhniques, tip of the hat to you Sir.
Very good explanation! 👍🏻
YES! This game! Yes! I really want to know how they pulled off that FMV at the beginning, because it really looks like black polygons! I believe a few Sega genesis games actually had polygons, like Cyber Cop. Though I guess it could be really clever sprite work like in Toy Story.
i don't think the genesis was physically capable of rendering real polygons, it was probably the same technique in doom
@@maskedmonocle1991 Cyber Cop had a real 3D face in it. It was very low poly, but it moved around in 3D. Also Hard Drivin was ported to the Sega genesis. The framerate was awful, but that was 3D racer.
The B&W in the intro is just animation... there’s no polygons to it. It’s likely done with color cycling and tile animation. This channel did a demo of it before. You can get what looks like fluid motion from preplotting your animation this way
I'm amazed at how far developper could go back in the day to achieve this kind of effect without having it implemented in the hardware. Some years ago, I was impressed to discover Contra 3 stored a lot of sprites angles to achieve the "rotating mode 7" boss while you could rotate yourself but this is another level. Storing tiles of different shapes just to draw the different shapes at different angles is as close as having fully calculated rotation on the 68k as possible.
I live for this channel God Bless
please do more videos about those effects!
this game has some incredible techniques to make rotation, FMV and other things
I played a lot of Sub-Terrania as a kid after Gamepro gave it straight 5’s. I listened to about 2 bars of the background BGM on this video and immediately knew it was the same composer, along with Batman and Robin of course. This developer was on another level in the early 90s. I don’t remember this one though!
Will there be more content coming soon? I only discovered your stuff a couple of months ago and fell in love with it. I would love to see more!!
One of Sega's most underrated games.
Love your channels bro. Wish you were my friend so you could show me the world of coding
One argument about "Mode 7" on SNES though, sprites don't rotate there either. An SNES can rotate 1 background, different helper ICs (Often extra Processors on cart) could split that up (like in Mario Kart where they achieved 2 by updating it halfway through the screen) but that's it.
You don't need a second CPU to do that.
You can update it every single scanline with the base hardware.
In fact, that's kind of the point.
That perspective effect everyone associates with mode 7 only works because the mode 7 effect is being adjusted dynamically every single scanline.
HDMA exists for this purpose, to automate it.
Many, MANY games did splitscreen based effects without any additional hardware.
F-Zero is a mode 1 display up to about 20% down the screen then switches to mode 7.
Contra does this in reverse at some point with a mode 7 display on the top half and a mode 1 display on the bottom.
The reason Mario Kart uses a co-processor is to deal with placing scaled sprites into the environment in believable positions and handling the calculation of 8 moving players and a bunch of objects in the world.
(DSP-1 is purpose-built to perform 3d transformations, such as perspective projection, scaling, etc.)
You don't need that to split a mode 7 display; You need it to calculate placement of dozens of moving points in 3d space.
Of course, mode 7 has been used for 'sprites' repeatedly; It's a trick, but at the end of the day sprites and backgrounds are a relatively arbitrary division.
If you use your sprites to represent a background, you can use mode 7 to represent a large scaling and rotating sprite.
Mode 7 rotates and scales a single background, but all the parameters for rotation, scaling, and positioning can be altered per scanline in base hardware.
Perspective works by adjusting the scaling factor every scanline.
As long as you don't alter the actual scaling, you can pre-compute these factors once and use HDMA to adjust it automatically.
(HDMA exists for the sole purpose of automating effects that happen on a per scanline basis)
You wanna change graphics modes 8 times on a single screen? That's something you can pre-calculate on SNES, and send the pre-calculated list to the PPU.
Wanna do really complex rotating textured 3d effects using mode 7?
As long as those effects align to horizontal scanlines, you can precompute the whole thing and simply use HDMA to copy the lists each frame to make that effect happen.
The expansion chips are doing calculations that the standard CPU would struggle with. However, the splitscreen effect is trivial.
You want a 4 way horizontal splitscreen on SNES?
Completely trivial. 4 sets of mode 7? Mode 7 + mode 6 + mode 3?
No problem. Easy.
What isn't easy is creating a 2 player racing game with 8 racers, and dozens of environmental objects that scale based on their position relative to the camera and have to remain in contact with the ground the whole time...
Look at Street Racer on SNES. In 4 Player Mode it zooms and rotates 4 layers at once at 60fps without any helping Co-processor
Who cares the snes is a slow RPG console
@@StaticTV80 Well, obviously more people cared about the SNES than about the Genesis. 50 Million SNES sold vs 30 Million Genesis... And it is not as if the SNES had no action games
@@retropolis1 you know why the snes sold more because it was family friendly and censored the Genesis was too muture
I think that this game came around a time when Sega was trying very hard to keep up with the Super Nintendo whose system was always flexing its ability to easily do scaling, rotation and mode 7 techniques through games like Pilot Wings and Contra 3 Wars. Now, THAT was when we started seeing more games trying to do the scaling and rotation on the Sega Genesis.
I would like to see a series of breakdown on how platformers achieved scrolling. How did early games do it on Genesis and why was Sonic so much faster in comparison.
Seeing how the knowledge and experience evolved over the Genesis's life span would be a valuable lesson in coding.
Great game, excellent video, awesome channel, amazing content! Congrats! 👏
Thanks for keeping "is that you? Or are you you" in this video, I greatly appreciate it! Great video as always
Absolutely, it gets me in the mood for learning some next level coding secrets
Ever look into Panorama Cotton? New to ur channel so Im not familiar with all of your videos, but that's got some really cool effects I'd like to see someone like u dive into 👍
Not quite Mode-7, where the SNES (designed many years later) can just rotate (and scale) naturally. However, this was very clever trickery to make it appear it can do what it can't, naturally.
There is a video of someone who made F-Zero with a hard-coded "Mode-7" display, but they doubled the pixels horizontally to get the smoothness the SNES can do on it's own. Still impressive.
That full screen FMV is amazing
Never heard of this game, and now I feel like I missed out!
It always felt a little sinister to me at the time - it didn't have any of Desert Strike's lighter feel. Very dark, violent and this weird graphical frippery that looked like nothing else on the system. But the intro video was the most amazing thing I ever saw my Mega Drive do ...though I didn't have Sonic 3D ;)
The second area in Vectorman is very impressive
Nice writeup John! TBH I thought the coastline was polygons similar to Operation Harrier on the Atari ST and Amiga. The tile cycling was done quite a bit on the NES with the mmc3 but this takes it to a new level!
Interestingly, you can get a good mode7 effect with simple line scrolling as in Vectorman level 2, and I'm guessing that the fzero demo uses a proper mode7 transform - there was a also a demo on the ST that did it (Rumpelkammer)