Basic Questions and Answers Thread

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

  1. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    The game is hardcoded to only allow loops in GHZ and SYZ. At Sonic_Loops: you need to add SYZ to the checks for allowed zones.
     
    Niko likes this.
  2. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    Quick Question:
    Does anyone happen to know where I can find pixel-perfect footage of Sonic Mania, or something that isn't jpeg-ed to blurry death by video encoding?

    Also, if @MarkeyJester ever finds this post, I'd like to "publicly" ask about his soft-rendered sprite tilting in TNL. (On slopes, if that needs clarifying.)
    More specifically if he's willing to share the code, and / or where he got his references from for making the sprite's tilting effect while animated.
     
  3. jubbalub

    jubbalub Mania fanboy Member

    Joined:
    Dec 25, 2014
    Messages:
    286
    Niko likes this.
  4. Niko

    Niko All's well that ends well, right? Member

    Joined:
    Mar 1, 2014
    Messages:
    245
    Location:
    $C800
    I was hoping there'd have been enough to cut out the sprites and make the walk cycle, but thanks anyway!

    I'm liking the improved GHZ background just enough that I feel like importing it to Sonic 1 and publicising it, just because that crazy resolution difference kept hitting me about GHZ edits in the screenshot threads. Of course, if it weren't for this, I'd have never seen that until the game came out.
     
  5. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    Well I'm not Mr. MarkeyJester, but I can answer your question. :)
    How I was able to do it, and how I'm pretty sure The Next Level does it, is by having Sonic rotate at 15 degree incrementations rather than 45 degrees. This offers a quite smooth effect and gets the job done. There are two roadbumps I encountered, however.
    1. You run out of tiles very quickly. Even with the applied "extended mappings and art limit" from here, you still only have $FFFF tiles at your disposal. This adds up very quickly when you have many more rotations for walking and running. You're definitely gonna need to figure out a way around that.
    2. The code. The code itself is a bugger, I won't lie. I started by supporting the extra frames for a smooth walking animation in SAnim_WalkRun and then going from there, if that helps at all.
     
    ProjectFM likes this.
  6. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    Sprite rotation on the Genesis isn't possible. If someone did figure it out, it would be a pretty big thing and the code for it would probably be available for everybody to use. If you want to see the closest thing to non-prerendered sprite tilting in a Genesis game, check out his Sonic 1 Tilted hack. As for the Sonic 1 hack with Sonic CD special stages, I have no idea how it's pulled off but it's probably not able to be used for sprites (unless that's prerendered, too).

    What you could ask MarkeyJester for, however, is a smoothly animated Sonic or Pana sprite sheet because the extra frames seem to have been made by him. Or alternatively, you could try recreating Sonic's sprites from Sonic Mania based on what's shown in the Trailer or gameplay videos.

    It's cool that you were able to do that. I'd do it but I don't really have the patience and I'm using Sonic 3's sprites so I probably wouldn't have enough tiles to do so. Also, I always thought it was done in 22.5 degree incrementations.
     
  7. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    With how smooth it is, I would be willing to bet that he uses 15 degree increments.
    22 1/2 degree increments would look cleaner than stock Sonic 1, sure, but I still think it might look choppy. I don't know for sure though, so if someone ends up doing smooth rotation with 22 1/2 degree increments, I'd love to see it!
     
  8. jubbalub

    jubbalub Mania fanboy Member

    Joined:
    Dec 25, 2014
    Messages:
    286
    I'm going to rudely hijack this convo because I have an issue: I still can't find a way to fix Sonic's rolling-to-the-left bug. I've compared the code to a clean disassembly and there are no differences. Help?
     
  9. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    Just in case it was no obvious, but these sprites are NOT software-rendered by the MD. Instead, they are pre-rendered, either by hand, using RotSprite (or equivalent tool), or combination of both.
     
    EMK-20218, Devon and vladikcomper like this.
  10. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    The sprites were prerendered, not software rendered, that is not to say you cannot rotate graphics for sprites in the given manner, I've done it before. The thing is, the only people who would ever do it would be:
    1. Those that don't have the ROM space left to store all prerendered frames.
    2. Those that just want to show off, and more fool them since they waste processing time they could have spent on something better.
    Sonic 1 Next Level uses 11.25 degree increments (which I guess is your 22 1/2?), going any further than that would likely be a waste as you'd probably not notice the difference.

    --- --- --- --- --- --- --- --- ---

    A side rant, I'm disappointed, I've always tried to encourage you guys to go for something unique and different, what's with all the Sonic Mania replicating/copying all of a sudden?
     
  11. ArcaniaCQ

    ArcaniaCQ Well-Known Member Member

    Joined:
    Jul 18, 2015
    Messages:
    789
    Location:
    Sweden
    How do I fix so the ball don't go 0-100 in under 1 second? (Swing goes to fast.)
     
  12. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    417
    Location:
    Town Creek, AL
    In an sonic 1 amps bin, what bits are for the tempo, the speed of the music?
     
  13. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    I suggest you to look at the Markey Jester's smps guide http://sonicresearch.org/community/index.php?threads/smps-step-by-step-tutorial.1759/ .
    ; =============================
    ; Subroutine to ask my question
    ;-----------------------------------------------------

    Is it possible to change the Sonic's falling speed (after bouncing up a spring for example, i want to make Sonic falling slowly).
    And if yes, where is the routine? Thanks
     
  14. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    The ball in the GHZ boss? The movement code is under Obj48_Move. There are many changes you can make to change the speed. It shares some of it's code with Obj15 so you should duplicate the part object 15 uses so object 15 stays the same.

    http://info.sonicretro.org/SCHG:Music_Hacking/Pointer_and_Header_Format

    Edit:
    Yes. It's ObjectFall, I believe. You need to duplicate the code and make it so Sonic's code branches to the duplicated code unless you want every object to fall the same way as Sonic.
     
    Last edited: Aug 3, 2016
  15. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Thank you!

    EDIT: After having take a look at this, i don't where to begin.
    Can you tell me what is the routine who manage the falling's speed?
     
    Last edited: Aug 3, 2016
  16. TheStoneBanana

    TheStoneBanana banana Member

    Joined:
    Nov 27, 2013
    Messages:
    602
    Location:
    The Milky Way Galaxy
    You still manage the speed in ObjectFall.
    The line:
    Code:
        addi.w   #$38,$12(a0)   ; increase vertical speed
    
    is what basically applies gravity to the falling object in the calculations the routine is making.

    $12(a0) is what universally stores an object's vertical velocity, so it's probably very apparent how the line above does what it does.
    Since you want to make Sonic fall slower, you're going to need to do a check within ObjectFall to see if the object is Sonic, and if so, apply the new force of gravity.
     
  17. jubbalub

    jubbalub Mania fanboy Member

    Joined:
    Dec 25, 2014
    Messages:
    286
    sorry if I sound impatient I just really need this fixed
     
  18. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    This is a terrible idea. Imagine what would happen if every single object did this? Right, it would be a mess. It is a shame how Sonic Team handled gravity though; The way they did its easier to just not use ObjectFall if any of your objects do not use the regular gravity (aka a lot of them). They could have easily done this through a constant and then just added it in the code. Anyway, objects that do not use regular gravity, simply do this:
    Code:
            bsr.w    SpeedToPos
            addi.w    #$18,$12(a0)       ; Apply less gravity
     
  19. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Thank you

    Thanks! This is for an ability, this will change the gravity only when i'm pushing a button.

    EDIT: I have put it and it's working.... but, Sonic falls to quickly again.
    I have changed "addi.w #$18,$12(a0) ; Apply less gravity" to "addi.w #$01,$12(a0) ; Apply less gravity" but it's not enough slow.

    EDIT:
    here is my code:

    RoutineRandom:
    btst #5,($FFFFF604).w ; is C not held?
    beq.s SlowFallEnd ; if not, branch
    tst.b ($FFFFFFC4).w ; was falling slow flag set?
    bne.w SlowFallEnd ; if yes, branch
    bsr.w SpeedToPos
    addi.w #$01,$12(a0) ; Apply less gravity
    move.b #1,($FFFFFFC4).w ; if not, set falling slow flag
    move.b #$29,$1C(a0) ; use "falling slow" animation
    bclr #4,$22(a0) ; clear falling slow flag

    RoutineRandom:
    rts
     
    Last edited: Aug 4, 2016
  20. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    you need to actually change the speed from where ObjectFall branch used to be (I this case I am guessing Obj01_MdJump2), and do the test there (of course replacing ObjFall as I've shown above), and make absolutely sure you do not add the speed multiple times during code execution. As you may see, there is also a check right after it for when Sonic is underwater. This code actually reduces the gravity to $10 rather than $38.