Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [ID] Topic: BEWARE the Invincibility Potion in CV3!  (Read 86 times)

0 Members and 1 Guest are viewing this topic.

Offline TheouAegis

  • Amateur Auteur of GMvania
  • Master Hunter
  • *****
  • Posts: 1857
  • Gender: Male
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. The Great Defender will always defend the object of his or her fandom. Hack Master makes creations out of CV parts. (S)he makes Dr. Frankenstein proud.
    • GMvania Developer's Blog
    • Awards
  • Likes:
BEWARE the Invincibility Potion in CV3!
« on: November 24, 2022, 04:23:27 PM »
0
I'll put this in the Fan Stuff thread because it's important for anyone modding Castlevania 3. I just posted this to my blog, but I know it doesn't have much readership (and that's fine with me). I don't know if this has been brought up before, but I feel it's important enough to refresh even if so.

The Invincibility Potion in CV3 is gimped. That's possibly why it was restricted to just that one room on the Ghost Ship where there was no point to it being there. CV3's damage code overlaps the moving platform handling, resulting in a convoluted mess which, although fairly simple to fix, resulted in the Invincibility Potion potentially leading to instant death. Rather than fixing it, Konami may have just cut out all but that one instance of the potion.

When an enemy collides with Trevor (or his partner), it deals damage to Trevor unless he's in his i-frames (when he flickers after taking any damage). There is no check for the invincibility potion. However, the Invincibility Potion is checked before reducing health and applying knockback. Yes, damage and health loss are separate in CV3.

The same variable that tells Trevor how much damage he has taken from an enemy is the same variable that tells Trevor he's on a moving platform. Every step, the part of the variable that deals with platforms is moved to another variable, which is later used to move Trevor along with the platform. The platform flag sets the lower 4 bits, while the damage sets the upper 4 bits. This would have been fine, except for two issues in the programming.
  • The damage overrides the variable, clearing the platform bits every time.
  • The platform value is moved after damage has been set, rather than before.
What this means is if Trevor is on a moving platform and takes damage, the game forgets he is on a platform, resulting in Trevor falling through the platform (presumably to an unfair death).

So if Trevor gets hit by an enemy or projectile while not under the influence of the Invincibility Potion, he will take damage, enter his i-frames, lose health, start flickering, and take no further damage for a brief moment. During this time, if Trevor gets on a platform and collides with an enemy, projectile, or spike while still flickering, nothing will happen to him. However, if Trevor is under the influence of the Invincibility Potion, gets on a platform and collides with an enemy, projectile or spike, he will clip through the platform and plummet to his demise.

If you want to modify CV3 to include the Invincibility Potion more prominently, you will need to be aware of this bug/feature.
Your mom has had more floppies put in her than a Commodore 64!


Follow my lack of progress on my game at my blog:
http://gmvania.blogspot.com

Offline X

  • Xenocide
  • Master Hunter
  • *****
  • Posts: 9242
  • Gender: Male
  • Awards SuperOld Dungeonite: Members who have been around since the oldOLD days. The Unfazed: Never loses his/her calm, even in the most heated arguments. The Retro Gamer: Has a heated passion for the oldschool VG Titles.
    • Awards
  • Favorite Game: Super Castlevania IV (SNES)
  • Likes:
Re: BEWARE the Invincibility Potion in CV3!
« Reply #1 on: November 24, 2022, 04:36:03 PM »
0
Geez. Ya think Konami would correct these little tid-bits before launching the game, lol  :rollseyes:
"Spirituality is God's gift to humanity...
Religion is Man's flawed interpretation of Spirituality given back to humanity..."

Offline TheouAegis

  • Amateur Auteur of GMvania
  • Master Hunter
  • *****
  • Posts: 1857
  • Gender: Male
  • Awards The Retro Gamer: Has a heated passion for the oldschool VG Titles. The Great Defender will always defend the object of his or her fandom. Hack Master makes creations out of CV parts. (S)he makes Dr. Frankenstein proud.
    • GMvania Developer's Blog
    • Awards
  • Likes:
Re: BEWARE the Invincibility Potion in CV3!
« Reply #2 on: November 25, 2022, 08:53:39 PM »
0
And I mean, it would have simply taken 3 extra bytes of data to correct. I could be wrong, but I don't think that particular ROM bank was full, so they could have easily added in the invincibility potion check and then recompiled the program.

And it strikes me as odd that in both CV1 and CV3, the invincibility potion appears in one (or two?) nonsensical candle throughout the entire game and nowhere else. At first I thought the platform clipping bug was intentional (like keeping in strict jumping). Then I thought maybe the code for the damage check was carried over from CV1, while the invincibility potion code was created for CV3 and they just forgot to revise the damage code -- except the potion was also in CV1. So I took a peek at the code for the potion in CV1.

I had the i-frames timer mapped in CV1 already, so I put a watch on that, because I suspected the invincibility potion variable would be nearby that. I found it at byte $007D, but when I searched the PROM for writes to $007D, nothing came up except a #00 write. In other words, the game never used that variable. I set a breakpoint for the potion and it turns out all the game does is set the i-frames timer. They had created the invincibility potion timer at one point, but just mapped the same behavior to the i-frames timer. The code for the Invincibility Potion in CV1 did not match that in CV3, so it wasn't like they just copied the CV1 engine over.

So yeah, it's an odd bug in the game on soooo many levels.
Your mom has had more floppies put in her than a Commodore 64!


Follow my lack of progress on my game at my blog:
http://gmvania.blogspot.com

Offline X

  • Xenocide
  • Master Hunter
  • *****
  • Posts: 9242
  • Gender: Male
  • Awards SuperOld Dungeonite: Members who have been around since the oldOLD days. The Unfazed: Never loses his/her calm, even in the most heated arguments. The Retro Gamer: Has a heated passion for the oldschool VG Titles.
    • Awards
  • Favorite Game: Super Castlevania IV (SNES)
  • Likes:
Re: BEWARE the Invincibility Potion in CV3!
« Reply #3 on: November 26, 2022, 09:49:49 AM »
0
They could've had the same coder who wrote for CV1 come back for CV III. While the code isn't the same as you've stated, the way it reacts in-game is. That's my theory. Many coders out there in the past like to reuse their knowledge for future products (Bethesda to name one!).
"Spirituality is God's gift to humanity...
Religion is Man's flawed interpretation of Spirituality given back to humanity..."

Tags:
 

anything