Databases are a serious tool but they can be fun, too. The adventure generator program shown in Figures 7.1 through 7.4 shows how a database can be used to fuel an adventure game generator. The adventure generator is a system that allows users to create and play simple "multiple choice" adventures. This style of game consists of several nodes. Each node describes some sort of decision. In each case, the user will be able to choose from up to three choices. The user's choice leads to a new decision. If the user makes a sequence of correct choices, he or she will win the game.
This program is interesting as a game, but the really exciting part is how the user can modify this game. A user can use the same system to create and modify adventures. Figure 7.3 shows the data behind the enigma game. Note that you can edit any node of the game by clicking on the appropriate button from this screen.
If the user chooses to edit a segment, the page shown in Figure 7.4 appears.
As you can see, the structure of the data is the most important element of this game. You already know some ways to work with data, but this chapter introduces the notion of relational database management systems (RDBMS). An RDBMS is a system that helps programmers work with data. The adventure generator program uses a database to store and manipulate all the data.