Instashield to s1

Discussion in 'Discussion and Q&A Archive' started by SpirituInsanum, Mar 15, 2010.

Thread Status:
Not open for further replies.
  1. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Actually the problem is a little more complex than that. I'd like to modify the original s1 shield and stars so they load like the ones from s3. It should save a few bytes of that precious vram and therefore let me include the few features I still want to add.


    So I tried to import the instashield and see how it works, since I'd like to have it as well anyway, but it won't show in game, which isn't surprising for several reasons.


    I guess the first problem is the sst conversion, there are values I don't know how to convert, especially 38, 3c, 40 and 42(a0) and that object attribute table ($FFFFB00A). I tried some other values, but none of them worked. Also, I can't find the equivalent of s3's spawnlevelmainsprites, it looks to be related to it as well. I even tried to attach it to obj01, like the spindash dust, which was a laughable desperate attempt :p


    Anyway, I'm obviously missing something important here :p


    So I'm looking for anything that could help me: hints, infos, examples, ideas, etc.
     
  2. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Hmm, logic is at need here...


    I'm not a fan of porting code, so this is probably the way I'd probably have done it a year ago (Been simplified for you):


    1. Find a free object routine space, anyone as long as it's unused.


    2. Set that object to load by moving it's ID to a free object ram space at start of level (Routine named "Level: ").


    3. Check out another object which does nothing but presents a sprite (i.e. bridge stump).


    4. Maybe copy/paste it's code to your new blank object routine.


    5. somewhere in that objects routine, move sonic's X and Y position to that object's X and Y position (Enabling you to see that object because it'll move where ever sonic is).


    6. Modify it to look the way you want (i.e. a shield from Sonic 3).


    7. Fix the final stuff like only presenting when you double jump.


    Sometimes it's best to just make the object yourself other than porting =P (You might fail, but can learn alot from it).


    And that's my hint for the day.
     
    Last edited by a moderator: Mar 15, 2010
  3. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    I'm just a big fail when it comes to new art, so I would try to make the basic programming first and then do the stuff to make it look nice (i.e. making Sonic invincible and his radius a little bit bigger first and the sound/art later). For the radius you can use $16(a0) and $17(a0).


    You might want to try that first too, because well, as Markey said, porting is way harder than it seems, except if it's totally obvious stuff (which probably isn't the case for the insta-shield).
     
  4. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Hmm... There's an idea here. Actually my problem is not to make an object, but to make its art load dynamically, just like Sonic himself, the shields in s3 or the spindash dust.


    Maybe I could use a copy the dust object and turn the instashield/shield/invincibility stars/secretshieldyouveneverheardabout into animations/states of that new object and a blank sprite when there's nothing, similar to how sonic's object works. Sounds like an horribly huge lot of work, but that could be much more flexible in the end.


    According to what you wrote, Markey, any object should work as long as I follow those steps, right?


    Actually I'm not a fan of porting code either, I was just thinking I could learn how to load art dynamically with the instashield (and I almost did, but it doesn't work, so I'll try to forget it).
     
  5. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    More or less, yes =)
     
  6. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Thanks, Markey and Selbi, it's working :p


    Well, actually for now it only displays the sprite and there's still a lot to do, but that was the most difficult part for me.


    Here with a lightning shield sprite for testing purpose:


    [​IMG]
     
  7. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Wow that's pretty cool, also is sonic wall jumping or something? because if so, that's looks awesome.
     
  8. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    I've been wanting the wall jump since the first time I played scrap brain zone when s1 was released, so yes, it's a wall jump. :p


    I was thinking about the way I would make both movements so they don't conflict with each other (it shouldn't be a problem btw), and thought it would make a nice screenshot.
     
  9. c1owd

    c1owd Previously 'CarrascoZX0' Member

    Joined:
    Dec 13, 2008
    Messages:
    364
    Looking pretty cool dude! Your actually one of the few who actually pull these things off on the forums...


    Most people would ask more questions and not try. So, good job dude. Really!


    Also that wall jump is looking pretty sweet! :p
     
    Last edited by a moderator: Mar 19, 2010
  10. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Thanks Carrasco :)


    I have a question. Since it's still related to the shield I'm making, I'll post it here.


    Is there a limit to the number of pieces or tiles that can be used in an animation, or to the way they're separated or the distance between them?


    (my shield's code is really similar to Sonic's dynplc after the third spindash tutorial on retro, so if you heard anything related to limits with sonic's animations, it should help)


    I was trying some new shield animations, and when I wanted to test a version with 12 frames, the game crashed in regen (not in fusion though, and according to the error message it's most likely related to memory addressing). The animation had 12 frames, 6 pieces each, so 72 pieces, and a total of 384 tiles, half of them being mirrored/rotated.


    The lightning shield sprite I was originally using to test the shield had 12 frames as well, but much less pieces and tiles (36 pieces and 130 tiles).


    Also, when I use only 7 frames (from the beginning or the end), regen doesn't crash. In that case, there are 42 pieces and 224 tiles including mirrored ones.


    So it really looks to be related to one of those. :)


    So far, I was thinking it was only the number of pieces/tiles, but oddly enough, if I try to use for example frames 10, 12, 14, 16, 18 and 20, the game crashes in regen as well, but not if I'm using frames 10, 17, 18, 19, 20 and 21. So it may be more complex than that...


    I will most likely use a different animation, this one is way too smooth, but I'd really like to know what are the limits and where they come from, so I won't make the same mistake again.
     
    Last edited by a moderator: Mar 28, 2010
  11. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Oh my, I should never try asm when I'm tired ;)


    I had mistakenly removed the "even" at the end of the animation err... data? array? I don't know the name.


    Anyway, I understood when I moved the map and dplc to the end of the file (they were right after the animation thing and had that "even" line, I suppose that was hiding the problem), after that there was an error message telling the next line after the animation had been "word aligned".


    Sorry for the double post, but it's in case someone was wondering what was the problem or has the same problem someday.
     
  12. DeoxysKyogre

    DeoxysKyogre No idea what to put here .-. Member

    Joined:
    Jan 31, 2009
    Messages:
    298
    Whoa, is that a wall jump? If so, you win me at ASM. EPICLY. If you have programmed that, you have a great knowledge, and i can do simple things in ASM. Except on some moves.


    Good Job!


    -Deoxyskyogre
     
Thread Status:
Not open for further replies.