How to do Parallax Scrolling on the Sega Genesis & Mega Drive - Beginners Dev Tutorials

  Рет қаралды 9,541

Pigsy's Retro Game Dev Tutorials

Pigsy's Retro Game Dev Tutorials

Күн бұрын

Пікірлер: 82
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials Жыл бұрын
UPDATE: Please note that SGDK has been updated since this video was created. If you are using a version of SGDK newer than 1.7, then please write "u16 ind = TILE_USER_INDEX;" instead of "u16 ind = TILE_USERINDEX;" and it should compile fine :)
@ecernosoft3096
@ecernosoft3096 10 ай бұрын
Hey, does this support ASM? I can code in C but I absolutley prefer ASM for retro machines so I can get insane things like sprite scaling and rotation out of them.
@jbmaru
@jbmaru 2 жыл бұрын
Saved to playlist "In case I want to learn programming the Mega Drive"! Some fine music accompanies the lesson 🍷
@clubfro
@clubfro 2 жыл бұрын
Clicked on this video for Thunder Force IV, the absolute GOAT when it comes to Genesis parallax scrolling!
@Rihcterwilker
@Rihcterwilker 2 жыл бұрын
It really makes the world feel more real
@MetallicOrwell
@MetallicOrwell 11 ай бұрын
When I was 9 years old my parents bought me a Mega Drive for Christmas, and I never thought in a million years that one day I'd be programming for it, but it's happening thanks to you. You're the best.
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 11 ай бұрын
You're welcome!
@a2z.........
@a2z......... 2 жыл бұрын
Thx for the video. Thunderforce 4 it's an AMAZING game on Sega Megadrive.
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
It really is!
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
This ended up being much longer than I intended (and about much more than just parallax scrolling!). Some of the info make take a while to sink in, but if it feels too much then just focus on writing the finished parallax scrolling code. The rest will make more and more sense as we progress through the tutorials.
@krushingbro6620
@krushingbro6620 2 жыл бұрын
Hell yes! new video drops lets go.
@andorvogel4768
@andorvogel4768 Жыл бұрын
Please, please keep on doing such Tutorials on Mega Drive (SGDK) development. Making own games has always been one of my biggest dream, but making an own MD game is especially fascinating. The footage of Your Castlevania development is very impressive too.
@MaesePe
@MaesePe 2 жыл бұрын
I'm not a coder at all but I love your tutorials! Very interesting stuff.
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
I'm glad to hear they are appealing to non-coders too :)
@GimblyGFR
@GimblyGFR 2 жыл бұрын
I was eagerly waiting for you to start publishing these dev tutorials, and it did not disappoint. Very clear, very didactic. I was a programmer, but stopped coding many years ago to focus on other areas of computer and IT work. However, your videos are bringing the itch to code back. A question: since the Genesis uses tiles to build backgrounds and sprites; the images you use as resources are automatically split into tiles? Using big images is not efficient, so I assume some work is being done by the SGDK to convert everything into tiles and re-use identical tiles, etc. Great series of videos. Can't wait to see more.
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
Yes, SGDK does the work for us, we just have to give it the image. I will talk more about this in the next lesson.
@GimblyGFR
@GimblyGFR 2 жыл бұрын
@@PigsysRetroGameDevTutorials Great!
@22kingbeef
@22kingbeef 2 жыл бұрын
Another excellent tutorial! Plan on spending my Memorial Day playing around with this 😁
@airthrowDBT
@airthrowDBT 2 жыл бұрын
Ok I got this working and I cannot tell you how pleased I am, as a lifelong Genesis fan to get this working as a base for my own learning and future projects. Thank you so so much for these, please make more tutorials! Will join your Patreon
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
Glad to hear you got it working :) I still remember my excitement last year when I first got some roms up and running on the console, so it's great to be able to relive that feeling a little through other people creating their first roms. Thanks for the support!
@AFourEyedGeek
@AFourEyedGeek Жыл бұрын
I was advised to pause tutorials like this during your explanations and to experiment. Thanks to SGDK using sensible words and to your clear explanations I was able to make the background and foreground scroll horizontally and vertically just after you advised how to scroll the background horizontally. This method stops me just typing in what you are saying without thinking. So thanks for making your tutorials clear enough I can actually understand the process without just copying and hoping I get it.
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials Жыл бұрын
It's definitely a good idea to experiment. If you can make changes and have the result be exactly as you predicted then you know you have understood things.
@Robert_Manners
@Robert_Manners 2 жыл бұрын
Thanks for the video 📹
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
You're welcome!
@igodreamer7096
@igodreamer7096 2 жыл бұрын
Very good
@CorriendoVoy247
@CorriendoVoy247 6 ай бұрын
Thanks for all the tutorials, the work and effort you put in all of them really shows how much you love the Genesis/MD! My objective of this year is make a port of the first level of the TMNT Arcade game (The first one)... I hope i can make it xD
@darrink6214
@darrink6214 Жыл бұрын
This is great so far! I am going through your tutorials, I just finished this one. Big thanks for doing this and hope it continues.
@brunch1572
@brunch1572 2 жыл бұрын
I'm following along and can't wait for the next one. Keep up the good work.
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
Great to hear that people are doing the lessons. The next one will be out next week.
@trotaXII
@trotaXII 10 ай бұрын
I'm following your tutorials and I'm loving them!
@anjodaharpa8757
@anjodaharpa8757 2 жыл бұрын
I love your work!
@lancelnce
@lancelnce 2 жыл бұрын
Nice
@drift180x
@drift180x 2 жыл бұрын
Great tutorial. It’s cool seeing how all this stuff works and gaining a greater understanding.
@fruty1502
@fruty1502 Жыл бұрын
Thanks for all your work. My life as changing since i know sgdk and you .Please post new videos . 😢
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials Жыл бұрын
Glad to hear it :). New videos will be coming soon!
@AlfredoJr
@AlfredoJr 2 жыл бұрын
Waiting for the next video! Great job, man!
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
It's already here :)
@dvygrvy
@dvygrvy 2 жыл бұрын
these lessons are really interesting - keep it up!
@spht9ng
@spht9ng 2 жыл бұрын
Hey please keep on with this. These videos have been life-changing for me. Just subbed on Patreon.
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
Wow, great to hear they are having such a positive effect in your life! That gives me extra motivation, so thanks! And thanks for the Patron support too.
@samaeldrakul4191
@samaeldrakul4191 Жыл бұрын
fantastic stuff, long live the megadrive! ✊️✊️
@6vibe150
@6vibe150 2 жыл бұрын
Sweet
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
Like liquid honey :)
@yateoi
@yateoi 2 жыл бұрын
Fabulous! Can't wait to try this.
@yateoi
@yateoi 10 ай бұрын
Well, here I am a year later, having parallax scrolled Green Hills' iconic terrains. tranks for this ♥♥♥ Btw, I've done pixel art work. So I pretend to have a shoot ton of fun on the next lesson :B
@posthumanistpotato
@posthumanistpotato 2 жыл бұрын
Signed up for the Patreon. :D
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
Thanks, much appreciated! The next tutorial will be coming next week :)
@sdfmnb2314
@sdfmnb2314 4 ай бұрын
for slower parallax scrolling, instead of writing int when writing a variable, write float, float is just like int, but for decimals
@miltiadiskoutsokeras9189
@miltiadiskoutsokeras9189 2 жыл бұрын
I wanted to go to sleep early today.
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
Don't worry the tutorial will still be there tomorrow morning, I'm not going to delete it, haha :) Have a good night's rest.
@miltiadiskoutsokeras9189
@miltiadiskoutsokeras9189 2 жыл бұрын
@@PigsysRetroGameDevTutorials I opened the laptop already. No going back now.
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
@@miltiadiskoutsokeras9189 Parallax scrolling is more important than sleep for sure, haha! Let me know how you get on.
@isodoubIet
@isodoubIet 2 жыл бұрын
I suspect the reason for the corrupted results at around 14 minutes is not because you overloaded the DMA or anything but rather because you kept adding to the ind variable until you eventually start writing outside the allowed area.
@ThePhantomviper
@ThePhantomviper 7 ай бұрын
I wish there was more Shmup tutorials I'd love to make one.
@chusmasterflex
@chusmasterflex Жыл бұрын
thanks for these tutorials Pigsy :)
@gamesexclamationpoint
@gamesexclamationpoint 2 жыл бұрын
Another great one, only thing I can’t get to work is Gens emulator command path, (windows error, cannot find.........) so i have to open it manually every time after compiling
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
Hmm, the only thing I can think of is to double check that the path is correct
@nikolaus8115
@nikolaus8115 Жыл бұрын
Thanks, I still got some blue space on top and bottom of the screen but overall everything went well :)
@airthrowDBT
@airthrowDBT 2 жыл бұрын
I just fixed the foreground so it scrolls smoothly, you have to line up the tree so it wraps around both the left and right side of the PNG and then it's smooth!
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
Nice!
@valpachman
@valpachman 5 ай бұрын
Привет! Большое спасибо за видео! У меня все получилось!)
@SeanOfEarth
@SeanOfEarth 4 ай бұрын
Thanks
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 4 ай бұрын
Thanks again for your support!
@isodoubIet
@isodoubIet 2 жыл бұрын
What's happening with the scrolling rate of 0.5 is it's being implicitly converted to int, which truncates away the decimal part (1.999 -> 1, -2.8 -> -2). It doesn't do any smarter rounding that that.
@Ratpackapunch
@Ratpackapunch Жыл бұрын
Great stuff!
@Purpbatboi
@Purpbatboi 9 күн бұрын
This video needs a update to also include SCROLL_TILES and SCROLL_LINES
@madcommodore
@madcommodore Жыл бұрын
Arcade shmup games that used 68000 CPUs always seemed to have parallax scrolling as far back as Salamander so home computer/console games that didn't have parallax didn't look arcade quality. One of the reasons why many Amiga games look a bit public domain quality in the coding because the hardware parallax was very restrictive (8+7 colours) and Amiga sprites are Famicom levels of sophistication at best.
@shannonbirt9267
@shannonbirt9267 Жыл бұрын
There were some tricks you could do on the amiga and whilst not as suited to parralax scrolling or shifting many sprites as the genesis it could do some tricks to help it a bit. It had a blitter chip , so what it could do is draw objects to the background planes very quickly , any size of blit was possible - it just too more blitter chip time so often amiga games were 30 fps so many blits could be done . The negative to this was the frame rate and it had to use the background pallete for the blitted objects (they were blitted onto the background), the benefit was blitted objects could be very large and there was never any flicker as there is no limit to blitted objects per line. So whilst the sprites were weak comparitively to other 16 bit systems the blitted objects helped make that up. The other trick the amiga had up its sleeve was the copper chip , this allowed (amongst other things) for background pallete changes per line synced with the display , its possible on the amiga to change every palette colour every line of the screen and hence games like Lionheart used this to great effect (over 300 colours on screen using a hardware 8+7 mode) . I actually wish this effect was possible on the megadrive and technically it is however its not as well implemented, if you change the genesis colours using a interupt you get cram side affects on screen , basically colour garbage , sonic the hedgehog water enter points used flickering sprites to hide this . The sprites although with many limits could actually be cleverly used as backgrounds believe it or not, the copper could repeat the 8 sprites every 8th sprite so you could repeat the sprites across the entire screen. Rtype on the amiga stage 1 has a sprite background layer !
@madcommodore
@madcommodore Жыл бұрын
@@shannonbirt9267 I have been told there is not enough DMA time for 32 colour software parallax on the Amiga 500/1000/2000 etc. You can use all the sprites as a background parallax but that leaves little DMA time for your blitter objects. 1984 vs 1988 technology of Mega Drive.
@shannonbirt9267
@shannonbirt9267 Жыл бұрын
@@madcommodore Yeah genesis was a 16 bit sprite monster, in reality only bettered by the neo-geo for the time (the snes paper specs were better but it had enough quirks that it only superior in some edge cases and for many things was worse) , I had a genesis and Amiga 600 and later a 1200. The Genesis is pretty much the playstation of its era eg easy to program for with the 68k and had simple memory layouts eg not partitioned , this was an advantage in itself. In Rtype on Amiga they did use sprites for the entire 2nd background layer and yes would have impacted DMA but the rest of the moving objects in that game are blitted (they used most of the sprites on the background) so you could still have some blitted objects when using sprites this way. The amigas sprites had no vertical limit and hence only needed their x values shifted eg no change to the animation pointers as it was a repeating image in rtype so it was simply an x update to every sprite during the scanline (serveral times). The scorpion engine (modern amiga engine) uses this technique also for 32 colour parallax and still maintains blitted objects so it is possible. Amiga was much older hardware and it showed in head to head comparisons especially in arcade ports but it did have some advantages still. It had better colour granularity with 4096 colours - the copper could change colours on screen during display without video corruption (the copper could make amiga games look VERY colourfull albiet mostly in the backgrounds not forgrounds - check Fire & Ice etc) , it had better PCM hardware (4 channels @ 28 khz) for samples vs 1 PCM channel on Genesis , it was very difficult to play clean samples on the Genesis without using the 68k to do it and that mean't blocking the z80s dma bus. On the genesis clean voice samples made you take notice, on the amiga it was a given. Check Turrican 3 on the amiga , that parrallax background is merely the copper doing a colour cycle and changing the y coordinate as the player jumped etc - that way they maintained 32 colours , however at that stage in the amigas life it still didn't compare to Mega Turrican on genesis (same game) with up to 61 colours onscreen on genesis - more on the water level actually and a real 2nd layer background , even the audio was better on genesis in the game vs the amiga which was a rare event in truth.
@madcommodore
@madcommodore Жыл бұрын
@@shannonbirt9267 The shoot em up section on Turrican II is nice on the Amiga, the rest of it is a bit underwhelming compared to half the levels of Turrican III on Amiga though. The Mega Drive had so-so sound but apart from that it had really impressive graphics, easy parallax and and easy to code powerful sprites, it's much more like a 16bit C64 than the Amiga was. Still, nothing on SNES or Mega Drive comes close to Lotus II or Shadow of the Beast 1 above ground layer on Amiga, except possibly the FM Towns I guess which had a lovely port of SotB. Even the Mega Drive sound chip is not too bad though on Gauntlet IV or Thunderforce III that I had. The real difference is how much effort went into console games compared to most Amiga games. Amiga was complex to get the maximum out of too, to be fair. In the right hands they can all make nice games though, it's just a lack of effort on the official conversions on Amiga. I got a PC Engine in 1989 to play games on anyway, I just did creative things with my Amiga 1000 until the really nice Amiga games started coming out later :)
@mostunicorn
@mostunicorn 2 жыл бұрын
You keep adding to scroll_offset variable. What happens when it reaches int limit? Does it loop around to a negative number, or do you have to clamp it manually?
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
Yes, it will just loop around to zero. I believe "int" is a 32 bit number, so it will take a while. if you use "u8" instead, then it should loop to zero when you pass 255.
@demonology2629
@demonology2629 Жыл бұрын
Subscribed 📺🕹🤘🤩🎧
@ThePhantomviper
@ThePhantomviper Жыл бұрын
How are color and palettes created? Are you working with one engine for each title? This was great tut
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials Жыл бұрын
Check out the next lesson in the playlist on How To Create Graphics, that should answer your questions :)
@airthrowDBT
@airthrowDBT 2 жыл бұрын
Also what game is that at 0:12??
@PigsysRetroGameDevTutorials
@PigsysRetroGameDevTutorials 2 жыл бұрын
Mystic Defender. An early Mega Drive game, but one of my most nostalgic!
@richarddanley2710
@richarddanley2710 7 ай бұрын
Any chance you would get into pc engine development?
@JONATHANMAZZINI
@JONATHANMAZZINI Жыл бұрын
C ou Assembly???
@MrRoccoMarchegiano
@MrRoccoMarchegiano 2 жыл бұрын
Do X but wait, don't actually, I was just showing you...c'mon man, just show me how to do what the title says.
How to Convert SNES Graphics for the Sega Genesis & Mega Drive - Beginners Game Dev Tutorials
38:30
How to Code 2 Scrolling Layers on Sega Genesis & Mega Drive - Beginners Game Dev Tutorials
21:05
Pigsy's Retro Game Dev Tutorials
Рет қаралды 2,9 М.
Остановили аттракцион из-за дочки!
00:42
Victoria Portfolio
Рет қаралды 3,4 МЛН
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12
How did this SEGA Genesis Game achieve the "Impossible"?
8:06
Coding Secrets
Рет қаралды 731 М.
How to Code Level Collision for 2D Games (Sega Genesis & Mega Drive) - Beginners Game Dev Tutorials
1:12:38
10 Hidden Gems For The Sega Mega Drive
12:13
TripleJump
Рет қаралды 43 М.
The Smallest Sega Genesis Games
32:17
Sega Lord X
Рет қаралды 84 М.
Programming portals for my DOOM-style FPS
17:15
jdh
Рет қаралды 213 М.
How to Display Backgrounds on the Sega Genesis & Mega Drive - Beginners Game Dev Tutorial (SGDK)
22:22
How to Create Palette Cycle Animations for Sega Genesis & Mega Drive - Beginner Game Dev Tutorials
14:42
Optimizing with "Bad Code"
17:11
Kaze Emanuar
Рет қаралды 210 М.
How to Use 256 Low Resolution Mode on Sega Genesis & Mega Drive - Beginners Game Dev Tutorials
10:31
Остановили аттракцион из-за дочки!
00:42
Victoria Portfolio
Рет қаралды 3,4 МЛН