Sonic and Sega Retro Message Board: Basic Questions & Answers thread - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 355 Pages +
  • ◄ First
  • 353
  • 354
  • 355
    Locked
    Locked Forum

Basic Questions & Answers thread NEWBIES: Start here!

#5311 User is offline KingofHarts 

Posted 21 November 2014 - 07:53 PM

  • Unlike Sonic, I don't chuckle...
  • Posts: 1410
  • Joined: 07-August 10
  • Gender:Male
  • Location:Chicago, IL
  • Project:Sonic Triad Studio, Sonic 1 REV C
  • Wiki edits:1
Spoiler tags contain my code issue due to page break.

Spoiler


View PostMainMemory, on 21 November 2014 - 12:00 PM, said:

You probably shouldn't be skipping the btst that checks whether the character is actually touching the object when playing as Knuckles.


Unless I'm missing another btst, I believe that the one you are referring to is the object's push flag to detect if the character is pushing the object, IIRC. I took your advice and I moved it before the character check... and it brought me back to the first issue I was having, where Knuckles can run through the wall, but if he is in the air, it will not work at all. That shouldn't be the case.

In S3K this is skipped when the character is super or the character is Knuckles... in which case it goes on to the breaking code. OR it's also skipped when the player has a flame shield, in that case it skips slightly less ahead to seeing if the character is in his rolling animation. (Blasting through the wall using Sonic's ability)... so I don't think this is the issue.
This post has been edited by KingofHarts: 21 November 2014 - 08:18 PM

#5312 User is offline E-122-Psi 

Posted 21 November 2014 - 08:03 PM

  • Posts: 1436
  • Joined: 29-December 09
  • Gender:Male
  • Wiki edits:41
Okay progress on the Final Zone query, I've (or more someone more competent) managed to get the boss to take hits properly using a branch, however the result is that the collision is gone for Eggman when getting away (which seems to be based on the normal boss object but is in obj85). Is there any sort of flag or data that recognises the difference between the two to use for the branch?

EDIT: Never mind. Fixed.
This post has been edited by E-122-Psi: 21 November 2014 - 10:36 PM

#5313 User is offline KingofHarts 

Posted 22 November 2014 - 01:34 AM

  • Unlike Sonic, I don't chuckle...
  • Posts: 1410
  • Joined: 07-August 10
  • Gender:Male
  • Location:Chicago, IL
  • Project:Sonic Triad Studio, Sonic 1 REV C
  • Wiki edits:1
Quick update, I fixed my bug. Knuckles works perfectly now. After a more careful search through the code, this is what was needed:


Smash_Solid:	; Routine 2
		move.w	(v_player+x_vel).w,speed(a0) ; load Sonic's horizontal speed
		move.w	#$1B,d1
		move.w	#$20,d2
		move.w	#$20,d3
		move.w	x_pos(a0),d4
		bsr.w	SolidObject

		beq.s	@donothing ; THIS LINE FIXES THE BUG AND MAKES IT ALL WORK CORRECTLY

		cmpi.b	#id_KnuxPlayer,id(a1) 	; is the current character Knuckles
		beq.s	@continue		; if yes, continue
                btst	#5,status(a0)		; is character pushing against the wall?
		beq.s	@donothing		; if yes, branch




Basically the SolidObject subroutine will give a return, determining whether or not the player collided with the object or not. Without this, it will disregard that completely... in vanilla Sonic 1, it doesn't check this because Sonic cannot break the wall simply by touching it. He breaks the wall by rolling along the ground into it, which is why the push bit of obStatus(a0) (#5) is checked. Here, we want to branch away if the character is not touching the object at all, because the character COULD be knuckles.... who walks through the wall. Otherwise, you'd get the bug I got because it's not checking for collision. The S3K equivalent is seen here:


		jsr	(SolidObjectFull).l
		tst.b	subtype(a0)
		bpl.s	loc_215A4
		tst.b	(Level_trigger_array).w
		beq.s	loc_215AC
		jmp	(Delete_Current_Sprite).l
; ---------------------------------------------------------------------------

loc_215A4:
		swap	d6
		andi.w	#3,d6
		bne.s	loc_215B2 ; EQUIVALENT

BreakWall_DoNothing: ;loc_215AC:
		jmp	(Sprite_OnScreen_Test).l



Though not quite exact, here... because there are a couple of other things the engine needs to check in S3K as well, but that line I marked is the equivalent.

Moving the btst to before the character check as MainMemory suggested, didn't work properly because it wasn't necessarily checking for a collision, moreso it was checking whether or not the character was actually pushing against the object along the ground, hence why Knuckles couldn't break it in the air like he's supposed to in S3K.

I hope this helps future Knuckles hacks to understand this.

  • 355 Pages +
  • ◄ First
  • 353
  • 354
  • 355
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users