Difference between revisions of "Castelian (NES)/Game Mechanics"
From SDA Knowledge Base
(→Enemy movements) |
|||
Line 29: | Line 29: | ||
===Enemy movements=== | ===Enemy movements=== | ||
− | The movements are predictable with one exception. There is some variation to the initial x-movement of the destroyable ball enemies. The game polls every 10 movement frames (so every 30 actual frames + any random lag frames) whether to start moving the ball or not. The game then checks that the player is within 32 x-pixels, that it's on the same y-level and that the player is walking or standing still (so jumping or shooting will not trigger the ball). The sub-routine for this check starts at $D20B and a successful check results in changing the value of $15F+Y, where Y is enemy number (from 0 to 3), to a non-zero value.<br /> | + | The movements are predictable with one exception. There is some variation to the initial x-movement of the destroyable ball enemies. The movement of these enemies seem to be triggered according to a few different mechanics. For example, balls that spawn during a lift ride always (?) start moving immediately. There is one important mechanic that governs at least some of the other balls. Notably the one near the end of tower 4. The game then polls every 10 movement frames (so every 30 actual frames + any random lag frames) whether to start moving the ball or not. The game then checks that the player is within 32 x-pixels, that it's on the same y-level and that the player is walking or standing still (so jumping or shooting will not trigger the ball). The sub-routine for this check starts at $D20B and a successful check results in changing the value of $15F+Y, where Y is enemy number (from 0 to 3), to a non-zero value.<br /> |
− | It should be noted that balls that | + | It should be noted that there appears to also be balls following other mechanics that are not described here. |
===The molecule=== | ===The molecule=== |
Revision as of 13:05, 23 June 2019
Contents
Difficulty differences
There are two difficulties in the game, "Novice" (default) and "Hero".
- The molecule enemies move twice as fast on Hero difficulty. This saves time in some places and loses time in other places compared to Novice difficulty. Overall, it favors playing on hero by a few seconds.
- The in-game timer ticks down every 15 game frames (= 45 frames + random lag frames) on Hero and every 20 game frames (= 60 frames + random lag frames) on Novice. Since the timer is converted into points at the end of each tower, this favors Hero difficulty by a few seconds over the course of a run (3 frames saved per avoided tick on the timer).
- Extra lives are awarded every 5.000 points on Novice and every 10.000 points on Hero. This is unlikely to have any consequence for a speedrun though.
Overall, Hero is clearly the faster of the two difficulties.
Movement comparisons
The term "movement frame" will be used repeatedly in this section. The game runs at 20 fps, so one movement frame is 3 actual frames (+ any random lag frames).
- When climbing a stair-like set of platform steps, you can either walk or jump up them. There are 5 movement frames that are possible to jump on.
- - Jumping on the first possible movement frame saves two movement frames over walking.
- - Jumping on the second possible movement frames is one movement frame faster than walking.
- - Jumping on the third or fourth movement frame is equally fast to walking.
- - Jumping on the fifth (and last) movement frame is one movement frame slower than walking (this can easily be seen by noticing how the character sort of jumps into the side of the next step and thereby losing a bit of horizontal momentum.
- Jumping the last step to an opening is at best one movement frame slower than just walking up.
- It doesn't matter from which x-position a lift is activated. If the player is not centered, the game will automatically center the player with normal movement speed.
End-of-level countdowns
There are three countdowns after each level and each tick of countdown costs 3 frames (or more if random lag is added). The first one, the timer, is self-explanatory. The other two are:
- Technique - Starts at 100 and is reduced by 2 for every hit.
- Extras - Starts at 0. 5 is always added upon level completion and 2 is added for every destroyed enemy.
Enemy behavior
Enemy spawning
The game can only store four enemies in memory at the same time (including the molecule). When an enemy goes below the screen, it gets de-spawned (exception being the molecule) and a new enemy can take its place when the screen has scrolled sufficiently in the vertical direction to reach its spawn point. The enemies always spawn in the same order and their spawn locations are always the same.
Enemy movements
The movements are predictable with one exception. There is some variation to the initial x-movement of the destroyable ball enemies. The movement of these enemies seem to be triggered according to a few different mechanics. For example, balls that spawn during a lift ride always (?) start moving immediately. There is one important mechanic that governs at least some of the other balls. Notably the one near the end of tower 4. The game then polls every 10 movement frames (so every 30 actual frames + any random lag frames) whether to start moving the ball or not. The game then checks that the player is within 32 x-pixels, that it's on the same y-level and that the player is walking or standing still (so jumping or shooting will not trigger the ball). The sub-routine for this check starts at $D20B and a successful check results in changing the value of $15F+Y, where Y is enemy number (from 0 to 3), to a non-zero value.
It should be noted that there appears to also be balls following other mechanics that are not described here.
The molecule
Whenever there are less than four enemies active in memory and the molecule is not one of them, a timer counts down every game frame (= every 3 actual frames) from 125 (decimal). When it reaches -1, the molecule will spawn.
RAM-addresses
12A/122 - x/y of the main character
125/12B - x/y of enemy #1
126/12C - x/y of enemy #2
127/12D - x/y of enemy #3
128/12E - x/y of enemy #4
164 - molecule timer
The y-coordinates for the main character are different from the ones for the enemies, but this has no other effect than being a slight inconvenience from a practical point-of-view. (The main character's actual x- and y-positions appear to be stored in B1 and B3, but at least in FCEUX 2.1.4, B3 doesn't display correctly in RAM watch)