Nick arcade tails A.I to sonic 1?

Discussion in 'Discussion and Q&A Archive' started by Dark Lips, Mar 2, 2010.

Thread Status:
Not open for further replies.
  1. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    Hi there, I have recently been looking into porting the tails A.I stuff into Sonic 1 - after looking at the various sonic 2 dissasembelys it has become clear that the version closest to sonic 1 is the nick arcade version... I have looked at the code and am going to start some experiements with this. If anybody has attempted such a thing or knows a thing or two about code/object porting please post your comments, info and experiances.
     
  2. DanielHall

    DanielHall Well-Known Member Member

    Joined:
    Jan 18, 2010
    Messages:
    860
    Location:
    North Wales
    For Tails' moveset i suggest looking in Obj02_MdNormal:


    Real helpful aren't i :lol:


    Well thats all i got out of my past attempts to port Tails. maybe i should try again?
     
  3. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    Thank you all input is apreciated and its not just porting tails but the A.I code to allow tails to follow sonic like in s2/s3.
     
  4. Irixion

    Irixion Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    670
    Location:
    Ontario, Canada
    Nick arcade didn't HAVE any AI code. It just followed the same as sonic's with a slight delay.


    Look for 'CPU' in the s2 disassembly--you should find most of what you need there. (Tails_CPU or something)
     
  5. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Didn't markeyjester do something simular for manic to follow sonic in bro-tro? Not sure if he ported the sonic 2 code or if its orignal. Knowing markey, its orignal code =P.
     
  6. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Basically what Irixion said, tails does not follow sonic per se, but more performs the same functions with a delay (basically what ever buttons you press for sonic, the same buttons become pressed with tails a split second later), this was fixed in the final as they added a function to automatically move towards sonic's direction regardless of what player 1 is pressing.

    You know me all too well =)


    But still in this case you wanna "port" the code from another game right?


    Lets go through the steps:


    1. Getting a second character in at the same time as the first character.


    2. Making sure it's design is fixed and that it looks the way it's suppose to.


    3. Fix the character to move on second player's controls (Control Port B)


    4. Checking it the character can go through loops without effecting the first character and vis versa. (Truth be known I don't think I had an issue with this, but still)


    5. Allowing the character to touch, walk and interact with other objects. (but at the same time maintaining the first character's interaction with the objects)


    6. Making sure that the second character gets hurt differently. (I'm sure the players don't want their rings lost because player two got hurt, or the game ends because player two died)


    7. Making sure that other certain object interactions are removed. (like crossing the flag, if you only want the first player to cross, then make sure the second player cannot interact with it)


    8. A.I. controls


    As you can see the actual A.I controls come last because there's no point in programming A.I. control routines for a second player which pretty much doesn't exist, the point here is that if you cannot get a second character in then there's no point in porting A.I. controls (Not unless you want cut scenes of course for player 1 =P).


    Again, I'm not the almighty brain of good ideas so remember, this is just advice and not telling you what to do beyond your control, Good luck with this task and I hope it goes down well.
     
  7. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    Thanks for the input guys - its much apreciated... I have been doing some experimentation with the nick arcade asm and have found a lot of simalarities to sonic 1's code, In this respect I have a couple of ideas on where to go from here to impliment a second charecter on screen controled by CPU/A.I as for what you said Markey, yes I remeber you saying you had to change the way the platforms and certain objects work to accomidate the second charecter. I will keep you all updated - if anybody has any other idea's or therorys about this then please continue to post.
     
  8. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    Sorry about the double post but this is a related question... In my experiments to do this I have been doing a lot of work on the S2 NA asm - How do I restore sonic 1 collison for sonic 1 zones? I know its doable with gamegenie codes as I have found out over on retro but I want to impement it in asm and I will admit I am at a loss as to how.


    Just to let you all know - I am Epicly Failing at hacking anything to do with this... It seems the proto is very unstable and buggy, I have had to start over 4 times in the last 3 days so I am going to leave this well alone and focus on S2 final hacking.
     
    Last edited by a moderator: Mar 6, 2010
  9. IWasAPerson

    IWasAPerson Part Of This Complete Breakfast Member

    Joined:
    Aug 18, 2008
    Messages:
    22
    For the GHZ collision in the S2NA disassembly, I remember this cause I was working on cleaning up, updating labels, and splitting the Nick Arcade disassembly. The game at that stage in development still had both the S1 and S2 solidity (collision) data. If you look at them the solidity data is different between both games. Most of the levels had switched over to the s2 solidity data, but GHZ didn't. I have my disassem on my other computer so I can't look at it, but either GHZ had its solidity data switched to s2 level format but kept the S1 solidity set, or GHZ uses the leftover s1 solidity level format but uses the S2 set. I want to say it uses the S2 set but again I don't have the disassem in front of me.


    Search in the disassembly for where the game loads the solidity blocks. There should be a check for if the level's GHZ. Where it branches, change the solidity from the s2 one to the s1 one, or vice versa. It should be labeled so you can tell the difference. Hope this helps you out.


    I probably should try to work on the S2NA assembly again...it would be really nice to clean up...
     
  10. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    Thank you for the advice on the s2 early proto , ok so after having a tinker its working better but sonic dosnt seem to handle angles to well in GHZ - heres what I got so far....



    Code:
    	&#59;============================================================================
    
    		lea	(ColArray1_GHZ).l,a1
    
    		tst.b	($FFFFFE10).w
    
    		beq.s	loc_13038
    
    		lea	(ColArray1).l,a1
    
    
    
    loc_13038:				
    
    	&#59;lea	(ColArray1).l,a2&#59; Original Code Commented out by me
    
    	&#59;move.w	#$7FF,d1		&#59; Original Code Commented out by me
    
    				lea	(ColArray1_GHZ).l,a2&#59; New code Added by me
    
    		move.w	#$7FF,d1			&#59; New code Added by me
    
    loc_13042:			
    
    		move.w	(a1)+,(a2)+
    
    		dbf	d1,loc_13042
    
    		lea	(ColArray2).l,a2
    
    		move.w	#$7FF,d1
    
    
    
    loc_13052:				
    
    		move.w	(a1)+,(a2)+
    
    		dbf	d1,loc_13052
    
    		lea	(AngleMap_GHZ).l,a1
    
    		tst.b	($FFFFFE10).w
    
    		beq.s	loc_1306A
    
    		lea	(AngleMap).l,a1
    
    
    
    loc_1306A:				
    
    	&#59;lea	(AngleMap).l,a2 &#59; Original Code Commented out by me
    
    	&#59;move.w	#$7F,d1			&#59; Original Code Commented out by me
    
     			lea	(AngleMap_GHZ).l,a2 &#59; New code Added by me
    
    		move.w	#$7F,d1				&#59; New code Added by me
    
    loc_13074:			
    
    		move.w	(a1)+,(a2)+
    
    		dbf	d1,loc_13074
    
    		rts

    Any ideas what I have done wrong? oh and sorry but I couldnt get the code to post straight... think its had a beer or two lol
     
    Last edited by a moderator: Mar 16, 2010
Thread Status:
Not open for further replies.