Advertisement
Guest User

Friday the 13th(c64) basic mechanics and bugs

a guest
Nov 28th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.11 KB | None | 0 0
  1. 1. THE TIME COUNTDOWN:
  2.  
  3. A couple of frame-rate related auxiliary counters are used to determine when
  4. the main counter should be increased. That main counter which is also used to
  5. update the hockey mask picture in the status display starts with 0 and is
  6. increased by 1 about every 10 seconds. If the main timeout counter reaches a
  7. value >= 192 (after roughly 32 minutes [*]), the game ends with the "you ran
  8. out of time message".
  9.  
  10. No time is lost while the game is playing the scream-sample or redrawing the
  11. screen when changing between rooms, because all counters are stopped for the
  12. time it takes until the action resumes.
  13.  
  14. There is also a time penalty for attacking harmless campers: every time the
  15. player hits one with his weapon, the main timeout counter is increased by 2.
  16. But since the countdown is running so awfully slow that doesn't have any
  17. measurable effect on the gameplay unless one focuses completely on hitting the
  18. harmless campers :-)
  19.  
  20. [*] measured on a PAL C64, the countdown should be about 20% faster on NTSC
  21. machines due to the higher refresh rate)
  22.  
  23.  
  24. 2. SCORING:
  25.  
  26. For every camper in prayer mode, 10 pts per second are awarded.
  27. For each hit on Jason, a different amount of points is added to the score,
  28. depending on the weapon used:
  29.  
  30. -600 points for hitting Jason with the pitchfork, chainsaw or kitchen knife.
  31. -100 points for all throwable weapons except the hammer
  32. -150 points for the hammer
  33. -1200 points for the big axe or the cutlass
  34.  
  35. Note that if you drop a throwable weapon while it is still in mid-flight,
  36. the points you score for a hit will be different due to a bug.
  37.  
  38. For every surviving camper one _should_ gain 1000 points at the end of a
  39. round, but there are several bugs in the bonus computation (see bug notes at
  40. the very end of this document).
  41.  
  42.  
  43. 3. THE PLAYER CHARACTERS:
  44.  
  45. Each character has an individual starting strength and panic-factor by which
  46. the panic level is raised under certain circumstances (see panic-level):
  47.  
  48. Gerry: strength 75, panic-factor 4
  49.  
  50. Wendy: strength 35, panic-factor 7
  51.  
  52. Amanda: strength 45, panic-factor 9
  53.  
  54. Brian: strength 50, panic-factor 5
  55.  
  56. Stuart: strength 70, panic-factor 7
  57.  
  58.  
  59. 4. THE PLAYER PANIC LEVEL:
  60.  
  61. The starting panic level at each round is 5, the maximum value is 80. The
  62. panic rises on two occasions:
  63.  
  64. a) When Jason is in kill mode and his current target goes into "victim mode"
  65. (that is when Jason arrives at the target camper's location and the target
  66. camper stops moving around), it is increased by the character-specific panic
  67. factor.
  68.  
  69. b) The panic raises by twice the panic-factor if one of the two shocking
  70. pictures are shown. This happens in about 18% of the cases where the player
  71. enters a screen with a corpse lying around that he hasn't seen before (Since
  72. that is only checked when the player changes between screens, one can kill a
  73. camper, exit the screen and return, and the game considers the cadaver to be a
  74. new discovery, even though it was made by the player).
  75.  
  76. The panic doesn't rise at all if a new body is found but no scary picture is
  77. shown.
  78.  
  79. The higher the panic level, the more likely Jason will pick the player as his
  80. next victim.
  81.  
  82. There's also a slight glitch in the panic-meter that causes it to show the
  83. minimum panic haircut instead of the hairs going all up to the sky when the
  84. panic level reaches 80.
  85.  
  86.  
  87. 5. THE CAMPERS:
  88.  
  89. The campers always start at the same locations (see map at the end of this
  90. text).
  91. Their strength and panic level is randomized at the start of each round except
  92. for camper#2, which always has a fixed panic level of 60. Panic will range from
  93. 10 to 74 points, while strength is a value between 20 and 59. The camper panic
  94. has two effects:
  95.  
  96. a) it will determine how long the camper will stay at the cross while in
  97. "prayer-mode". When the player has found the cross and touches a camper, he/she
  98. will stay in prayer-mode for 90-paniclevel seconds. During that time, 10
  99. points/second are added to the scrore and the camper will walk to the room with
  100. the cross and stay there until pray time is up.
  101.  
  102. b) the camper with the highest panic level is picked as Jason's next target
  103. unless he is currently in prayer-mode. In that case the camper with the next
  104. highest panic level is chosen. Given that camper #2 always starts with a fixed,
  105. rather high panic level, this camper will very often become Jason's first
  106. victim.
  107.  
  108. There are two occasions on which the campers' panic level is increased by 2
  109. points:
  110.  
  111. a) When Jason's target goes into "victim-mode" (more on that in the next
  112. section).
  113.  
  114. b) When the player is carrying a weapon and touches a camper, but only if the
  115. room with the cross has been discoverd before and the camper isn't already in
  116. prayer-mode.
  117.  
  118. As long as the campers are neither in victim-mode nor in prayer-mode, their
  119. movement is controlled by a routine that guides them to a previously randomly
  120. selected destination screen. When they arrive at a certain position within that
  121. screen, a new destination next to the current screen is randomly selected to
  122. keep the campers moving.
  123.  
  124. After praying or if they escape from Jason, their starting location is set as
  125. their destination, probably to avoid that too many campers gather at the same
  126. place (what would result in some of them not being shown correctly if the
  127. player enters that screen).
  128.  
  129.  
  130. 6. JASON:
  131.  
  132. Each hit by Jason will reduce the victim's strength by 8 in the 1st round, 9
  133. in the second round and so on... until at round 121 the hitpower will become -
  134. 128 due to a sign overflow bug. This will actually increase the player's
  135. strength, but still result in instant death as another overflow bug in the
  136. remaining strength computation is triggered if the strength surpasses 127. At
  137. the following levels Jason's hitpower will be -127, -126 and so on, until the
  138. overflow bug strikes again at round 249. Then the hitpower will be exactly 0,
  139. making Jason pretty harmless.
  140.  
  141. After setting up all the camper's strength and panic-levels at the start of
  142. each round, one of them is randomly selected to be Jason. As long as he is
  143. "undercover", he does exactly what the other campers are told to do by the game-
  144. code. But about every 15 seconds, it is checked if he should go into kill mode:
  145.  
  146. If a random number between 20 and 20+elapsed time since round start is greater
  147. than elapsed time, he will stay in disguise, otherwise he'll go into kill mode
  148. (this way, the more time has elapsed the more likely Jason will go into kill
  149. mode when checked).
  150.  
  151. In kill mode, Jason drops his disguise and picks the camper with the highest
  152. panic level who is not currently praying as victim. That check also includes
  153. the player, thus if the player's panic level is the highest among all the
  154. campers, Jason will go after him!
  155.  
  156. Jason will then head towards the victim's location. If he arrives there, the
  157. player's and all other campers' panic levels rise as previously described, and
  158. the target camper enters victim-mode and stops motion to make Jason's job
  159. easier. However, there is a slim chance for the victim to escape:
  160.  
  161. A random number between 0 and 60 is generated and compared to the victim's
  162. panic level. If the random number is greater, both the victim and Jason return
  163. to normal mode. Jason also returns to his starting screen then, and to
  164. compensate for the failed attack his strength is increased by 3 points up to a
  165. maximum of 80 points.
  166.  
  167. If the player attacks Jason while he is busy with another camper, he goes into
  168. kill mode with the player as his new victim, and the old target returns to
  169. normal mode. But the random-escape-routine mentioned above is also triggered,
  170. and that is one of the reasons why Jason often rather unmasks for a brief
  171. moment only and then pretends to be an ordinary camper again instead of
  172. mercilessly attacking the player.
  173.  
  174. The other reason is that Jason will go into praymode if the player had
  175. discovered the cross and manages to touch him while he is currently "stunned"
  176. by a hit of the player's weapon. This happens quite frequently when attacking
  177. with the kitchen knife (or whatever that small blue/white thingy is), since the
  178. lack of range of the knife requires to get really close to Jason.
  179.  
  180. Furthermore, if the player uses a weapon with very low hitpower, any hit on
  181. the camoflagued Jason will actually increase his strength a wee bit when the
  182. random-escape-routine is triggered.
  183.  
  184.  
  185. 7. THE WEAPONS & CROSS:
  186.  
  187. For each of the playable characters there is a specific list of 11 weapons.
  188. The weapons in that list are placed at random screens at the start of each
  189. round, and any screen may only contain one weapon. Weapon #11 is always the
  190. cross, and the cross can only be placed within buildings at the start of a
  191. round. If you pick up the cross, any camper in prayer-mode will immediately
  192. return to normal operation.
  193.  
  194. The other weapons are:
  195.  
  196. 0 - the pitchfork, effectiveness = 6 hitpoints
  197. 1 - the chainsaw, 6 hitpoints
  198. 2 - the kitchen knife(?), 6 hitpoints
  199. 3 - the small, throwable axe (what is it called in English?), 2 hitpoints
  200. 4 - the javelin, 2 hitpoints
  201. 5 - the trowable hammer, 3 hitpoints
  202. 6 - the throwable fork(?), 2 hitpoints
  203. 7 - the big axe, 8 hitpoints
  204. 8 - the machete or whatever that white pixel bar used by Jason is, 8 hitpoints
  205. 9 - the big axe again, 8 hitpoints
  206.  
  207. Note that if you drop a throwable weapon while it is still in mid-flight,
  208. the hitpoints will be different due to a bug.
  209.  
  210. Furthermore, some of the weapons will be replaced by #0 - the pitchfork with 6
  211. hitpoints
  212. for certain characters:
  213.  
  214. Wendy: #6 - the throwable fork
  215. Amanda: #5 - the hammer
  216. Brian: #4 - the javelin
  217. Stuart: #3 - the throwable axe
  218.  
  219. The game only allows one weapon pickup per screen. If you drop your weapon at
  220. a screen that already contains another weapon or the cross and don't pick those
  221. up before leaving the screen, the other weapon/cross will be secretly placed at
  222. another randomly selected screen when the player walks away from the scene.
  223.  
  224. But the random screen selection routine used for that does not restrict the
  225. placement of the cross to screens within buildings. It is thus possible to
  226. make the cross randomly appear at one of the outdoor screens by dropping a
  227. weapon in the room with the cross and leaving that room.
  228.  
  229.  
  230. 8. SOME NOTES ON THE MORE INTERESTING BUGS FOR THE TECHNICALLY MINDED:
  231.  
  232. - Jason's sprite goes crazy when he is hit while disguised as harmless camper:
  233.  
  234. This bug is caused by the way the spritepointers for "campers under attack"
  235. are computed. There's a total of 5 different sprite sets for the different
  236. camper types and Jason, with each set containing up to 20 different sprite
  237. graphics for the various animations of the corresponding type stored in
  238. sequence (e.g spriteblock #n = type 1, 1st animation frame, block #n+1 = type
  239. 1, 2nd frame ... block #n+19 = type 1, last frame).
  240.  
  241. When a camper is hit by a weapon, there's two sprite graphics to show the
  242. camper bending back, one facing left, the other facing right. Which one is used
  243. depends on where the camper was heading, but since the camper is forced to a
  244. full stop when hit, the actual x- and y- speeds can't be used to determine the
  245. proper sprite (it would result in the camper spinning around under certain
  246. circumstances) after the initial contact. Therefore the game tries to select
  247. the proper sprite by using a kind of "sprite-pointer backup" variable:
  248.  
  249. When the camper is not under attack, this backup variable is set to 0 to
  250. signal later checks that there was no attack on the camper last time. If a hit
  251. on a camper is detected, the backup variable is checked: If it is still =0,
  252. then the actual spritepointer is still valid and used for some complicated
  253. calculations:
  254.  
  255. The camper's type is determinded. The spritepointer for that type's 1st
  256. animation sprite is picked from a table and substracted from the currently used
  257. spritepointer for that camper to isolate the animaton offset (which can be a
  258. value between 0 and about 20). This number is then used to pick the proper
  259. "under attack"-animation offset from another table. The value from that table
  260. is then added back to the 1st animation state spritepointer. Now that result is
  261. the proper "under attack" spritepointer and is copied to the backup variable.
  262.  
  263. If the backup variable was !=0 at the "under attack" -check, not the actual
  264. spritepointer but the backup result is used for the spritepointer computation
  265. described above.
  266.  
  267. That's fine for normal campers, but when Jason is hit, his type will change
  268. from some camper-type to "unmasked Jason" after the first under-attack-
  269. spritepointer computation. Now there's a mismatch between the actual 1st
  270. animaton sprite-pointer and the backup value from which it is substracted, so
  271. the substraction result will be off by a mile, and the routine trying to pick
  272. the "under-attack" animation offset from the table will read some arbitrary
  273. value from somewhere else in memory instead, add that to jason's base spriteptr
  274. and thereby mess it up.
  275.  
  276.  
  277. - Screen flickers when the music switches to another song:
  278.  
  279. The main reason for the flickering when a new song is launched is that the
  280. music driver is integral part of the irq-routines, but parts of it are also
  281. called from the main code.
  282.  
  283. There are two raster interrupts per frame that are selected by testing the 9th
  284. bit of raster: the first at raster #$0b2 that sets the screen to text mode for
  285. the status display area and the second at raster #$100 to set the display to
  286. bitmap mode for displaying the "playfield" area at the upper 2/3rd of the
  287. screen. That 2nd interrupt does also playback the music, and it does so BEFORE
  288. it switches the display mode and BEFORE it clears the irq-latch.
  289.  
  290. Now, the main code calls the song change routine that therefore has to disable
  291. interrupts while setting up the track-pointers to temporary halt the playback
  292. for otherwise the music would likely get out of sync. The setup takes a long
  293. time as only the start of the first track is stored in the song-table, the
  294. track then has to be scanned for its end-mark to find the start of the second
  295. track, which has again to be scanned to find the start of the third.
  296.  
  297. This takes an awful lot of time for huge songs like the main theme and makes
  298. it likely to miss the right time to change to bitmap screen. But even worse,
  299. when interrupts are reenabled after setup, the actual raster is usually
  300. somewhere near the top of the screen, too. Since the latch wasn't cleared, an
  301. unwanted interrupt occurs, checks raster bit 9, finds it cleared and therefore
  302. decides to turn on text mode, when in fact bitmap mode should be selected.
  303.  
  304.  
  305. - Bugs in the bonus point computation:
  306.  
  307. First of all, internally the score, bonus points etc. are only 1/10th of
  308. what's shown on screen. Since the last score digit is always 0, the game does
  309. not take it into account for computations, but instead adds 1/10th of the
  310. appropirate bonus points for various actions to the score and then appends a
  311. "cosmetic zero" to the score display to show the correct number of points again.
  312.  
  313. So far so clever. The survivor bonus routine makes no exception and thus tries
  314. to add the number of survivors*100 to the score, but gets confused by its own
  315. complexity:
  316.  
  317. It first calculates the number of survivors, which is used to poke the proper
  318. digit into the end-of-round info-screen. But instead of simply adding that
  319. number to the 1000s-digit of the score it multiplies that number by 10, and
  320. then calls the "add points"-subroutine that adds that number to the score 10
  321. times in a loop. So, in the end, 10 * (number of survivors * 10) should be
  322. added.
  323.  
  324. But in the process the number of survivors*10 and the loop counter used to
  325. memorize how often the "add points"-subroutine has still to be called and get
  326. mixed up, so the subroutine actually adds survivors*10 only on the first pass.
  327. On the second pass it adds the initial value of the loop counter (=10). On the
  328. next pass it adds that counter's value from the previous pass (=9) and so on.
  329. As a final result of this the player is awarded the number of survivors*10 + 54
  330. pts as a bonus... except if there are no survivors.
  331.  
  332. In that case the "add points" subroutine itself will bug and add 256 instead
  333. of 0 pts to the score. The 54 pts caused by the previously mentioned bug are
  334. also added as usual, so the total bonus will be 310 pts.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement