Classic Computer Magazine Archive COMPUTE! ISSUE 74 / JULY 1986 / PAGE 36

Hex War

Todd Heimarck, Assistant Editor

You float high above a distant planet, controlling robot armies below. Can you take control of the priceless mining turf pianetside, or will your opponent's robot crews prevail? To win at this thoughtfully designed, engaging strategy game, you'll need foresight and conceptual skills rather than a quick hand on the joystick. The original version is written for the Commodore 128. We've programmed new versions for the Commodore 64, Apple II series, IBM PC/PCjr, Atari 400/800/XL/XE, and the Amiga. A joystick is required to play the Commodore 128 and 64 versions. The IBM PC/PCJr version requires Cartridge BASIC for the PCjr and BASICA plus a color/graphics adapter for the PC. The Atari version requires a joystick and at least 48K of memory. The Amiga version requires 512K. "Hex War" is a two-player strategy game that can be played five different ways, and there are limitless variations. But the basic premise is always the same: You and an opponent move armies on a field of hexagons, attempting to capture territory.

The goal of the first two games is simple: capture the capital city of the other player. In game 1, the capital cities are far apart; you must devote some of your armies to defending your own capital while attempting to breach the walls of the other capital. Game 2 puts the capitals near each other, so offense and defense tend to merge in this scenario. Most of the action takes place within a small area of the battlefield.

Games 3 and 4 spread the action over a wider area. In the third game, your object is to occupy eight of the twelve cities on the game board. Six cities occupy the periphery, and six are in the center of the playfield. Game 4 requires actual control of six cities; you must have an army in the city, one that's not involved in a battle, before you're credited with control (this version will probably take the most amount of time to play).

Although the first four scenarios encourage a commitment to battle, you employ different tactics in the fifth. The goal here is to acquire 40 of the 61 hexes, so you need some free armies to move around. As soon as you claim 40 hexes, you win the game.

Typing It In

Hex War is written in BASIC, with some important information in DATA statements. Type in the version for your computer and be sure to save a copy. Refer to the notes below for special instructions specific to your computer. After the game has been saved, type RUN to begin playing.

When you first run Hex War, the computer pauses to set up the screen, then displays a menu of five choices. The five different games are explained in detail below. If you're new to the game, press the 1 key to choose game 1. There will be another short pause while the variables are initialized, and then you'll see a playfield with 61 hex shapes, containing four armies on each side (see photos).

Hexes And Hexadecimal

A chess board has 64 squares arranged in a rectilinear grid. Hex War gives you a playing field of 61 hexagons (almost as many as a chess board), but they're part of a six-sided honeycomb field. If you've played war games before, you may recognize the hexes.

If you're using a Commodore 128, 64, or Atari computer, plug in the joystick before playing (use port 2 for the 128 and 64). The other versions use keyboard controls as explained below. At first, the cursor movement may seem unusual. The cursor travels not up-down/left-right, but northeast-southeast/ northwest-southwest. To make the movement less confusing, turn your joystick 45 degrees clockwise, so that what was up becomes northeast, and so on.

Each hex has six neighbors, so an army can move in six possible directions. To travel left and right, you'll have to push the joystick twice (for example, up and right on the joystick to move one hex to the right, which counts as one movement).

Army strengths are listed in hexadecimal (base 16) numbers, so the four armies labeled 40 actually have strengths of 64 (the hexadecimal value 40 equals 64 in our everyday decimal numbering system). At the beginning of a turn, any army has exactly three movement points. It requires one point to move an army into a neutral or enemy-controlled zone. To move through the same zone also requires a point. To move into and through a friendly hex requires a total of one point. This means you can move a single army through two neutral or enemy hexes in any one turn, but the same army can move through up to three friendly zones during a turn.

Select an army by moving the cursor onto it. Click the joystick button once, then position the cursor on a neighboring hex and click again. If you wish to stop, click again, and two plus signs (+ +) will appear, signaling that no more movement can occur. Otherwise, position the cursor on another neighboring hex and click.

Zones Of Control

Each army controls the six contiguous hexes surrounding its resident hex. If you enter an enemy's zone of control, you forfeit any additional moves and must prepare for battle. In addition, an army that begins the turn in a zone of control cannot move until the battle is resolved.

Robots Vs. Robots

In this game, you aren't really on the planet, but parked high above it in a remote mothership. You've landed some robots to explore the area, and they've encountered robots belonging to another explorer. Your robots, or bots as you call them, follow your orders to advance toward the other bots. Each bot has a mining laser which can stop or disable the other bots. Also, your bots have disruptor beams which can daze another bot, temporarily confusing it. When two bot-groups come close to each other, they shoot lasers and disruptors until one army of bots is disabled.

Three things can happen to a robot which suffers a hit. If the robot suffers a direct hit in its logic unit by a laser, it is vaporized. It is destroyed forever and never reappears in play.

The second thing that can happen is injury. If the laser beam is deflected, the robot is out of commission until it can be transported back to a botspital. An injured bot is frozen in place until the battle is finished, after which the victorious army carts away the injured bots to be repaired and reused.

Thus, winning a battle means you evacuate both the friendly injured and the enemy injured. After all of the injured bots recover, they join the force in whose botspital they were healed. In effect, injured bots eventually become members of the army which won the battle in which they were damaged.

The third possibility is confusion: The robot is temporarily disoriented for two turns. When the time has passed, the robot is ready again.

Reprogramming Bots

Moving the cursor onto an army of robots brings up a status window in the upper-left corner of the screen. The number in reverse video is unimportant; it's the army number (which may change as the game progresses).

The four numbers underneath are significant, however. The first is the army's active strength (in decimal). The second is the number of injured robots, which will be transported to the botspital of whichever side wins the battle. The third--on the line below--is the number of disrupted robots who will be available for combat in the next turn. The fourth number is how many robots can join the active force two turns from now.

If one side is able to reduce the other player's active force to zero, two things happen. The winner sends all injured bots away to be repaired. The winning side also collects all enemy bots (injured or dazed) and sends them to the reinforcement center to be reprogrammed. Eventually all these bots will available to the winner of this particular battle for future engagements.

Reinforcements And Mergers

At the start of the game, you'll see some armies positioned outside of the hex field. These are reinforcements and reserves in transit to the battle. Player one's reinforcements enter at the bottom right corner; player two's enter at the top left. The line of new armies moves counterclockwise; the army next to the entry point is the next to enter the battlefield.

However, the reinforcements cannot enter the battlefield if an army (friendly or enemy) is blocking their way. Keep your armies off your own reinforcement point, and try to block your opponent's armies from this area if you can. If the entry hex is owned but not occupied by your opponent, you'll lose some reinforcements.

After completing a turn, you are credited with additional reinforcements according to how much territory you own. Passing over a hex allows you to claim it; the hex changes color to indicate ownership. Each piece of property provides enough ore and energy to build a new robot, available for use two turns in the future. The numbers in the line of reinforcements. are updated after you move to show additional robots being built.

Winning a battle also provides additional armies in the line of reinforcements. As mentioned above, a victorious army captures any dazed enemy bots, which are reprogrammed and available in three turns. At the same time, the winner evacuates injured bots of both sides. Transportation and repair take five turns for friendly bots, seven for enemy bots. The two additional turns are needed for reprogramming the opponent's forces.

If you're losing a battle, the number of injured robots (displayed in the status window) will begin to rise. Remember that, if your opponent reduces your active strength to zero, he or she will capture all of your injured bots; they'll be reprogrammed and added to future reinforcements. To prevent this from happening, you're allowed to bring in a second army for merging. Simply move another army on top of the army with which you want to merge. There's just one rule: One or both of the armies must have a strength less than 32 decimal (1F or less in hex).

The Commodore 128 version of "Hex War," an absorbing strategy game with many variations.

"Hex War" For Atari 600XL, 800, 800XL, 1200XL and 130XE.

"Hex War" for the Commodore 64.

Apple II "Hex War."

Customizing The Scenarios

The five built-in scenarios provide plenty of variety, but if you'd like to add more challenges, here are some suggestions. (The following line number references are for the 128 version of Hex War, Program 1; other versions may differ slightly, although the variable names are the same in most versions.)

First, a note about the logical organization of the grid. The variables T and B, CT and CB, and HT and RB are used to locate the coordinates on the playing field (see figure). The first number is T (or HT or CT), the second is B (or HB or CB). These coordinates are also used in the three-dimensional MAP array (where level 0 of the array is the army number, 1 is the current owner and 2 keeps track of whether or not a city is located there); they're also part of the ARMY array. By varying the starting position, number of armies, reinforcement strengths, and location of cities, you could simulate historic battles.

To add or subtract cities from the field, change the value of CN in line 50. You'll also have to change the DATA statements in lines 270 and 280. The numbers there are the T and B coordinates of the cities.

The strengths and locations of the armies can be changed as well. The DATA statements starting at line 1540 determine the strength (64) and T/B coordinates for the armies at the beginning of the game. If you wish to start with more armies (or fewer), you'll have to change the inner FOR--NEXT loop (with the index of K) in line 1500. In that same line, change NX(J) to one number higher than the number of armies on each side. For example, if you want six armies apiece, change NX(J) to 7. The subroutine at line 1600 sets up the reinforcements; if you don't like the random patterns, change the formula here.

Variables defined in lines 70--90 control the play of the game. PN determines which player goes second; it can be either zero or one. Variable ME controls the maximum merge strength. If you'd like to be able to merge any two armies, change it to a high value (512, for example). To remove the merge option altogether, change ME to zero.

The movement points are defined by MM in line 80. Movement across friendly territory takes one point, across neutral or hostile territory two points. Increasing MM will give your armies more mobility. The three variables KA, KB, and KC affect the outcome of individual battles. KA determines how many bots are vaporized, KB controls the number injured, and KC affects how many are dazed. If you make the fractions smaller (1/24, for example), the battles end more quickly. The subroutine starting at line 2600 resolves current battles.

Commodore 64 Version

The 64 version of Hex War (Program 2) looks and plays exactly like the original 128 version. However, one additional step is needed before you run the game. After you have typed in the game and saved it on disk or tape, type this line in direct mode (without line numbers):

 POKE 44,64:POKE 64*256,0:NEW 

Be sure to press RETURN after you type the line. Now load and run the program as usual. It is very important that you perform this step before running the program: If you don't, the screen will be jumbled and impossible to decipher.

You may find it easier to let the 64 handle this chore for you. Program 3 is a short loader which performs the setup, then loads and runs Hex War. To use the loader, you must have Program 2 saved with the name HEX WAR on the same disk or tape as Program 3 (for tape, Program 2 must follow Program 3 on the tape and the DV=8 in line 10 of Program 3 must be changed to DV= 1).

Atari Version

In the Atari version (Program 4), armies are maneuvered using a joystick plugged into port 1. Joystick controls are the same as described above for the 128 version.

This version generates extra colors in graphics mode 0 using a technique known as artifacting. However, the resulting colors may vary on different Ataris, so a small change may be required. The game should start with the red army at the top of the screen and the blue army at the bottom. If that is not the case on your machine, change the following line:

ND 4077 RESTORE 4140:POR P=CHSET+240 TO CHSET+247:READ B:POKE A,B:POKE A+8,B*2:NEXT A:RETURN

If the colors are not corrected, the machine may appear to declare the wrong side the winner at the end of the game.

Apple Version

Program 5 is for all Apple II-series computers using either DOS 3.3 or ProDOS. To get the full benefit of the detailed high-resolution graph ics, a color monitor or color TV is recommended. (The program incorporates the HROUT high-resolution graphics routine from the "Apple Superfont" article in the April 1985 issue to generate these graphics.)

Use keyboard controls to maneuver armies in this version. Press the period (.) key to go northeast (use the > symbol on that key as a reminder), the comma (,) key to go northwest (note the < symbol on that key), the -> to move southeast, and the e- key to move southwest. Use the space bar to select or set an army. Press RETURN to end your turn before all your armies have been moved. A player indicator appears in the lower-right corner to indicate which player has the current turn.

The IBM PC/PCjr version of "Hex War."

"Hex War" for the 512K Amiga.

IBM PC/PCjr Version

Like the Apple version, the IBM PC/PCjr version of Hex War (Program 6) uses keyboard controls instead of a joystick. Press cursor-up to go northeast, cursor-right to go southeast, cursor-down to go southwest, and cursor-left to go northwest. If you can turn the keyboard 45 degrees in a clockwise direction, these directions will seem more natural.

Use the space bar to select or set an army. Press ESC to end your turn before all your armies have been moved. A player indicator appears in the lower-right corner to indicate which player has the current turn.

Amiga Version

The Amiga version of Hex War (Program 7) requires 512K of memory and is written in Amiga BASIC (not the ABasiC which was shipped with early Amigas). Before you start typing the program, notice the small left arrows at the end of each program line in the listing. These indicate the end of each program line, and are not intended to be typed (in fact, we deliberately chose a character that's not available on the Amiga keyboard). Instead, press RETURN wherever you see a left arrow in the listing.

This game uses exactly the same keyboard controls as the IBM PC/PCjr game (see above). Move the cursor on the playfield with the cursor keys, and press the space bar to pick up or set an army. Your turn ends when all your armies have moved or when you press ESC.

Amiga Hex War includes synthesized speech to emphasize various events and provide information during the game. For instance, when you select an army, the com puter tells you the number (in decimal) of robots in that army. If you're not familiar with hexadecimal numbers, this feature can help you learn hex notation.

Either player can turn the speech off or on at any time. Simply click the mouse button twice: A small Window appears and the computer announces the current voice status. If speech was previously activated, it now shuts off, and vice versa. Click the mouse button once to erase the window and resume play. A similar window appears to announce the outcome at the end of each game.