Campaigning Through A Computor

TRS-80 BASIC Code

By Ervin (Skip) Thompson

Presented below is my 'CAMPAIGN MEDIATOR' computor program. it was developed on my Radio Shack TRS-80 Color Computor, with standard Color Basic and 32 K RAM. This is an inexpensive machine, using a standard T.V. for data display, rather than a high resolution c.r.t. I feel that this type is becoming the hobbyist machine for those without large bank accounts (a 16K, standard Color Basic, Color Computor runs about $500). According to Radio Shack's magazine "TRS-80 Microcomputor News", the Color Computor stands a good chance of being the number one selling computor in America this year.

The program requires about 13.7K RAM, so should run on a 16K Color Computor with standard Color Basic. If you have Extended Color Basic, you will likely need 32K RAM. If you have a different type of machine altogether, you will have to re-write portions of the program to suit your form of basic.

'CAMPAIGN MEDIATOR' is intended to handle interaction between two players conducting a wargame campaign. It secretly determines the end result of various functions, based on information fed to it by the players. Complete honesty is assumed in both participants.

The operations performed by the program are pretty basic to a campaign, which shouldmake it compatible with practically all miniatures rules up to the American Civil War. It will be up to the user to develop support rules that interface the program with the miniature rules to be used. Dan Mclure and myself have been using it with W.R.G. Ancients, with mostenjoyable results.

There are three operations in the program, briefly described as follows:

    1. Recon. Routine--Allows hidden movement. Assigns each force a reconnaissance range, depending upon externally calculated recon. factors.

    2. Combat Result Generator-- if desired, a combat result number is generated based on externally factored combat strengths, and a '4 sided die roll'. Odds fractions greater than 0.5 have a 50% possibility of being rounded up. This is intended to handle skirmishes between reconnaissance forces and small battles. Large battles are usually played out on the table.

    3. Recon Result Randomizer-- introduces varying degrees of error in strength numbers of a force, before disclosure to the opponent.

In addition to its 3 main functions, the program contains support routines as follows:

    1. Coder-Decoder: The opponent secretly enters a code into the program, thereby allowing him to give and receive coded information over the telephone.

    2. Code list verification: Recognizing that the opponent may not be familiar with computor programming, the operator is given the option of having the computor check the opponents code for programming errors.

    3. Illegal code detection: Detects and erases illegal code entries. The mistake is pointed out and a corrected entry is then made.

    4. Recon. data re-entry: After each page of recon. data is entered, the operator is given the option of changing entries on that page before it is committed to the computor.

    5. An optional combat graphic and bugle call routine. This is probably unusable to those with other types of computors.

The players draw a map subject to the following guide lines . . . A square grid is used to regulate movement, each square is identified by a horizontal and vertical coordinate. The coordinate numbering system should start at 20, and go no higher than 90. This is to insure that all coordinate numbers generated by the computor are comprised of two digits. For example, a map with 30 squares on a side, would have horizontal coordinates numbering from 20 to 50.

The maximum movement rate of 3 squares per turn (see below), should be considered when determining map scale.

The players are allowed to move up to five forces on the map. Each turn the coordinates and reconnaissance factor of each force is entered into the computor. The opponent gives this information in the form of six coded digits for each force, the first two are that forces horizontal coordinates, the next two its vertical coordinates and the last two its recon. factor. Dummy, off map coordinates are entered for non-existent forces in the event there are fewer than five. Rules should be written to allow for non-moving city garrisons, which are not entered into the computor.

A reconnaissance range is then assigned to each force by the comutor, based on the recon. factor. The recon. factor is to be determined by the number and type of cavalry with the force, as well as the predominate terrain surrounding it. The recon. range is the number of squares to each side of a force that is under observation by that force. A force with a recon. factor of 0-20 has a range of 1, 21-50 has a range of 2, while 51 + has a range of 3. Only a very powerful cavalryforce should attain a 3 square range.

The maximum recon. range limits movement per turn to 3squares This is to prevent forces moving through each other without being detected. We use the following movement rates: infantry, 1 square,cavalry, 2 squares; road bonus, +1 square. Any force moving 3 squares should automatically be assigned a minimum of 21 recon. factors.

Any squares under observation by both sides are stored in memory until the computor finishes with its 'recon. routine'. These are then printed out as 'squares of contact'. Any square physically occupied by both sides is dramatically pointed out.

Forces who have 'squares of contact' with an enemy force, must conduct 'Recon. Combat' to determine the information obtained by those forces, and how accurate that information is.

Depending on the combat result, information such as main force location, troop types, and strength, should be given out. The accuracy of troop numbers can be subjected to error introduced by the 'recon. randomizer' routine. Three levels of randomization are available: 10, 20 and 30%. The operators randomized strength is reported in code, so he doesn't know what is reported back to his opponent. The opponents strength is entered in code, and decoded when randomized.

Only recon units may take part in recon combat, and only they suffer losses as a result. It is recommended that losses sustained in this way be kept light, the object should be gathering information on the enemy, not destruction of his cavalry. A force need not commit any recon forces to combat, in which case the computor assigns that force a recon combat factor of one.

Now seems a good time to disc'uss the mechanics of combat through the computor. The same procedure is used for all types of combat. Each type of figure is assigned a basic combat factor which can be modified by such things as deemed appropriate. We use the W.R.G. point Cost for each troop type ( x 0.1 as the maximum combat factor the de-coder will handle is 999). The totaled combat factors for the forces in combat are entered into the computor, which then calculates the odds. Odds fractions greater than one half, have a fifty percent chance of being rounded up.

The combat result is reported as a number from 1 to 10. A result from 1 to 4 is a victory for the opponent, 5 and 6 is neutral and 7 to 10 is a victory for the operator. Result 1 or 10 is a smashing victory, while 4 or 7 is a modest success for the respective players. Odds greater than 6 to 1 automatically produce a smashing victory.

Reporting the result this way, makes it unnecessary for the operator to know who has the superior force, when entering the combat factors.

PROGRAM PREPARATION

Before the program can be used, the opposing player must enter his 'code' into the computor. Once entered and verified (described below), the program is re-recorded. I recommend that this recording be made on a different tape than the one containing the original program.

The code is prepared by making a list of 60 single digit numbers (0- 9), making sure that each digit is on the list at least 5 times. The digit zero is used more, so should be entered more often. Each digit's location on the list, is that digit's coded version. In the example below, the code number 29 is 6 decoded.

CODE NUMBER/DE-CODED DIGIT
1/311/121/231/441/651/5
2/7121022/932/842/152/2
3/013/923/733/543/453/3
4/914/224/334/844/754/6
5/115/425/335/745/055/9
6/416/026/036/146/956/0
7/117/227/337/647/557/4
8/018/028/538/748/858/9
9/219/529/639/649/859/8
10/120/030/340/050/760/0

When your opponent is ready to enter his code, load the program in and enter (run 3750). Program lines 1020-1060 containing data lines will be displayed, along with a few REM lines containing instructions. You should now leave the room while your opponent enters his cle- coded numbers into these data lines, in the same sequence as they appear on his code list. 10 are entered in each line (he, of course, must precede each group of 10 with the appropriate program line # and DATA statement). The above example would be entered exactly as follows:

    1020 DATA 3,7,0,9,1,4,1,0,2,1
    1025 DATA 1,0,9,2,4,0,2,0,5,0
    1030 DATA 2,9,7,3,3,0,3,5,6,3
    1040 DATA 4,8, 8,7,1,6,7,6,0
    1050 DATA 6,1,4,7,0,9,5,8,8,7
    1060 DATA 5,2,3,6,9,0,4,9,8,0

When finished, your opponent should 'clear' the screen, and call you back into the room. To insure that the data has been properly entered, have the computor verify it. To do this, 'run' the program and press (v) (as instructed in the program introduction). When verified as correct by the computor, the program is ready to be recorded and used.

A NOTE ABOUT LOADING THE PROGRAM

Hand loading a program of this size, is a fairly lengthy process. I recommend that it be done in several sittings . . . Due to the importance of punctuation, and my system's dot-matrix printing, it may be worthwhile to give an example of each type: period = (.) , comma = (,) , colon = (:) and semi-colon (;). Those with other computor systems might try substituting (*) for CHR$(128) . . . The PRINT@n, instruction is a nifty way of formatting data display, pinpointing any location on the screen without disturbing other data. You will likely have to re-write these using (TAB) instructions, or some such.

4 CLS
3 REM**********MEDATOR4*********
9 REM**REM LINES 9-25 PRE FOR YOUR INFORMATION ONLY,
AND NEED NOT BE ENTERED. OTHER REM LINES ARE
PROGRAM ADDRESSES, SO MUST BE.


Back to Table of Contents -- Courier Vol. IV #1
To Courier List of Issues
To MagWeb Master Magazine List
© Copyright 1982 by The Courier Publishing Company.
This article appears in MagWeb (Magazine Web) on the Internet World Wide Web.
Other military history articles and gaming articles are available at http://www.magweb.com