Castlevania Dungeon Forums

The Castlevania Dungeon Forums => Fan Stuff => Topic started by: TheouAegis on May 31, 2015, 09:05:28 AM

Title: CVIII Password Revisited
Post by: TheouAegis on May 31, 2015, 09:05:28 AM
CV3's password algorithm is at the end of this post.

A long while back, I shared a password generator for Castlevania III and a little insight about how it was created. I wasn't happy with the original code, so I thought I'd go back to it and try to understand what was actually going on and revise it. If you had seen the original code, you'd be flabbergasted by how long and ungainly it was. Parts of this post were covered in the original topic, so I apologize for repeating myself.

Boring informative stuff
(click to show/hide)

Anyhoo, here's the encryption/decryption code in Game Maker format. Even if you don't know Game Maker's language, you can figure out the code for use in C++ or Unity or whatever pretty easily.


PASS_ENCRYPT
(click to show/hide)

PASS_DECRYPT
(click to show/hide)

name_set
(click to show/hide)

cryptos
(click to show/hide)


As you can see by reading through the notes in cryptos(), you can customize the algorithm for your own games with some minor corrections. Change values at your own discretion and always thoroughly verify and re-verify your passwords work. The following code was used at the end of PASS_ENCRYPT() to verify any password generated could be decrypted with PASS_DECRYPT().

(click to show/hide)
Title: Re: CVIII Password Revisited
Post by: X on May 31, 2015, 10:03:21 AM
LOL! Glad to see you having fun with this. I can't make heads or tails out of it, oh god... *dizzy*
Title: Re: CVIII Password Revisited
Post by: SabinFigaro on May 31, 2015, 06:58:56 PM
I assume that the hard difficulty you're talking about is when you restart the game after beating it once? Otherwise.....yes, complete mindfuck lol!
Title: Re: CVIII Password Revisited
Post by: TheouAegis on June 01, 2015, 12:00:37 PM
Yes, when you beat the game and play again, or if you use certain names like OKUDA (I think), a difficulty variable is flagged and that is included in the password.

Here's the original password generator:
http://www.mediafire.com/download/5im4cq9zrcym156/cv3pwgen.exe (http://www.mediafire.com/download/5im4cq9zrcym156/cv3pwgen.exe)
My original code for that is on the forums in the murky past.


The point of this thread was so anyone wanting to incorporate a password system like the one in CV3 into their game, all the necessary code is here. You just copy the four scripts into your program, edit the name_set and cryptos scripts, then you're good to roll.

I also did it for anyone interested in various ways password generators were made. Like, I never would have considered some of the things they did in this code. I had a lot of "How did they come up with this?!" moments while working on this.
Title: Re: CVIII Password Revisited
Post by: BLOOD MONKEY on June 01, 2015, 03:33:37 PM
Noice. Now i can play as grant from the start. ^-^
Title: Re: CVIII Password Revisited
Post by: TheouAegis on June 02, 2015, 04:25:10 PM
If you knew what bytes to edit, you could make Alucard or even Grant freeze enemies (give them Sypha's abilities). Of course the pallet entries will be all wrong, but still fun. (No, you can't give Sypha the ability to turn into a bat unless you hack the ROM data itself. Sorry.)
Title: Re: CVIII Password Revisited
Post by: BLOOD MONKEY on June 02, 2015, 07:15:03 PM
If you knew what bytes to edit, you could make Alucard or even Grant freeze enemies (give them Sypha's abilities). Of course the pallet entries will be all wrong, but still fun. (No, you can't give Sypha the ability to turn into a bat unless you hack the ROM data itself. Sorry.)

I know. I used to make Alucard use a whip and Grant use fireballs with all my fancy rom stuff.
Title: Re: CVIII Password Revisited
Post by: TheouAegis on December 22, 2020, 04:11:34 AM
Sorry for necroing this, but I spent a few hours this week trying to actually understand the algorithm better, analyzing what each process is intended to do. I am aware that my original code is sloppy and hard to follow, and it even has some glaring errata. Regardless, here are my notes on it. I'm fairly confident now I would be able to quite easily modify the algorithm for use in even dissimilar games. For example, I think the CV3 password would actually work well if you wanted to add passwords to a Ghost & Goblins game.

https://gmvania.blogspot.com/2020/12/castlevania-iii-password-once-more-from.html