Just want to be pointed in the right direction here...

Discussion in 'Discussion and Q&A Archive' started by Mr Antisocial, Nov 21, 2014.

Thread Status:
Not open for further replies.
  1. Mr Antisocial

    Mr Antisocial Newcomer Trialist

    Joined:
    Nov 16, 2014
    Messages:
    6
    Location:
    United States
    Hello everyone, I'm currently making a Sonic 1 hack, but I'm a bit stumped. In my hack, I am making 2 (maybe more later) characters playable, I set it so at the title screen if you pressed a certain button, the other character's art would load, but I wanted to make them a seperate character as a whole (load different life icon art, goalpost art, different abilities, etc.)

    Before anyone goes "We're not just gonna give you code, you fucking lazyass!" I just want to be pointed in the right direction, I don't need anyone to give me code, just maybe some tips or help to get me started. I appreciate any and all help, I'm kind of inexperienced with adding more playable characters to hacks.
     
  2. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    You're going to need a flag in a unused RAM location, which you initialise when you choose a character (e.g. Sonic = 0, Tails = 1, ...), and then you use a cmpi.b plus beq.s or bne.s whenever the characters should do something different (e.g. look for art loading and put a cmpi.b there, and so on, you might even load different layouts and songs in this way). If you use beq, you will branch to a new label if the ID of the character is the one you want (e.g. cmpi.b #$1 and then beq.s will go to code dedicated to Tails); vice versa using bne.s will branch if the character is someone else (you can use it for a Knuckles' breakable wall for example).


    Posting from a phone so excuse any inaccuracies but yeah this is as generic as I can be, good luck!
     
  3. Roxurface

    Roxurface Well-Known Member Member

    Joined:
    Oct 5, 2014
    Messages:
    69
    There are tutorials for adding different characters all over this site and Sonic Retro.  I suggest you start there.  They mainly tell you how to display different art by copying Sonic's art and replacing it; you do something similar for the move-sets, life icon art, etc.  Make a copy of it, change the copy, and have it load with your new character.  Also check out how Sonic 2 and Sonic 3&k handle separate characters. 
     
  4. Hitaxas

    Hitaxas Retro 80's themed Paladins Twich streamer Member

    Joined:
    Aug 13, 2007
    Messages:
    167
    I would say start with Markey's 68k beginners tutorial to get a better idea of how this type of assembly works.

    Then for adding new characters to Sonic 1, take a look at Sonic 2's files. If you've done enough research to understand how the engine works, it should be relatively simple.

    I won't walk you through everything, but take a look at these locations in Sonic 2:


    InitPlayers
    This routine is what tells the game which characters to load.


    Obj01

    This is the Sonic player object, if you are going to make a custom character, chances are you want to use Sonic's object as the base, as it is the cleanest and most base of the characters you could modify.

    Also, if simply reading Sonic's code isn't enough, you can try to read the guide to port knuckles to S2, this guide explains how to load up another character's art,mappings, animations and even their own life counter. Just adapt it to your own character.

    I wish you luck in your future endeavors. 
     
  5. Irixion

    Irixion Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    670
    Location:
    Ontario, Canada
    How about something short and sweet? :)

    Basically, you have to make the game ask which character to load

    You can make Sonic 0 and <Insert name> 1. Sonic 2 does this. Whenever a level loads, it asks, is it Sonic or Tails that I need to load? You can do this by making Sonic move 0 into a free RAM address, and your other character 1 into the same address. When a level loads, have the game check what's in that address, and load the appropriate character.

    On top of that you also need to have the character to load. You can do this by duplicating Sonic's object, and changing the labels (So instead of Sonic_Jump, Character_Jump, etc. so you know what's what and so the assembler doesn't freak out when you build.) You also need to give the character different art (obviously), and the things that go along with it, PLC, etc.
     
  6. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    I'm planning on making a very simple and easy to understand tutorial on, this, acyually. Be on the lookout for that.
     
Thread Status:
Not open for further replies.