swapping ghz boss with syz boss

Discussion in 'Discussion and Q&A Archive' started by liamsonichacker, Jul 8, 2009.

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

    liamsonichacker Mad Level Skillz ;) Member

    Joined:
    May 29, 2009
    Messages:
    50
    Location:
    Leicester, UK
    I really want to be able to put the boss of green hill zone into spring yard zone and vice versa. so if anyone knows how to do so, can they tell me how.


    thanks
     
  2. MikeTH

    MikeTH Active Member Member

    Joined:
    Sep 8, 2008
    Messages:
    38
    Location:
    Ohio
    With something like that you'd probably need to find where GHZ's, and SYZ's boss codes are and swap them. Please backup your Rom before doing this though, as I have little experience with ASM.
     
    Last edited by a moderator: Jul 8, 2009
  3. Malevolence

    Malevolence Well-Known Member Member

    Joined:
    Jul 29, 2008
    Messages:
    97
    Bosses in Sonic 1 are loaded via the Dynamic Level Events (labeled resize_zone) which basically check if the camera has gotten to a certain position X-wise. If it has then a bunch of things happen; the boss is loaded, PLCs are loaded, the boss music is loaded and the screen is locked (all that plus the boss's position is loaded in some cases and the in the case of the SYZ boss, the blocks are loaded as well IIRC).


    Now, if you wanted to switch bosses, not only will you have to switch ids and positions in DLEs (not really hard), but you're also going to have to go through all of the boss's code and change each time it checks for a position. What's meant by that is when bosses move they know to stop depending if they have gotten to a certain position in the level, whether it be from cmp.w #$2000,8(a0) or cmp.w #$2000,$30(a0) (a copy of the X coordinate for bosses in sonic 1, used when updating positions with bossmove and making it appear to 'float'). Now, in each boss there are quite a few of those which are designed for each level's specific coordinates that the boss is in.


    Overall to do this you're going to (if you want just the SYZ boss in GHZ) load the SYZ boss in DLEs as opposed to the GHZ boss (along with its blocks), change each coordinate check to one equal to the distance in GHZ 3 (if it checked to move #$40 from on position, you'll have to calculate that out) and that's all really. Also make sure that when the boss is defeated and it adds to the boundary of the level so you can go to the egg capsule that it does that by how much is needed in GHZ 3.


    Alternatively to recalculating each boss you can make the bosses use relative positioning as opposed to a constant positioning. What relative positioning does is it allows the boss to be loaded anywhere by checking all coordinates by where it was initially loaded. In order to achieve this method what you'll have to do is save the two positions when the boss is loaded in ram and you have to calculate the distance between each movement. I'll show an example from one of my custom bosses:



    Code:
    		move.w	(Boss_X_Position).w,d0
    		add.w	#$88,d0
    		move.w	8(a0),d1
    		cmp.w	d0,d1
    		bge.w	MK_NextRoutine

    Now, what that code does is it checks if the boss has moved #$88 away from its original coordinate, and if it has then it will branch. If bosses are coded this way or converted, they can be placed via soned2 and still work (besides PLCs and music of course).
     
  4. liamsonichacker

    liamsonichacker Mad Level Skillz ;) Member

    Joined:
    May 29, 2009
    Messages:
    50
    Location:
    Leicester, UK
    thank you, but with the x positions why can i just swap them over like, but syz boss x pos as ghz because then it will load like normal
     
  5. Malevolence

    Malevolence Well-Known Member Member

    Joined:
    Jul 29, 2008
    Messages:
    97
    Well, each boss is loaded via different coordinates in each level, not to mention they're both not loaded in the same position (the GHZ boss is very high up and the SYZ boss is at the level he's at IIRC). You'd have to change everything unless you place him in the exact coordinate he was in SYZ.
     
Thread Status:
Not open for further replies.