don't click here

Wanna learn how to make a boss?

Discussion in 'Engineering & Reverse Engineering' started by jman2050, Apr 22, 2006.

Thread Status:
Not open for further replies.
  1. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    634
    4
    18
    Saturday April 22nd, I will be holding an online IRC tutorial that will explain how objects work, and more specifically how bosses in the Sonic 1 and Sonic 2 engines work. Hopefully this knowledge will help would-be hackers in their quest to further pwn both of these games. So why not just post all I know in a topic on these forums? Well, I figured that those who participate would greatly appreciate the ability to ask questions in real-time, while receiving an answer before other subject matter is presented. And it's much more effective on my end to do this, since not everyone would understand the commented ASM code I would provide otherwise :P

    Anyway, the IRC event will be held at 4PM EST TOMORROW, at the #s2b channel of irc.afternet.org. If you don't know how to get to IRC online, go to the pinned topic in the Members Lounge and see there. What will be covered in this event is

    * A basic outline of how objects are processed in the Sonic engine
    * A general outline of the SST, not covering everything (I'm not sure I even remember everything), but covering enough of the SSt entries to be able to understand how bosses work.
    * A comprehensive dissection of the GHZ boss from Sonic 1, explaining how it's initialized, how the child objects are loaded, and how bosses handle the SST

    For this event, I recommend that EVERYONE have a Sonic 1 disassembly handy. Everything presented will be applicable to Sonic 1, and by extension most if not everything presented will be applicable to Sonic 2. Don't ask about Sonic 3, but I'm sure the process is very similar anyway. After tomorrow's event, a log will be posted of the entire conversation, and if it proves to be a success, follow up IRC conferences will be held that will get to the nitty gritty of how you can make a boss from scratch.

    Hacking layouts and palettes is fun, but with full disassemblies at our disposal, we have a massive untapped potential within our grasp. All it takes is a bit of understanding and elbow grease, and soon we'll not only be building bosses, but our own versions of corkscrews, CPZ pipes, and Casino Night slot machines. Will you be there when that happens?

    So remember,

    How bosses work
    #s2b
    irc.afternet.org
    4PM EST, 1PM PST, 9PM GMT

    Be there, and be part of the next generation of Sonic hacking.

    EDIT - Also, if the times have to change (who knows what might come up), I'll try to alert everyone as soon as humanly possible.
     
  2. Qjimbo

    Qjimbo

    Your friendly neighbourhood lemming. Oldbie
    Awesome stuff, I'll definatly be attending! :D Oh and for those of you without an IRC client you can use the online java applet here.
     
  3. Shade

    Shade

    Member
    Unfortunately, I will be out with my friends seeing the Silent Hill movie and going to an MSA dance production one of my friends is in. So no can-do for me, unfortunately.

    Might I suggest a log be kept, saved, and then posted in this topic?

    FUN FACT: MSA is ASM backwards :P You know you have problems when real life and S2B start to intertwine.
     
  4. Tweaker

    Tweaker

    Banned
    12,387
    2
    0
    I'll try to come if I can... I definitely like the idea.
     
  5. Sparks

    Sparks

    Member
    3,144
    182
    43
    Sondro Gomez / Kyle & Lucy
    Dang it you can find me there. I just need that Sonic 1 Dissasembly. And to learn more about what I will need to know. D=
     
  6. Robjoe

    Robjoe

    Member
    Hmm, I may attend, even if I may not understand some stuff. This sounds great.
     
  7. stormislandgal

    stormislandgal

    It's not a phase! Tech Member
    4,534
    10
    18
    Married life <3
    Aagh, I'll be in court tomorrow at 4pm... Ah well, I've only got a semi-will to hack Sonic anymore. Still this woud be some interesting stuff to know.
     
  8. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    I'll give it a miss as well. I'm supposed to be out seeing someone tonight and I'm not changing plans. I'll probably be able to do it already anyway, since it's really only an advanced object, and objects are pretty easy.
     
  9. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    I'll be there and I'll log for those people who like reading logs.

    Also, could somebody come up with a list of subroutines? It's rather standing in the way of any object-making for me.
     
  10. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    634
    4
    18
    Just a minor note, I'll be personally using Hivebrain's 2005 Sonic 1 disassembly, so make sure that's the disasm you're using when this takes place.
     
  11. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    I'm guessing you wanna know which subroutine contains what data in an object. Well from my experience, it's something along these lines:

    Setup Subroutine: Clears D0 and sets up subroutine offset index
    Subroutine 1: Initialisation (Load Mappings, VRAM, collision type etc)
    Subroutine 2: Animation Loading
    Subroutine 3: Collision Effects (Playing the sound, changing collision properties etc)
    Subroutine 4: Collision Animation (Load animation script and display sprite routine)
    Subroutine 5: Other Effects (Usually used for loading Delete Object routine or just for RTS)

    That's basically it, but if you want to spawn child objects, in the initialisation you would do something like:

    lea ($(SST Address),a1
    move.b #$(object ID),a1

    OR

    move.b #$XX,($FFFFYYYY).w

    Where XX is object number and YYYY is SST ram location, by multiple of $40, from B000 and CFC0 (I think it's CFC0 anyway) - S2

    S1 - D000 - EFC0 (Again, I think)

    This will load a child object, which should obviously be programmed to be relative the the master object in terms of bosses, such as the EHZ drill piece is. It's something along those lines anyway.
     
  12. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    No, those are routines. I want to know about subroutines - things like SpeedToPos and ObjectFall. I want a list of those with their inputs and outputs.
     
  13. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    Ah I see what you mean now. I'll list them all later on with their functions, coz there's too many to list now and I haven't got enough time.
     
  14. Sonic Hachelle-Bee

    Sonic Hachelle-Bee

    Taking a Sand Shower Tech Member
    806
    200
    43
    Lyon, France
    Sonic 2 Long Version
    Yes, bosses are only advanced sprites, as Stephen already say. That's not that difficult, just time consuming.

    About Quick Man request, yes, this is a good idea to make a list of all these subroutines. This would be pretty useful for a lot of people here that start to learn sprites programming.

    Huh... Yes and no. I agree about the first subroutine (I call that subparameter because it's linked to the second sprite ID number and it's not necessarily a subroutine) usually initialise the object and its childs. But you aren't forced to follow that plan. A sprite can contains only one or two subparameters, and several sprites can be done with one ID by just changing its subparam value. Think about the Buzzbomber, it contains several subparams. One of them is the fireball child object, 4B 04 if I remember right, and it's only used for that.

    About subroutines, here are some quickly:

    $164F4: Basically, call that subroutine to draw a sprite on screen (obviously, mappings pointer VRAM and etc... should be initialised).
    $164E6: Erase object from SST, write 00s. The object simply disappear.
    $163AC: Move the object on screen, accordignly to its X and Y speed. 10(a0) is X speed and 12(a0) is Y speed.
    $17FFA: Search for a new SST entry to create a child. Return the address of the new entry in a1.
    ...etc

    EDIT: Oh and yes, that's for Sonic 2.
     
  15. The Mighty Boosh

    The Mighty Boosh

    Stupid like a FOX! Member
    Okay, here are the logs, one I cleaned up myself in .rtf format, and the other is the raw chatlog in .log format, just incase some of you don't trust my judgement. The clean version has Jman's text in bold blue, text I thought was relevant in bold black, and other stuff in plain text. Lots of stuff has been deleted, and I hope I haven't deleted anything important, but the raw chatlog is here for you to use too.

    Clean version
    Raw chatlog

    Hosted by my lovely girlfriend. :P
     
  16. Ultima

    Ultima

    Games Publisher Tech Member
    2,398
    1
    18
    London, England
    Publishing mobile games!
    A correction on something I said in that log:

    <Ultima> animation iirc

    It's actually the width of the object in pixels =P
     
  17. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    634
    4
    18
    I wanna thank everyone who participated. Though it didn't move as quickly as I wanted it to (and I had an engagement that forced me to cut the lesson short), it was a huge success, and there's no doubt it'll be happening again. You think I should make this a weekly thing? Perhaps always on the weekends?

    EDIT - Oh, and thanks to THeMightyBoosh for providing such an awesome log :thumbsup:
     
  18. The Mighty Boosh

    The Mighty Boosh

    Stupid like a FOX! Member
    A weekly thing sounds good. I usually have Saturdays free, and ALWAYS have Sundays free, so weekends are great.
     
  19. SGR

    SGR

    Give me the gams. Member
    Weekends would be nice, but I'd prefer it's held around 5:30-6:00 PM EST.
     
  20. ddrmaxromance

    ddrmaxromance

    Member
    477
    0
    0
    Agreed. Either day would work. Very nice log, I'm surprised to have a line in the clean log. :D
     
Thread Status:
Not open for further replies.