Basic Questions and Answers Thread

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

  1. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    I believe starlight zone has every possible chunk slot filled, you'll have to overwrite pre-existing chunks to make new ones.
     
  2. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    The limit for 256x256 chunks decompressed to RAM is $52, the limit for 256x256 chunks stored and read uncompressed from the ROM, and any kind of 128x128 chunks, is $FF.

    The maximum ID for S1's object layout format is $7F, because the high bit is used as the "remember state" flag. Switching to S2's format moves that flag to another bit, enabling a maximum ID of $FF. There are objects in slots above $7F in S1, but they're all objects that aren't used in level object layouts.
     
    Last edited by a moderator: Aug 22, 2014
  3. Viva La Luna

    Viva La Luna A.K.A. crypt0nymous Member

    Joined:
    Jun 7, 2012
    Messages:
    82
    Location:
    Istanbul
    I have an off-topic question for redhotsonic.

    Is that your car?

    [​IMG]
     
  4. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    So...I've been unsure about this for around a week now and I figured that if I were to ask about it here, I'd get at least an explanation if it's not possible. Here's the lowdown:

    In stock S2, a sprite can only use at most $20 tiles per frame, as illustrated here:

    [​IMG]

    Remember how I said I was working on Derpy? Well, as it turns out, her stand sprite, shown here...

    [​IMG]

    ...uses a total of $24 tiles. This isn't even taking into account walking sprites and how they'd need to be rotated, meaning even more tiles.

    So my question is, can it be made possible for a character to use up to, say, $40 tiles per sprite, and if so, is it more complicated than simply changing the "align $20" above the character's art file to an "align $40"?
     
    Last edited by a moderator: Aug 22, 2014
  5. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    ...

    The alignment of the art file has nothing to do with how many tiles they have reserved in VRAM. Like I said in IRC, you should be fine as long as Tails never appears onscreen with her. Otherwise you might have to move one or both characters' art locations in VRAM.
     
  6. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Ah, okay. I just keeping those aligns and I keep thinking they have something to do with it.

    What is wrong with me these days ;__;
     
  7. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    So after doing some research and experimenting quite a bit, I've started to make SBZ4 playable. It has a very strange music glitch though, causing it to sound funny at first, then play music very high up the music ID list every time sonic makes a sound effect (like jumping or rolling). Does this normally happen, and if so, how could I fix it?
     
  8. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Haha, nice find! But no, that's not my car.


    If you're interested, here's my car

    [​IMG]
     
  9. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    Cause everytime i try to ASM the thing with S1SMPS2ASM, Include the _S1smps2asm_inc.asm, then the converted .ASM file, it crashes when it's played
     
  10. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Cause everytime i try to ASM the thing with S1SMPS2ASM, Include the _S1smps2asm_inc.asm, then the converted .ASM file, it crashes when it's played



    Are you using an include instead of a binclude (the latter of which is known in the S1 disasms as an incbin)? If not, well, there's your issue.

    If it's a .bin file, use the BINCLUDE/incbin command, otherwise use the "include" command. General rule of thumb for making the game include files when being assembled.
     
    Last edited by a moderator: Aug 23, 2014
  11. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    Cause everytime i try to ASM the thing with S1SMPS2ASM, Include the _S1smps2asm_inc.asm, then the converted .ASM file, it crashes when it's played



    Are you using an include instead of a binclude (the latter of which is known in the S1 disasms as an incbin)? If not, well, there's your issue.

    If it's a .bin file, use the BINCLUDE/incbin command, otherwise use the "include" command. General rule of thumb for making the game include files when being assembled.



    Fixed now
     
    Last edited by a moderator: Aug 23, 2014
  12. LooneyDude

    LooneyDude Back after a long absence! Member

    Joined:
    Feb 1, 2014
    Messages:
    277
    Location:
    EVERYWHERE
    How do you edit the Special Stage art in a Sonic 2 disassembly? How's it compressed?
     
  13. Flamewing

    Flamewing Elite Hacker Member

    Joined:
    Aug 28, 2011
    Messages:
    37
    Location:
    France
    Assuming you mean for the track, instead of the background and sprites, the answer is "in a way that is not entirely useful at the moment"*. As always, there are two components to the art: the art itself and how to use the art.

    The art itself: this is stored with 8x1 format with Kosinski -- that is, once you decompress the art, you get only one line of each tile. The game transfers each such line 8 times to the VDP, forming full tiles.

    How the game uses the art: this is a lot trickier. For starters, plane tables in S2 special stages are 128x32 in size; the game uses two separate segments of VRAM for plane A (the track), meaning it uses double-buffering. When the special stage is loaded, the game sets hscroll data so that lines 0-1 of each tile comes from the first 32 tiles of plane A, lines 2-3 comes from the next 32 tiles of plane A, lines 4-5 comes from the next 32 tiles of plane A, and the last 2 lines comes from the last 32 tiles of plane A. The game then decompresses its custom mappings data for special stages at the rate of 7 tile rows every 2 frames (which is why it uses double-buffering).

    The custom mappings has been fully decoded (by me); it is a dictionary-based compression scheme that uses 4 different shared dictionaries (all compressed files use the same dictionaries) with variable-length indices. I can expand a lot about this, but the bottomline is that there is no publicly available* compressors to/decompressors from this format.

    If you want to change the look of the track, you have limited options at present -- basically, edit the art. If you change how it is loaded to the VDP, you can maybe swap to an 8x2 art format to try to smooth out the stages, but I have no idea how good that would look -- it might look worse.

    And I haven't even mentioned geometry yet -- how objects are positioned based on where they are located on the track...

    * I am working on an editor for all of these, but the major hurdle is one of interface. I think I came up with a good solution, but I need time to finish it off.
     
  14. N30member

    N30member non-pro user btw Member

    Joined:
    Feb 15, 2014
    Messages:
    216
    Location:
    Kazakhstan
    I have S1-related question: Which Chaos Emeralds object is used in special stage itself? There are two objects - one is used in Try Again screen, next one - in the results screen.
     
  15. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    The Special Stage emeralds are special stage blocks from $3B to $40.
     
    Last edited by a moderator: Aug 24, 2014
  16. TrustyGun

    TrustyGun Newcomer Trialist

    Joined:
    Aug 24, 2014
    Messages:
    13
    Location:
    Why do you care, Stalker?
    What are the subroutines / commands to immediately change Sonic's speed? For example: moving to a complete halt.
     
    Last edited by a moderator: Aug 24, 2014
  17. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    Go to Obj01_Main and change these lines:

            move.w    #$600,($FFFFF760).w ; Sonic's top speed
            move.w    #$C,($FFFFF762).w ; Sonic's acceleration
            move.w    #$80,($FFFFF764).w ; Sonic's deceleration

    More specifically, this line:

            move.w    #$80,($FFFFF764).w ; Sonic's deceleration
     
    Last edited by a moderator: Aug 24, 2014
  18. TrustyGun

    TrustyGun Newcomer Trialist

    Joined:
    Aug 24, 2014
    Messages:
    13
    Location:
    Why do you care, Stalker?
    Thanks, but I was not being clear enough:

    For context, I want to make a stomp. The way I imagine it is that Sonic will stop all horizontal movement, and move downwards. That is the effect I want to have. What are the commands I should use to accomplish this?

    Sorry for not being clear. Thanks in advance. 
     
  19. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    If on ground, set his inertia to 0. If in the air, set his x_vel (and inertia I think) to 0. Sonic will the stop all horizontal movement immediately.
     
  20. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo