Sonic 3 A.I.R. (Angel Island Revisited)

Discussion in 'Showroom' started by Eukaryot, Oct 14, 2018.

  1. Eukaryot

    Eukaryot Newcomer Member

    Joined:
    Oct 10, 2018
    Messages:
    6
    Hey folks!
    I just thought I‘d take a chance, register here in the forums and present the project I‘ve been working on for the last two years.
    It's not a ROM hack, but a standalone port of Sonic 3 & Knuckles.

    You might know it already from the SFGHQ forum, or an earlier version submitted for SAGE 2018. But I felt like a showcase thread was missing here, where I can go more into details about the technical stuff.

    [​IMG]

    Sonic 3 – Angel Island Revisited (Sonic 3 A.I.R.)

    A straightforward port of Sonic 3 & Knuckles for PC, with some fixes, improvements, and widescreen support (at 400x224 pixels).


    About the project

    The main goal here is to provide a very accurate, but slightly modernized version of S3&K. Trying to stay very close to the original, but also adding new features and a few gameplay tweaks to iron out some of the small annoyances of the game.

    In addition, this is also a playground for adding some more experimental features, like an unlockable Knuckles & Tails mode and a Time Attack that allows you to race against multiple ghost versions of your previous runs.

    [​IMG] [​IMG] [​IMG]


    Technical background

    The game runs on a direct port of the original game code to a custom script. No emulator involved here, it can only execute what was ported to script already.

    The script language is quite simple, and was designed specifically for the purpose of resembling 68K functionality (registers, memory access, etc.) in a more high-level language way. This is a necessity, as I‘m quite bad at working with disassembly. :(

    An additional aim for the script language was to allow for automatic conversion of 68K code to script, so that I‘m having a basis to start from when porting over stuff.

    Here‘s an example:
    [​IMG]

    On the left, the disassembly (this is from the Sonic Retro Github), here a small piece of code from the Blue Spheres special stage.

    The center image shows the same piece of code in script, after automatic conversion of the 68K machine code from the ROM. Variable and function names have been replaced here already, taking into account all definitions added manually in script before.

    And on the right side, the end result with some manual refinements and commenting.

    The manual rework usually includes only few changes to make the code work and do the same thing as in the original game. Except when VDP commands are involved, these have to be manually translated into custom rendering commands.

    And of course, the obvious downside of this approach: Manual changes whenever a functionality does not work with widescreen out-of-the-box – this includes things like changing object positions, screen border limits, or taking care of empty spaces / visual garbage that would not get visible in the original 320x224 resolution.


    Requirements & Download

    Sonic 3 A.I.R. still uses the Sonic 3 & Knuckles ROM just as the original game code (inside the ROM…) does, so that exact ROM is required to play A.I.R. - in this case the ROM that is part of the Sonic 3 & Knuckles Steam release, or a S3&K ROM that is fully compatible to it.
    If you have the Steam version, A.I.R. should automatically find the ROM on first startup.

    Download of latest version:
    http://sonic3air.org/downloadgame.php
    (This version now also includes the remastered music done by GalacticG a.k.a. DJSpindash, more info here on SFGHQ:
    https://www.sonicfangameshq.com/forums/threads/sonic-3-a-i-r.221/page-4#post-2530)

    Last edit: Update after full release
     
    Last edited: Apr 6, 2019
    DeltaW, Angel X, EMK-20218 and 16 others like this.
  2. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    This is very fascinating stuff, and I congratulate for taking the time to work this out. I have yet to try this out (specifically because SHC is taking most of my free time - and since I am making a S3K hack, I do not want more S3K in my life lmao), but I am definitely wanting to look at this when I have some more time on my hands. Also, after working with S3K so long, I can definitely understand the pain that is recreating this... Mess! Any possibility of maybe seeing the source (or parts of it) to help, with my gained knowledge, to create better documentation for this game? What about mods, are you planning on letting people to mod this? This could have some very fantastic possibilities as far as modding goes. Also planning to fix bugs in the original game? Because I sure as hell know tons of them and easy ways to fix them.
     
    Eukaryot, MarkeyJester and AkumaYin like this.
  3. Eukaryot

    Eukaryot Newcomer Member

    Joined:
    Oct 10, 2018
    Messages:
    6
    Thank you very much!
    This means a lot to me, especially from someone making a hack as impressive as Battle Race. Honestly, even after more or less replicating the basic VDP functionality, I'm still wondering how you and MarkeyJester did most of the transition effects. This is just amazing!

    At the current project state, I don't want to share the complete script code, it's essentially the source code of the game. But parts of it is totally fine - I just don't know which parts would be most interesting to you. Feel free to PM me (for now, only on Twitter @Eukaryot3K, or on SFGHQ)!

    Here's a public starting point already, of only a few script files: http://85.214.142.96/sonic3air_script/sonic3air_script.zip
    This includes the script with all the variable definitions at fixed RAM locations that I've added so far (in "defines/defines_global.lemon").
    When having a look into the scripts, please don't wonder too much about some strange namings. Many of the variables got their names without checking other resources, like the Sonic Retro Github disassembly or RAM documentation.

    I'm thinking a lot about this topic.
    The problem is, as long as I'm not finished with the script, and consequently am making lots of changes / renamings / refinements even to most basic stuff, making scripting publicly available is more or less off the table, making any kind of code modding hardly possible at all. This might change later on, of course, but I don't want to make promises here.
    That still leaves modding of resources like level layouts. Probably I'll sooner or later add some kind of compatibility with SonLVL, like loading of bin files for level object & ring placements.

    Indeed I am planning to fix all the bugs I can get my hands on. This is most of the fun of this project, so I'm being selfish here and try to do as much as possible on my own. Especially the easy ones. :)
    However, bug fixing is not high priority at the moment, not as long as there is so much other things to do - completing the port, fixing the widescreen issues, and especially making my own experiments with the game (I never got into ROM hacking, so this is my first chance to try out all the things I've always wanted to change).
     
    Last edited: Oct 14, 2018
    AURORA☆FIELDS likes this.
  4. Unused Account

    Unused Account Well-Known Member Member

    Joined:
    May 10, 2013
    Messages:
    153
    Would this happen to be a spiritual successor to Sonic 3 Complete of sorts? I would love to have a more modern S3C experience maybe with a dropdash and no worries about having to generate a new rom for graphical changes.
     
  5. Eukaryot

    Eukaryot Newcomer Member

    Joined:
    Oct 10, 2018
    Messages:
    6
    Not really, sorry. Though I'm adding a few changes from S3C, there are no plans to reimplement all of it.
     
  6. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    It involves a lot of timing and some quite cool code - but I am not going to spoil the exact tricks, for obvious reasons =P


    Mostly I am very interested in object code, object library and the level rendering codes for now, those generally have really poor documentation and it would certainly help me a lot in building up some. However, I shall contact you about this when I actually get to it.

    This is one of the things I am looking to do; Create good and well documented naming scheme for variable names and routine names. There is little consistency on the Git disassembly so that is definitely something that needs changing.

    Well given you seem to know a lot more about the base game than most anyone on the scene, I doubt you'd have too much trouble picking up hacking lol
     
    Eukaryot likes this.
  7. Eukaryot

    Eukaryot Newcomer Member

    Joined:
    Oct 10, 2018
    Messages:
    6
    Now you got me even more curious. :)

    Alright, I'd be happy if the scripts can help you improve the documentation. Just let me know!

    Yes, a consistent naming would be a very good thing.
    And I'd be very interested in taking over the names afterwards into the scripts. Maybe it makes sense to make some script name changes beforehand already, like for functions and variables that are very frequently used - things like the "Draw_Sprite" vs. "RenderObject" in the first post's example screenshots.

    Oh, don't overestimate... :D
    One double-edged property of the automatic script porting process is that there's no actual need to understand what the code does. Of course, things get more interesting as soon as there's a fix, widescreen adaptation or other extension needed. That's usually the point where I start to dig into the code and comment it. But huge parts of the scripts did not need that treatment yet, and are actually still quite coarse.
     
    AURORA☆FIELDS likes this.
  8. TruffledToad

    TruffledToad Mushroom says, mushroom does. Member

    Joined:
    Feb 2, 2017
    Messages:
    69
    Location:
    The United States of Americaca
    A Sonic 3 hack with promise? Well slap my face and recite the hedgehogsoup copypasta! I'll be sure to try this out when I get back home!
     
  9. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    @TruffledToad Give the first post a bit of a closer look, though I don't blame you for assuming this is a hack considering what forum is about.
     
    TheInvisibleSun and AkumaYin like this.
  10. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    Yeaa, using the insane naming schemes for the S&K disassembly is no good way to keep yourself sane. I am sure at this point I am not anymore.

    Well I can count with my fingers the amount of people I know have a good enough grasp on the actual game, its objects, and the code. And then some of these people are not all that technical either, and more know it because they have made layout hacks or whatnot. So while you may try to claim you have very little knowledge, so does everyone else =P
     
  11. TruffledToad

    TruffledToad Mushroom says, mushroom does. Member

    Joined:
    Feb 2, 2017
    Messages:
    69
    Location:
    The United States of Americaca
    Oh. Well there goes me being dumb again. Still looking forward to this though.
     
  12. Trickle

    Trickle Newcomer Member

    Joined:
    Jan 18, 2018
    Messages:
    11
    Amazing job Eukaryot! It's so great to finally play Sonic 3 in widescreen. It's a shame Sega won't greenlight Taxman and Stealth's pitch. But this is the next best thing! Maybe there will be S1 and S2 ports like this one day. It would be nice to not have to resort to BlueStacks to play those wonderful remastered versions. I'm definitely excited about this project!
     
  13. Eukaryot

    Eukaryot Newcomer Member

    Joined:
    Oct 10, 2018
    Messages:
    6
    Hey everyone,
    I just wanted to give you an update on S3AIR, as there has been quite some progress since October.

    First of all, the latest demo at http://85.214.142.96/sonic3air_demo.zip now includes 8 full zones, save states, and a widescreen version of the Sonic 3 intro / title screen. So everything is on a good way to have the complete game actually finished in not-too-late 2019. :)

    Aside from the actual game content, I'm also trying to extend the very limited modding capabilities - most recently by adding support for at least some level modding with the SonLVL editor. There's a little video demonstrating how it works from a modder's perspective:


    Level modding currently only supports level layout, object placement and ring placement binaries as saved by SonLVL. If someone likes to get involved in S3AIR level modding, feel free to give it a try and let me know what else could be interesting.
     
  14. Eukaryot

    Eukaryot Newcomer Member

    Joined:
    Oct 10, 2018
    Messages:
    6
  15. Razor

    Razor Well-Known Member Member

    Joined:
    Oct 8, 2014
    Messages:
    50
    Location:
    Moscow
    From now on this will be the definitive way to play Sonic 3 & Knuckles for me.
     
  16. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    That trailer looks so cool~

    Unfortunately, I do not own the Steam version, so I won't be playing it, but from what I've seen of playthroughs so far, it is quite the true rendition so far!
     
  17. Pokepunch

    Pokepunch That guy who posts on occasion Member

    Joined:
    Aug 7, 2009
    Messages:
    270
    Location:
    UK
    You don't actually need the Steam version to play it. If you don't own it the game will ask you to locate a S3K rom to use.
     
  18. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Is that so?

    In that case, I'll have to find the time to actually play it!
     
  19. TruffledToad

    TruffledToad Mushroom says, mushroom does. Member

    Joined:
    Feb 2, 2017
    Messages:
    69
    Location:
    The United States of Americaca
    Barring a few glitches here and there (I distinctly remember Knuckles getting yeeted across the stage by a Madmole's mushroom), this feels really close to the real thing, and the fact you got it done in such a short period of time is incredibly impressive. The thing I'm most interested in is the modding capabilities. Music hacks are going to be easy, but I wonder if there's anything else that could be unearthed here...

    Seriously though, if you have a Sonic 3 ROM, get this, it's SOOOOOOOOO GOOOOOOD.
     
  20. maple_t

    maple_t Exists Member

    Joined:
    Jul 5, 2018
    Messages:
    57
    Location:
    a rock and a cold place (Canada)
    This is really cool! But, while I was playing I found a weird bug that crashes the game outright. If you press the PrtSc key the game just gives up and crashes I guess.

    Other than that, this is wonderful!