User:DrippingYellow/Development:Cave Story
This page details development materials of Cave Story.
This article has just been started and needs the article basics added. Help us out and add them. Notes: Finish documenting source code, and all the OrgView versions should probably be documented on a subpage too. |
On December 23, 2024, an anonymous 4chan user leaked the source code to v1.0.0.4 of Cave Story in honor of the game's twentieth anniversary. "Sorry, Pixel!"
Contents
Commented-Out Code
The source code comes peppered with bits of commented-out code that give a glimpse into modified and removed aspects of the game, though not quite as much as one might like given the game's troubled development history.
NPCs
ActNpChar003
. . . npc->count1++; if( npc->count1 > 100 ){ npc->cond = 0; } // npc->x = npc->y; . . .
This confusing line is present in the code for the placeholder NPC used to keep track of damage pop-ups after an enemy explodes. ...Let's move on already.
ActNpChar012
. . . case 102: . . . if( npc->y < -32*VS ){ npc->code_char = 0; // PlaySoundObject( WAVE_QUAKE, 1 ); SetQuake( 30 ); } . . .
Some copy-pasted code in the Balrog event NPC. The original instance was used for when he exits the top of the screen after being defeated, while this instance, which comments out the code that plays the quake sound effect, is found in the action where he crashes upwards through the ceiling while rescuing Curly and Quote in the Seal Chamber.
ActNpChar017
. . . // npc->rect = rect[npc->ani_no];
Found in the code for the health refill station. This line of code is standard for the animations of other NPCs, but the final game's code uses constant values rather than relying on this NPC's ani_no variable.
ActNpChar030
. . . case 1://待機 // npc->act_wait++; // if( npc->act_wait/2%2 ) npc->ani_no = 0; // else npc->ani_no = 1; . . .
The Hermit Gunsmith's idle state has early animation code that would've made him switch rapidly between his standing and blinking sprites. Similar code is used for flashing NPCs (e.g. Balrog and the Core when they take damage), so this is either a remnant from an NPC that once occupied this slot or simply code to test the display of the defined sprites.
ActNpChar035
. . . case 1://起立 if( npc->shock ){ // PlaySoundObject( WAVE_SONIC, 1 ); . . .
Mannans originally played the sound effect used by their projectile when firing said projectile. Either the projectiles were silent originally, or this was a redundant line of code that Pixel caught before release.
ActNpChar036
. . . //滞空 case 4: //if( npc->flag & (FLAG_HIT_LEFT|FLAG_HIT_RIGHT) ){ // npc->xm = 0; //} . . . //滞空 case 6: //if( npc->flag & (FLAG_HIT_LEFT|FLAG_HIT_RIGHT) ){ // npc->xm = 0; //} . . .
Balrog's Bushlands boss encounter object has two instances of commented-out code left over from the first (unused) Balrog fight. Pixel must've realized there's not any point to stopping Balrog's momentum if the wall pushes him back out just fine anyway.
ActNpChar044
. . . /*if( npc->x - 6*PARTSSIZE*VS < gMC.x && npc->x + 6*PARTSSIZE*VS > gMC.x && npc->y - 6*PARTSSIZE*VS < gMC.y && npc->y + 6*PARTSSIZE*VS > gMC.y ){ if( npc->direct == DIR_LEFT ) npc->act_no = 8; else npc->act_no = 2; } if( npc->shock ){ if( npc->direct == DIR_LEFT ) npc->act_no = 8; else npc->act_no = 2; } break; */ . . .
Originally, a Polish would not activate until the player got within six tiles of them. This early behavior would have forced Polishes to use an otherwise-unused idle sprite.
ActNpChar047
. . . if(npc->ani_no == 4 ){ npc->bits |= BITS_BANISH_DAMAGE;//弾が効くようになる // npc->bits |= BITS_BLOCK_BULLET;//弾が効くようになる npc->act_no = 3; npc->act_wait = 0; } . . .
The code for the Sandcroc's emerging state has a line that would've set the flag to make it invincible. This is most likely a mistake, given that the comment mentions the enemy becoming vulnerable, as BITS_BANISH_DAMAGE confusingly has the opposite effect of making bullets pass through the enemy when it's not set.
. . . case 3://・・・ npc->bits |= BITS_BLOCK_MYCHAR;//マイキャラブロック npc->damage = 0; npc->act_wait++; if( npc->shock ){//|| npc->act_wait > 100){ npc->act_no = 4; npc->act_wait = 0; } . . .
Originally, the Sandcrocs would automatically retreat back into the ground after 100 frames (two seconds in the final game's 50 FPS). Possibly changed to give the player a better chance to attack back. Notably, the final code still increments and resets npc->act_wait, despite no longer using it in the action. The commented line of code is also present for the Sandcroc's Outer Wall variation.