Stand At Mortain module programming notes Player controls: Readout explanations for check cycle unit pointer cursor, activation points remaining counter (countdown) value, unit step capacity indicator. ~Check cycle options for All or Rdy (=phasing/ operative and unacted) see next usrPik() focus unit cycle: When checking "rdy" units, cursor will highlight all "phasing" units (those active/ operative this round), which haven't already acted this round. When no such units remain during a round, the cycle condition will automatically switch to "all" units. When checking "all" units, those which have already acted won't have an option shown in their move/fire capability fields. Unit status: UntStp field - Destroyed/ out of play units are indicated by a value of 0. All units begin with a value of 1 in this field, indicating no hits taken, and the value of this field is incremented with each hit taken by the unit. Thus, units with 2- step capability at maximum strength are indicated by a value of 1. A unit of only 1- step capability whose UntStp value would increase to 2, or a unit of 2- step capability whose UntStp value would increase to 3 has its value changed to 0 instead. UntOri field shows unit's starting hex at beginning of turn, unless unit had entered map from off- board; when UntOri field value is set to hex coo of entry at the beginning of the round following entry (allowing for checking of whether a unit entered from off- board during the current round, as well as providing an on- board starting point hex in successive rounds). UntAct field set to zero at start of round for all units. A friendly unit may be moved or make an attack only once each round and an enemy may be attacked only once each round, so this field gets set to Mov (or Roa* #road hexes moved if the roaLim opt is used) or Fir for friendly actions during a round, or to Atk for an enemy unit attacked during the round in order to prevent it being targeted a second time. If the Tiger unit confers or is conferred an activation cost waiver, the unit which receives the waiver has its UntAct field set to -1. Coordinates layout: ~map section plus 2 wing spaces - map reserves coo cols 0..10 (0 & 10 req for map edge road extension plotting) - upshifted even cols map coos translate to downshifted even cols coded coos as 1101= 102 & 1201= 201 etc. - wing spaces are ea 2 cols of 5 rows, with the lft wing coded coos 1101..1105 & 1201..1205; and the rgt wing coded coos 2101..2105 & 2201..2205 Order of stacked units in hex: The unit which a controller wishes to be topmost in a hex is marked by a '+' preceding the val in that unit's UntOri coo field. locElm(): Finds itms whose field entries *start with* spec'd $ Activation cost waiver coding: ~UntAct field val of 0= unacted, or if waivered= -1, or -2 if using road movement variant and 1 road move already made by unit. Acted unit val= 1, or 2 if using road movement variant and both movement hexes used. variants: Road use option (roaLim int var): Unit following road may move up to set limit of n hexes by paying 1 activation point per hex. Reserve units entry to stack option (is1up, is2go boolean vars): Unit entering from off- map to a hex occupied by another unit which entered that round pays no additional activation cost and allows that stack/ hex to qualify for rounds in which 1 unit or stack may be activated (is2go). May apply only to GER Tiger unit which can activate free with a colocated unit anyway (is1up). Air cover targeted on vacant hex: Gives the US player something to do when red cards are drawn at the start of the game. Need explanation of rationale: Tiger antiarmor stat, cap (figure the opposite) German impetus & sco control viz cards passing, map entry Line of Sight: ~losIni() can be (and is) called as though of void type hexBlk values for checking if rough terrain hexes block an LOS of vertex- joining type: 0= standard, 1= either, 2= both. Standard means LOS is blocked only if the higher- numbered coo hex of the shared hexside is rough (iaw LOS formula default for a unique contiguous path of hexes each with two joining sides). Either means LOS is blocked if either hex of shared hexside is rough. Both means LOS is blocked only if both hexes of shared hexside are rough. Autorun feature: In addition to player versus player gaming, the program provides an automated opponent to play either the American or German forces as desired. As an experimental tool for fostering a better understanding of the situation and getting the gist of the game, an autorun feature is also included: by which the computer can play both sides, with the user just acting as an observer. The user can preset the autorunning program to pause at the beginning of each round or each turn; or at the end of each event (move or attack) or not until the end of the game. If not set to pause at the beginning of a round or end of an event, the program calls a Timer class which delays for a tenth of a second at the beginning of each round in order to flush the subroutine return stack so as to prevent a stack overflow (one of the disadvantages of using the oj style of goto coding). Also note the difference in speed between running from a .jar file versus a .class file, as mentioned in the oj template info. Autorun play typically isn't interrupted when the applet loses focus. If desired to pause autorun when focus lost, see revision of if(isBrf) for txt("2.. in begRnd(). AI: Because a unit can't both move and fire in the same round, a probability distribution assuming alternating rounds means the advantage lies with the side which attacks in place when the enemy moves into range. This is especially true since only a few of a side's units might be able to activate on a given round preceeding an opponent round, so a piecemeal advance, barring an unlucky run of cards, can be shot to pieces without getting any effective counterfire, and even if a side making an assault gets more than one round in sequence, the advancing units must divide their activation points between movement of supporting units into range and fire of those already engaged, whereas the opponent units in position are already concentrated and need only allocate points to firing on their rounds.