Sonic 4 in 1

Discussion in 'Showroom Archive' started by AURORA☆FIELDS, Nov 1, 2016.

Thread Status:
Not open for further replies.
  1. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    Hello! Time for a late-release of just another hack. So whats it this time? Why, it is;
    Sonic 4 in 1!
    [​IMG]

    I am guessing, many of you would remember Vladikcomper's awesome hack Sonic 3 in 1? I used to think it was something really cool, but it kind of lacked something... Another game maybe? Oh yes, it would have to be Sonic & Knuckles! It's really shame since I've not played that game too much, so it definitely felt like a big piece missing. So I had a thought, would it actually be possible to fit all the games in. As an added challenge, and because there still is not a completed Sonic 3 disassembly around, I could not exactly do a lot to it. I thought I'd rather try my best to modify the games as little as possible (With few exceptions) and make the games still co-operate in a single ROM. If you want to read more boring backstory, open the spoiler here:
    Despite what I will end this with, it was actually surprisingly easy hack to do. Even though pain in the ass in the end, I was expecting it to be nearly impossible and have a lot of issues it really didn't end up having. At first I had to work out few limitations imposed by the massive 4 bytes of RAM I could afford. There were some weird issues, like Sonic 2 having to use REV02 because if not... Well the sound driver doesn't work. Why? Who knows, but at least REV02 somehow works. But me being me, I had to take the fancy route, and add a huge nice menu on top of everything, so I ended up working on it for months, rather than few days.

    I had a great plan from the start though, and thanks to a collaboration I did with flamewing a fair bit earlier, he made this tool called gen_scaler. This tool was amazing; It could create code that would horizontally scale image of any height and width, into any height and width buffer. What this basically meant, that the code I wanted to implement for scaling the menu like you see in the final product already existed, I just had to implement it! However, there were many complications. First of all, gen_scaler was actually really buggy and did not scale correctly. I had to bug FW to fix it, but to my pleasure he made it almost perfect. Some artifacting can still be seen but its not easy to see. Then, I realized that I would need to do some complex coding just to get the vertical scaling, palette change and image rendering work in unison. It was completely impossible to even just get the vertical scaling with image rendering working and so I abandoned the idea. I told fw that I needed him to make a vertical scaler also. Then he asked the million dollar question; "Why not just use the existing gen_scaler code to also scale vertically at the same time?" It didn't even occur to me you could do it, but I tried, and in few hours I had hacked together this feature. It was legendary; It made the rendering time take ~3 frames instead of ~8 frames, it solved the entire mess of vertically scaling, AND it was really simple to implement! Even given I got the code wrong at first, it still worked well!

    So then what, I now have a nice scaler code, a basic menu framework and the games sort of work. Oh except, no they really don't. There are a lot of glitches, few crashes, and no Sonic 2 & Knuckles either. Well shit, turns out the disassembly for S2K is really terrible and outdated. A lot of the lables are just plainly wrong, and even in some cases the right routine is commented right after the wrong one. This would be fine, except I use Sonic 2's exported symbols in S2K to gain the addresses, so effectively the game is broken. Furthermore due to differences to originals, it wouldn't even boot. I spent a lot of time debugging and patching things up until I got everything working here. The other games are fairly easy, with the odd crash in Sonic 3.

    At this point, the menu, although looks rough, works mostly. Now is the time to make it all shiny and "complete". You would think this is a quick process. But we were only like 2 months in! During this time I worked on the menu, GF had been working away at the Sonic 1 and Sonic 2 image art. And I have to hand it for him, he did some amazing work given the huge limitation of max 15 colors. No more, no less. If you are less experienced artist, and have to cope with this insane limitation whilst making vibrant and good looking scene, it can be really daunting task! Even though he had hard a time with this, he did a great job imo. VAda came in help at some point too, but the main work was up to GF. This gave me the possibility to test the rendering code better and see how it would look. Later when the Sonic 2 image was added, I first noticed how bad the vertical renderer really was. However with little tweaking it was soon fixed.

    So, next it came to implenting more of the menu. The menu text I decided to generate with a variable width font generator I had made earlier for a friend. However, I needed a nice looking font. So I decided to make a tool that would convert fonts from a png file to data files for this generator. That took me quite a while to get down. I also needed a menu background, so in this process I went digging to the World Of Illusion source code, and found the required files as well as other cool stuff. Finally the menu not only looked nice, but was also functional. Somewhere around this time I implemented the Game no Kanzume sound driver, to even add music in.

    Of course I had to take the high route and add Sonic Retro and SSRG splash screens in. However, due to their complexity, and the messy nature of my implementation, actually getting them to run involved a lot of research into Sonic 3, as well as fixing a lot of oddities. However, after many days of work, I get both up and running. Of course, I still needed to entirely program the "scripts" for SR. These would actually move the sprites around and make all the effects appear. I got a heart-attack when I tested on hardware though; nothing works. After hours of banging head to a wall, I realize I need to clear PLC's. I didn't notice this because emulators clear the RAM on boot-up, unlike flash carts. Crisis avoided.

    Of course I had to add few secrets in. It took me quite a while to write up one of the secrets, while that I was also doing bugtesting and doing other interests. I can't really work if I am watching a video or talking with someone, I need to actually really focus on what I am doing, and that's why writing everything was quite slow for me. I was also running awfully thin in time, and I realized that the amount of stuff I had to do for these last 2-ish months was huge. I started working harder and harder to get at least most done. I had to also hurry GF about the art (sorry mate), and unfortunately he could not find the time to make all of them. I however, had a lot of other plans, and I started getting more and more stressed about it.

    During the last 2 months I got most of the work done, even though the game had the main skeleton done already, in the last months and weeks of development it got the polish what I always strive for. Also a lot of additional things, such as the secrets, code optimization, fixing issues (like the rendering bugs, I finally made it nearly perfect), and fixing many small issues in the game. Though, with few weeks left, I let RHS test my game on hardware, and it didn't work. I was confused because I had tested on hardware and it was fine, but apparently due to not clearing RAM correctly, the splash screens broke completely. I was pissed off about it due to the main menu and games (mostly) working! After multiple hours of pulling hair out, even after trying to fix the bugs and clear all kinds of RAM, I finally got it. The problem was the damned moveq bug in ASM68K. For those who are unaware, ASM68K would not allow you to input numbers higher than $7F to moveq, and would require 32-bit signed number to be entered. This is fine, but instead of terminating assembly, it warns you about it and puts in $61 instead! And I have warnings disabled in my hack's assembly. Epic fail. This is why I had to debug these issues I thought I fixed by clearing RAM for hours. When I was about to give up, filled the RAM with garbage, and tried on emulators, I finally was able to reproduce the issue myself. I look at the listings file, and notice that $61 in there, mocking me like an idiot. Needless to say it was a simple fix, and I was frustrated but relieved that it ended up being so easy fix to do in the end.

    So, this leaves up with the last days to submit. I was tired, broken, and about done with the hack. I had to cut down on some features, and some things I couldn't quite finish. Soon, my dearest sexiest friend djohe would complain about a few glitches in Sonic 2. He soon realized I used REV02, and told me off for it. I explained other revisions didn't work, but because Sonic Team, REV02 actually had some flipping issues and other glitches. I was able to hunt these down, fix them and move on. I was relieved that he didn't complain about anything else on Sonic 2 after that.

    Then I played through most of the games my testers didn't, and notice something strange in S3K SSZ. One of the "clouds" are all glitched up! Holy shit what do I do?! I was just about to give up, I could not care less about fixing it anymore, but my dearest sexiest friend djohe wouldn't shut up about it. So with literally only couple hours left til submissions would be supposedly closed, I look at what he found, and could not find anything wrong. Until I saw another mappings file, for the bigger "clouds". It saw something intriguing, the art tile pointed to $7C0. I realized immediately, this was loading a masked sprite! I was toying around this code earlier, because I did not understand at all what it meant, until I removed it and saw its effects. I tested this using the S&K disassembly from my hack. I went to look at the code, and who knew, I forgot to change branch back to the original one, which basically meant it will try to show any masked sprite normally, instead of hiding it. I am glad I went to fix this, because it would have been an embarrassing bug to leave in haha!

    That is roughly what the development of this hack was like. It was a huge rollercoaster of self-harm. Trying to do something like this is definitely not easy, and requires a lot of hitting your head against the wall to get through. But I am glad I did, because this has taught me a lot of lessons, and I think I can do a lot more as a result. This was one of the most frustrating projects to work on, and definitely probably the most stupid ones too. The worst part about working with 68000 is definitely debugging something that you cant really easily debug, as well as trying to do something that the 68000 really shouldn't even be able to do. This project is basically 99% of that. Fucking hate that shit, trying to make 5 different games co-operate together is basically trying to bake bread with your dick. It's not easy and it's not fun.

    So, I have decided to submit this hack as open source. Although the download version is different from what the source offers, you may understand why I can not distribute Sonic Retro splash screen code, SSRG splash screen code, few things done to me by people who are yet not willing to release their work onto public, and may want to keep it secretive (hi Vladikcomper =P). I also do not want to spoil the secrets right away; I will want you to find the secret codes yourself by any means you deem necessary. So! Without further ado, have teh download linkz!






    There's a few problems with running hacks like this; This uses some features of the Mega Drive that are pretty much nonstandard, so not all emulators or hardware will support it. I've made a list of things that I know that will be able to work with this:
    • Mega EverDrive (hw) - Full support
    • EverDrive MD (hw) - Full support (Seems like on older models it may not work)
    • Carts with no mappers - No support
    • Fusion 3.64 - Partial support
    • Regen - Works only if LargeROMSpace is set to 1.
    • Gens re-recording - No support
    • BizHawk - SRAM saving does not work (Issue #695), and has randomizer issues
    • Genesis Plus GX - May or may not work, tests done earlier seem to disagree with tests done later. Needs further testing.

    Some unfortunate bugs also exist due to the way this works. Namely, color artifacts onscreen, that would have been previously hidden. Notably happens in Sonic 3 and Sonic & Knuckles, but may occur on other games abnormally too.

    Aaand... *drumroll* Here's the credits (aka who made this even possible in the first place);
    • Natsumi - Menu program, skeleton, game fixes, variable width font, custom Sonic Retro scripts & compatibility
    • flamewing - gen_scalers (horizontal software scaler program)
    • GF ThePlayer - Main artist
    • VAdaPEGA - Helping artist (Sonic 1, Sonic 2)
    • ValleyBell - Sound driver disassembly
    • Vladikcomper - Music, SSRG splash screen
    • Marc - Music, Sonic Retro splash screen
    • MarkeyJester - Animation and misc help
    • djohe - Testing
    • RedHotSonic - Testing (And debugging (tons of it! Thanks man))

    Also I want to mention that just 3 weeks ago, my 5th year on these forums came full. It's been one hell of a ride, but I enjoyed it myself, and I am glad all of this happened to me. It has meant a lot more than many of you could imagine. Also just a week later I also had my 19th birthday, alas wasn't able to get this ready to celebrate it. Here's a toast for these 5 years, and for the next 5 years! Cheers! have a sekret
     
    Last edited: Jun 9, 2017
  2. โบวี่

    โบวี่ Tsingtao Enjoyer Member

    Joined:
    Dec 27, 2011
    Messages:
    215
    [​IMG] [​IMG]
    You might want to think about fixing the splash screen for what I'm supposing has Knuckles on it. Or is RHS a sponsor of your hack?

    Otherwise, nice job on the hack! It's nice to have all the classic main series Sonic games on one ROM.
     
  3. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    The effect is actually intended.
     
  4. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    upload_2016-11-1_19-28-10.png
    "Fusion stopped working"

    Not sure how, it worked just fine the previous reset. It happened after pressing Up button.
    EDIT: I can't reproduce it anymore

    Otherwise, neat work!
     
    Last edited: Nov 1, 2016
  5. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    Uhhuh, this is worrying. What exactly did you do before this crash? Did you play any games and if you did, which ones?
     
  6. Devon

    Devon Down you're going... down you're going... Member

    Joined:
    Aug 26, 2013
    Messages:
    1,372
    Location:
    your mom
    The same thing happened to me. It only happened on the first run, and it happened when I pressed up on the menu when it booted up.
     
  7. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    0x37CB54 - 0x37DD89

    Anywho, this is a really great hack Natsumi! GF's art is spectacular, and as Bakayote said, it's nice to finally have all of the Sonic games in one.
    My only small nitpick is that there's no way to return to the game menu from the game (besides resetting, of course). Not sure you would want to go about implementing that, but it's not a big deal.
     
    FireRat likes this.
  8. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    I definitely can not reproduce the bug, I think I booted Sonic 3 alone at first and then it crashed with the first reset. If works everywhere and flawlessly on any other run, it could be Fusion's issue somehow.

    Now, the only "true" bug I really found so far, is that you can press a direction button the first frames the menu has loaded, so the sound will play but not the background music.
     
  9. DevEd

    DevEd A lol who occasionally doge nothing Member

    Joined:
    Oct 12, 2012
    Messages:
    268
    Location:
    Somewhere...?
    I like how this has Lock-On Technology™ built in. That being said, in Kega Fusion 3.64, if you select Sonic & Knuckles, make a savestate, select any game, load the savestate, then press any button, the menu will freeze. I have no idea why that happens, just thought I'd bring it up.
     
  10. LuigiXHero

    LuigiXHero Well-Known Member Member

    Joined:
    Mar 22, 2014
    Messages:
    280
    If you hold A, B, or C on S&K so that it will switch between S&K and the lock on menu and hold Enter you'll heal the confirmation sound and the music will stop but it'll stay in the menu.
     
  11. LordXernom

    LordXernom Well-Known Member Member

    Joined:
    Aug 12, 2012
    Messages:
    763
    Isn't too early to showcase hack, that's on SHC 2016 list? It would kill surprise value of your entry. (just curious about it)
     
  12. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    I have calculated this move to release this hack on the forums very carefully. While you may disagree with my reasons or the decision, I've thought myself its the best thing to do. Also as far as these bugs, I will get to them proper after hacking contest week. Unfortunately with only few days for it to take place, and with the nature of most of the issues, I will have to take time to get them fixed, and therefore you have to bear with them (or use another emulator, seems like Fusion just does not work right at all, it may even be incompatible with this unfortunately.)
     
  13. LuigiXHero

    LuigiXHero Well-Known Member Member

    Joined:
    Mar 22, 2014
    Messages:
    280
    Well It works fine in Fusion for me. Also since it's a really hard to reproduce bug when it comes to the crashing. I wouldn't throw it out of the window completely. Especially since it doesn't work in regen and not many people care enough to download bizhawk.
     
  14. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    This wasn't in the testing that I did! I could have given you my actual "redhotsonic Sonic Retro Splash screen" from S2R if that was the case =P


    Also, to this day, I still don't get the intended glitches on the splash screen.
     
    FireRat, โบวี่ and Devon like this.
  15. TheBlurCafe

    TheBlurCafe Welcome to TheBlurCafe! Member

    Joined:
    Sep 6, 2016
    Messages:
    101
    Location:
    Somewhere
    I have to admit, the art process can be summed in "rush hour".
    It wasn't hard or anything but the lack of time at my favor was really preoccupying, thankfully I still managed to finish the art, and I must thank Natsumi for asking me to do it.
    Great hack, nonetheless.
     
    FireRat likes this.
  16. EMK-20218

    EMK-20218 The Fuss Maker Exiled

    Joined:
    Aug 8, 2008
    Messages:
    1,067
    Location:
    Jardim Capelinha, São Paulo
    I found a bug in the Sonic Retro screen that happens when Sonic starts his animation on it.
     
  17. TheBlurCafe

    TheBlurCafe Welcome to TheBlurCafe! Member

    Joined:
    Sep 6, 2016
    Messages:
    101
    Location:
    Somewhere
    That's intended.
     
    EMK-20218 likes this.
  18. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    I would like it if you read the second comment on this thread?
     
    EMK-20218 likes this.
  19. EMK-20218

    EMK-20218 The Fuss Maker Exiled

    Joined:
    Aug 8, 2008
    Messages:
    1,067
    Location:
    Jardim Capelinha, São Paulo
    Ouch... Did I misread it. Sorry.
    So that was on purpose? Oh, gosh... I was fucking troll'd. :oops: *runs*

    EDIT: Forgot to say how I like these zoom effects on menus. Art is impressive on it too. Great work!
    EDIT 2: I thought it was really a glitch. Now I'll have to change the title of my video. Hahahah!
     
    Last edited: Nov 2, 2016
    B. Comet likes this.
  20. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Not a bug, but more of a visual tiny detail: Some old TVs also tend to crop the output's edges. Much of it is compensated with the color border, but some monitors even eat the first tile (8 pixels) from each edge too. Some pirate games seem to forget about this, and heck it was annoying to play with cropped HUD and texts years ago. Others said it was unprofessional.
    I don't know you but I'd shift the film reel 8 tiles to the right, and move the (A)CANCEL sprite other 8 pixels to the left.

    EDIT: Oops.
     
Thread Status:
Not open for further replies.