Basic Questions and Answers Thread

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

  1. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    I can't swear this is the problem but...

    There's at least a misunderstanding of how the whole running+angle thing is working in the game here, and it may be the cause of many glitches.

    You'll see details in the asm commented in this thread: http://sonicresearch.org/forums/index.php?showtopic=2445&p=23864

    To make it short, every walk/run angle needs to have the same number of frames as the others.

    There's no specific animation for each angle, there's only the base animation for running on flat ground, and the game adds a value to the frame number depending on the number of frames and the angle. For example for the first (45°) angle, it add the number of peelout frames (4 in this case). So if it's supposed to be at frame D9, it adds 4 and loads frame DD instead. And there's no frame DD in your mappings, so that might be the problem.
     
  2. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    So your saying I have to add more frames to this animation script?

    SonAni_HaulAss: dc.b $FF,$D6,$D7,$D8,$D9,$FF
     
    Last edited by a moderator: Apr 26, 2013
  3. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    No; he's saying that the game automatically calculates it for you: adding more frames would royally screw it up =P

    Also:

    Spiritulsanum, if I may add: If one does not include ANY frames for a specific multiple of 45 degrees, then the game will crash. I learned that the hard way with the Super Peel-Out sprites in my hack :U

    I hope this is relevant in some way.
     
  4. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    No, add more frames in the mappings.

    The animation script is only used as a base, the number of the frame is taken from it, then the game adds 4, 8 or C depending on the angle. 
     
  5. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Thats how I put the sprites in but Im trying to see if when I add all of the peelout sprites that maybe they wont be glitched I have E5 number of frames to accomidate the number of peelout sprites there are which is 16 like the running and walking sprites. If they all load in glitched then there could be something wrong with SonMapEd, which would be back to my old thought that after you have reached a certain amount of tiles SonMapEd cant save anymore sprites.
     
  6. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Just finished adding all of them and they are all glitched they are loading old sprite tiles from the original sonic 2 sprites all grabled up which I deleted so it doesnt make sence why they would show up.

    Edit: And some grabbled sonic 3 tiles too

    http://www.youtube.com/watch?v=KvbyOuB72TM&feature=youtu.be
     
    Last edited by a moderator: Apr 26, 2013
  7. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    We have never seen any peelout sprites in your hack? :huh:

    Edit: Unless you recently put them in in the last 4 days
     
    Last edited by a moderator: Apr 26, 2013
  8. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    -_-

    The Super Peel-Out sprites you had supplied me with a while back? You don't remember that?
     
  9. rika_chou

    rika_chou Adopt Member

    Joined:
    Aug 11, 2007
    Messages:
    689
    Sprites can't use tiles after $1000 IIRC. Not sure if this is your problem, but if you are using sprites ported from S3 then you have very little spare tiles left.
     
  10. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    I didnt port I replaced them one by one (Since Super sonic sprites are seperate files from the regular Sonic sprites in Sonic 3) and ok I guess I reached the amount aloud guess I could just start from scratch since I still have the bmp files and I could just add on tiles to them  to fit the Sonic 3 sprites instead of deleteing them completely thanks for your help I thought there was a limit just wanted to make sure I was right. Shouldnt take too long to redo them. Might post a video when I am done to show you guys but Adminisrators if you think its a waste then I wont.
     
  11. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Sonmaped has an option to organize tiles by sprite order, this will put all the unused tiles at the end of the art file. If (some of) the sprites show properly this way, then this 1000 tile limit was indeed the problem.
     
  12. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Yes Spritulnsanum it was, I started the sprites from scratch and added the peelout sprites in and they were not glitched. Not taking too much time to redo all the sprites since like I said before I still have the bmp sprite files. This can help other people too since I am guessing some people did not know there was a limit but now they know and how many tiles they are aloud to have. Thanks rika_Chou =D


    Edit: Still have a crash issue though but it is very rare sometimes when you are running and then roll the game freezes on Sonics ducking animation. No wait scratch that it just changes to that sometimes when running and confuses the game and crashes. Or maybe the way I made sonic change to another animation while running in his code sometimes causes a crash. In other words my code may be crap lol
     
    Last edited by a moderator: Apr 26, 2013
  13. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Question again.

    I'm trying to delay the camera, but there's an annoying glitch I don't understand.

     

    The delay is based on a timer, when it isn't null, the scrollhoriz and scrollvertical routines are skipped and $FFFFF73A and $FFFFF73C are cleared (so the background isn't deformed).

     

    The horizontal part works perfectly, but there's a problem with the vertical scrolling: under certain circumstances after using the delay, the camera can move up or down by more than 16 pixels, so one line isn't redrawn.

     

    I monitored F73C and it never goes below $FFF0 even when the glitch occurs.

     

    What else can influence the camera's position?
     
  14. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Could you show a screenshot?  I think I may of had this problem before, but I've just woke up and struggling to understand what you mean lol
     
  15. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Sure.

    [​IMG]

    So, on the first pic, the camera is locked (scrollhoriz & scrollvertical skipped).

    The second pic is the next frame, the camera moved up by 14 pixels (so this is when the problem happens, although it isn't visible yet).

    And finally on the third pic (5 or 6 frames later) is the resulting visual glitch.
     
  16. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Ah, my problem was different.  But I've never tried delaying the camera speed.  If you refresh the whole screen by moving 1 to dirty_flag, does the glitch go then?  I'm not sure how to fix this I'm afraid.
     
  17. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    I am also stumped here, without seeing the code in full and seeing the glitch occur in motion, it's not likely an easy thing to work out.

    There are three things I can through out to you:

    • You've made a mistake we simply cannot see.
    • Try creating an alternate ScrollHoriz and ScrollVertic, one that follows a fixed position (you shouldn't really have to, as you said so yourself, simply skipping and then allowing should account for mistakes, but at this stage, it's worth trying).
    • Give this a go, it's mainly for ScrollHoriz and has nothing to do with ScrollVertic, but as I said before, at this stage, it's worth trying.
     
  18. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Fixed.

    Well, the code is so simplistic...

    This goes in loc_628E. It simply replaces the bsr scrollhoriz & bsr scrollvertical lines.

    In $FF1008 is the number of frames to delay the camera. And I didn't modify scrollvertical.


    tst.w ($FF1008).l
    beq.s @scroll
    subq.w #1,($FF1008).l
    bls.s @scroll
    clr.w ($FFFFF73A).w
    clr.w ($FFFFF73C).w
    bra.s @skipscroll
    @scroll:
    bsr.w ScrollHoriz
    bsr.w ScrollVertical
    @skipscroll:


    I monitored the values sent to F73C and the value never went under -$10, and I also checked the changes in F704 between each frames and those changes were never higher than $10...

    Which makes me think I actually fucked up when I thought the bug was happening because the camera was moving up by 14 pixels, that's $D pixels, stupid me. So maybe it's actually redrawing a line  at the top when it shouldn't (line coming from the bottom)... Time to check this. Nope that line isn't drawn before.
     
    Last edited by a moderator: Apr 27, 2013
  19. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    I think this question has been asked before but how would I seperate EHZ and HTZ to use their own tiles. All I know is that I would have to duplicate the tile files.
     
  20. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Then load the different files depending on the level.