# Hacking NEC PC Games/Game Analysis

Hacking a game begins with analysis. Through analysis, one creates meaningful speculations and hypotheses about how the game functions. These thoughts can then serve as a guide as to what to look for in the code. In particular, one wants to conceptualize of what sub-units the game may consist of and how they might work together.

##### Modes of Play

If you think of the process of playing a game, you think of it as as series of stages. There's the boot up sequence, during which you may see a logo and hear some catchy music. After which comes the title screen, where you might be presented with a menu of choices for deciding on how you want to play the game: by starting a new game, continuing an previous one, choosing how many people to play with, and configuring the game. If you start a new game then depending on the game you might go straight to the action, or as is usually the case in NEC PC games, you go to a menu of some sort for creating a new character before finally seeing that character in something that looks vaguely like recognizable environs. Maybe there will be an exposition sequence with beautifully drawn artwork that creates fodder for your imagination and draws you deeper into the game's setting, a cinema. Each of these stages represents a distinct game play experience, a "mode of play".
From a programmer's perspective, supporting different play modes is a lot of work. A body of code, called an "engine", must be created for each distinct mode. If you are designing for a machine which your game is taking to the limit, you're likely not going to have a lot of free memory to play around with. You'd like to add a few more graphics to the scene you're making, or a longer musical score, but the engine is taking up so much memory already. But you are no programming novice -- you're an expert trained in software design from the ground up, and because of this you know that you have options. By separating the game's code into distinct programs, you can program the game to keep in memory only that code essential to the modes of play the player needs immediate access to; the rest can be unloaded until it is needed again, then reloaded directly from the game disks (after all, if you're going to make the player swap between four floppies anyway to access all that content you created, you'd might as well give them their money's worth, right?) You carry out your design, compartmentalizing your game into four distinct executable files that the main executable can load into memory on-the-fly to change the mode of play. The implementation of these "overlays" into your program design ends up saving you 100 kilobytes, an hefty amount that ends up greatly increasing the quality of your finished product.

##### Recognizing Play Modes

Situations which require specific code to implement design are generally recognizable. As a rule, it is proper to futher differentiate/compartmentalize the code base
* whenever there is a substantial difference in the game interface between two modes.
* when there is a need to present game elements from a different perspective.
* when there is a substantial difference in game play and interaction.
In all of these situations a transitional pause in the game play can be imposed without breaking immersion, providing time for the management of overlays. In the interest of maximizing the presentation of content and providing for maximum depth of play, it is reasonable and expected that overlays be used, meaning they probably are. The basic unit of a game, then, is mode of play, and for each mode of play there exists a distinct body of code which is unrelated to the rest. Exploiting this understanding will save you, the hacker, a lot of time as you hone in on the code specific to the function you want to understand.

#### Elements of a NEC PC Game

Games have common elements each of which are characterized by one or more unique modes of interaction and play. These include
* Intro
* Title
* Main Menu
* Character creation/selection
* Cinematic presentation (movies and stills)
* The play field/exploration
* Contests between the player(s) and and computer
* Character maintenance and management