Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. JeffCharizardFlame

    JeffCharizardFlame Escape Reality and Play Video Games Member

    Joined:
    Jan 27, 2013
    Messages:
    37
    Location:
    United States
    Well, I've finished step 1 of my hack: find sprite sheets. That's the easy part. X3

    Now I'm coming up with a story idea, that might replace the story of the original game, but is kind of similar.

    Amy alone/Cream alone + Amy and Cream story:

    Amy and Cream arrive on Angel Island to find that Rouge is there already, searching for the Master Emerald. Eggman is looking for it to, so he has hired Rouge to find it, so he can use it in the Death Egg, which has risen once again. Sonic, Tails, and Knuckles are on another adventure so Amy and Cream take matters into their own hands. When they reach Hidden Palace Zone and face off with the treasure hunter, Eggman gets the master emerald. As rouge is angry that she didn't get paid for her expedition, she latches onto the emerald and is shocked off of it. Once she wakes up, she decides to help Amy and Cream, so they head to Sky Sanctuary.

    Tikal story:

    Rouge finds the Master Emerald and decides not to tell Eggman about it, since Amy and Cream have the 7 Chaos Emeralds. This frees Tikal from her Emerald, and she goes to take on Eggman herself.
     
  2. JeffCharizardFlame

    JeffCharizardFlame Escape Reality and Play Video Games Member

    Joined:
    Jan 27, 2013
    Messages:
    37
    Location:
    United States
    Now, as for me, I'm planning out what moves to use in my hack. So I don't get people mad at me for posting many questions, is it alright if I make a topic for my hack idea and when I get farther, I post screenshots and such, but first I might do mockup screenshots, or something along those lines?
     
  3. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    JeffCharizardFlame, adding moves is several times easier said than done. I'm still deciphering how to properly implement the Super Peel-Out, and that's not the easiest thing in the world.
     
  4. JeffCharizardFlame

    JeffCharizardFlame Escape Reality and Play Video Games Member

    Joined:
    Jan 27, 2013
    Messages:
    37
    Location:
    United States
    I understand that, and I'll probably get my desired result from testing it.

    Plus, Tails' flying is already implemented, so I won't have to edit that. The only things I'll need to edit are Amy's moves, and even then the instashield becomes the Piko Piko Hammer. And since not giving her a spin jump makes the game harder, I might find a way to make an asm patch to either enable spin jump or disable it. It will be enabled by default. I won't even have to edit Knuckles' data, just change the sprites of Tails to cream, Player Knuckles to Tikal, and CPU Knuckles, if it doesn't use the same sprite table as player, to rouge.
     
  5. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    JeffCharizardFlame, a friendly note, please do not triple post (or even double post). Edit your previous post to add notes. Only double post if absolutely necessary =)
     
  6. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I'm pretty sure he's only appearing to triple post because ThomasSpeedrunner's posts got moved to another thread.
     
  7. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    If that's the case, I apologise.
     
  8. JeffCharizardFlame

    JeffCharizardFlame Escape Reality and Play Video Games Member

    Joined:
    Jan 27, 2013
    Messages:
    37
    Location:
    United States
    Yes, mainmemory is right. But anyways, is it alright if I make another topic for my own questions and info for my hack? I don't wanna be another person who keeps posting in here every minute of the day like Tom- not really, but you get my point. I'm waiting to post it until I have permission from someone, because I don't want to get in trouble or anything. I'd rather avoid trouble at all costs, but meh. You take what you get. I guess.
     
  9. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    You're better off asking your questions here. You only want to make a topic about your hack to show what you've done and what you plan to implement. If people read your project topic and saw you asking lots of questions, they're not going to bother reading it anymore. Whereas in this topic here, well, that's what people read it for; to help answer your questions.
     
  10. JeffCharizardFlame

    JeffCharizardFlame Escape Reality and Play Video Games Member

    Joined:
    Jan 27, 2013
    Messages:
    37
    Location:
    United States
    alright, if you say so. just making sure. :3
     
  11. JeffCharizardFlame

    JeffCharizardFlame Escape Reality and Play Video Games Member

    Joined:
    Jan 27, 2013
    Messages:
    37
    Location:
    United States
    Well, now that I've got my sprites, now to make my changes. ^-^ So Basically all I need to do is edit the sprite tables so that my sprites will show instead of the normal Sonic/Tails/Knuckles Sprites? and also, since Amy will have the same acceleration speed as sonic, at least for this build, should I wait to make my jump patch so I don't mess with the normal game coding that doesn't have to do with sprites?
     
  12. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Last edited by a moderator: Feb 25, 2013
  13. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    I need to make some changes to the object engine in my hack and therefore have to turn all the raw values of the sst into variables. This is something I should have done long ago, but considering how tedious it is I delayed it for quite a while.

    It unfortunately isn't as simple as "search & replace $A(a to y_pos(a", for the simple reason $A(a isn't always y_pos.

    Anybody knows a good method to do this safely?

    I really don't want to have to do this several times before it works... :/
     
  14. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    The safest way is to go through each reference manually.
     
  15. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    There's no way to do this 100% safely by using search & replace, by here are some thoughts I have:

    Start searching from Obj80, as it's the first object that appears in game's code.

    Search for $A(a0) and $A(a1) rather than just $A(. This will make things a bit more safer (just a bit), as objects barely load their STTs in any other registers besides A0 and A1.

    Speaking of your example, where you treated byte $A as object's Y-position. Doing this bit is a little tricky, since Y-position is stored at different location in some objects.

    Objects in Sonic 1 can have several coordinates systems: on-screen (used by HUD and few others), FG (used by all ordinar objects), BG scroll layer 1 and BG scroll layer 2. Note that the last two are not used in the final version, but the sprites engine still supports them. I'm pretty sure they were used in the first prototypes of the game, seeing how they looked like (GHZ palms in the proto are likely to use this feature).

    If you're using on-screen coordinates system, X position is be located at byte $8 and Y position is at byte $A

    If you're using the other coordinates system, X position is be located at byte $8 as well, but Y position is at byte $C.

    The reason for that is because the game handles objects slightly differently if on-screen coordinates are used. In that case, X and Y positions are treated as 16-bit integers (taking 2 bytes each), however, for in-level coordinates, they are stored as 16.16 fixed fractions, taking 32 bits (4 bytes) each. The game can easily read the integer part of fraction by reading a word from 8 or $C, if it reads a long word from the same location, it will also obtain a fractional part. Fixed point calculations are used through routines like SpeedToPos and ObjectFall.

    So byte $A is an y-pos for quite a small portion of objects, like HUD and the title cards. For most of the objects, it's byte $C. I'd suggest creating two different constants for these, for example, ypos=$C (is it's most used), and ypos2=$A.

    But personally, I'm using a slightly different method to store constants for the objects I code. The common SST's variables are declared in my constants file, which is included in the beginning, but X and Y positions aren't. I store every new object I create in a separate file. Note, that while I'm using constants for new objects, I didn't bother to do the old ones (well, I barely even touch them, as my main interest is to code new ones). In the beginning of every file, I declare X and Y constants depending on coordinate system, like so:


    xpos = 8
    ypos = $C

    I've chosen so, because I usually declare quite a lot of object-specific constants. This is very handy, and coding so really complex object would be barely imaginable without that (a small example from Megahack: http://pastebin.com/Bs55bZg6 =P notice that I declare new constants if the middle as my object needs them)
     
  16. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Well, the xpos/ypos thing is a minor detail, I'll correct them when necessary to make the code easier to read, but for now I just want to be able to move everything safely (and xpos & ypos will stay together so screen coordinates will still be compatible).

    I'm more worried about all the values from 0 to 4, they're way more common in non-object code.

    Anyway, I've been working on it and fixed quite a number of problems appearing while changing the size of the OST, but there's a bug I just can't figure out. Here's a pic:

    [​IMG]

    You may recognize this place from Marble 2, it has several swinging platforms, and as you can see, sometimes swinging platforms just "eat" other objects (apparently any other object in ram, including shield and Sonic, here a fireball, a ring and the platform). The problem is, it's completely random. Sometimes everything works fine (the swinging platforms on the left & right are normal), but every now and then something like this happens.

    Sometimes, when Sonic is affected, he's dragged where the centre of the swing should be, sometimes the object is just deleted (and the camera moves to the top-left corner of the level).

    I really have no idea of what can cause this, but it's most likely related to object 15 (I haven't seen it with any other object yet).

    Of course, I set the OST size back to $40 and reverted the changes made to the object, but it's still happening. So it may not be in the object itself, but rather in something related to it. :/

    Ideas and theories on the matter are really welcome.
     
    Last edited by a moderator: Mar 2, 2013
  17. rika_chou

    rika_chou Adopt Member

    Joined:
    Aug 11, 2007
    Messages:
    689
    I've had that happen in S2 when I was using the wrong delete object routine for the swinging platform. Maybe it's a similar issue here?

    God darn....your art. Every time I see it am amazed.
     
    Last edited by a moderator: Mar 2, 2013
  18. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    We couldn't have a video demonstrating the issue?  Just hard to tell with pictures.
     
  19. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    There isn't really enough information to tell something for sure, but let me try though. Seeing how it looks like, this could be a memory damage in the swinging platform object.

    As you might know, this one creates extra objects per every chain link and changes their position according to the current chain angle. Starting from the offset $28 of the main object, there is an array of pointers to all these child objects created. Each entry is byte sized, it's calculated with a following formula (see Obj15_MakeChain):


    ($FFD000-ChildObject_Address)/$40

    The first entry in the array determines how many objects are listed.

    If the memory is corrupted somehow, it will attempt to control wrong objects or even memory areas. The code that sets all object positions according to calculated object's angle is Obj15_Move2.

    I don't have idea why this damage could happen, as I don't see how you've done your modifications, but this is the obvious reason of why the singing platform could 'eat' other objects.
     
    Last edited by a moderator: Mar 2, 2013
  20. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    What RHS said. I may not be experienced with Sonic 1 (I'm a Sonic 2 hacker), but the swinging platforms in ARZ are fairly similar to this, as they use ring-like chains as child sprites, which are similar to Sonic 1's child objects. I'd like to see a video or similar demonstrating what the issue is, so that we can actually assist you.