D.I.Y. Laser Tag Game System

 
 

 

 
Home

 

 

CORE Module
Micro (uMT) Module
Add-Ons
Sensors
Optics
Sound Effects
Tech Stuff
MilesTag Forum
 Online Store 

 

MilesTag Data Protocol

 

MilesTag II Data Protocol (V5.3X, MicroMT)

 

    In the MilesTag system, each time a "shot" is fired, the gun (transmitter) sends a short burst of data encoded onto an infrared carrier signal to the target sensor (receiver).  The data transmitted is composed of 16 bits in the form of a 2-byte data packet, and is essentially the equivalent of an infrared "bullet".  No laser is used in this system, but rather a high-powered infrared LED focused through a lens.  When the receiver is "hit" by the infrared signal, it will attempt to decode the data packet.  If a valid data packet is decoded by the receiver, the receiver will determine whether it is a weapon hit or system message and respond accordingly.  If the packet is incomplete, contains errors, or cannot be correctly decoded, the signal is counted as a "near-miss".

 

  Infrared Carrier Signal

    At this time, the carrier frequency is selectable between 38KHz/40KHz/56KHz.  This carrier frequency range was selected primarily for the availability of low cost demodulator ICs (Vishay, Panasonic, etc.).  These devices greatly simplify the design of the receiver circuit.  Also these frequencies are easily generated by a PIC processor operating on the 4MHz or 8MHz internal oscillator.  Matching infrared LEDs (940nm wavelength) are also widely available at low cost.

 

The system's transmit carrier frequency must be matched to the sensor used.

 

  Data Packet

    The MilesTag data packet consists of a header pulse followed by 16 data bits (two 8-bit data bytes) and 1 parity bitThe header pulse and data bits are encoded onto a 40KHz infrared carrier signal using pulse-length modulation.  This modulation is identical to the format used in Sony IR remotes and others.

 

  Parity Bit (also serves as GameID bit)

    The Parity Bit is the Last Bit Transmitted (17th bit), and performs two functions First, for increased error detection capability, the parity bit can detect single-bit errors in the data packet.  The receiver will then reject any packets with incorrect parity.   (This protection is additional to the bit-by-bit error checking implemented by the receiver code).  Second, the user may select between Even or Odd parity by changing the GameID.  GameA uses Even Parity; and GameB uses Odd Parity.  This allows two separate games to be conducted using the MilesTag system without interference from one another (hits from the other game will only cause a "near miss" indication, but no hits can be scored between games).

    How the Parity Bit works (Even Parity):  As the 16-bit data packet is transmitted, the "1"s in the data packet are counted.  If the total number of "1"s is Even, then a "0" is transmitted as the 17th bit.  If the total number of "1"s is Odd, then a "1" is transmitted as the 17th bit.  So, for Even Parity, the transmitter ensures that the data packet always contains an even number of "1"s.  The receiver can then simply count all the "1"s in the incoming data packet including the parity (17th) bit.  If the total number of "1"s is Even, then the received data is assumed to be good.

    **See parity examples at bottom of this page.

 

 

  Pulse-Length Modulation

    In this modulation scheme, the value of the data bits ("1" or "0") and the header pulse are represented by the length of the pulse.  Each pulse is a burst of 40 KHz infrared light lasting the period (length) of the corresponding data bit.

Thus, a complete data packet will have a maximum length (all "1"s) of  33.0 milliseconds, and a minimum length (all "0"s) of  22.8 milliseconds.

 

To put this in terms of the max firing rate for a weapon, you can achieve rates of 29 rounds per second or 1785 rounds per minute.

 

  Data Bytes

    The data bytes are transmitted MSB first.  The first byte transmitted is Databyte1 and the second byte is Databyte2.

 

Databyte1 (Team & Player ID):

  MSB

TeamID (t)

TeamID (t)

TeamID (t)

PlayerD (p)

PlayerID (p)

PlayerID (p)

PlayerID (p)

PlayerID (p)

 

TeamID   ppppp = PlayerID

001ppppp  Team1 (Red)    

010ppppp  Team2 (Blu)

011ppppp  Team3 (Yel)

100ppppp  Team4 (Grn)

101ppppp  Team5 (Blk)

110ppppp  Team6 (Wht)

111ppppp  Team7 (Pur)

000mmmmm  System Message 

PlayerID   ttt = TeamID

ttt00000  Player0       

ttt00001  Player1

ttt00010  Player2

ttt00011  Player3

ttt00100  Player4

Etc…

ttt11111  Player31

System Messages                                               

00000000  Undefined

00000001  Add Health         

00000010  Add Rounds         

00000011  Add Clips          

00000100  Add RPG Rounds     

00000101  Non-player Hit     {wwwddddd}

00000110  Disable Weapon     

00000111  Secure Code A      

00001000  Secure Code B      

00001001  God Gun Functions  

00001010  Collateral Damage  

00001011  Game Select        

00001100  Weapon Select

00001101  Undefined

00001110  Undefined

00001111  Sys Ex Data

00010000  Score Data Header

00010001  Score Request

00010010  Undefined

00010011  Undefined

00010100  Undefined

00010101  Undefined

00010110  Set Team ID

00010111  Set Player ID

00011000  Undefined

00011001  Undefined

00011010  Undefined

00011011  Undefined

00011100  Undefined

00011101  Undefined

00011110  Undefined

00011111  Undefined

Non-Player Hit   www = WeaponID     ddddd = damage value (multiply by 2)

000ddddd  Claymore (Clmr)

001ddddd  Grenade (Grnd)

010ddddd  50 cal Machine Gun (tripod mounted) (50ca)

011ddddd  Rocket (Rckt)

100ddddd  Mortar (Mrtr)

101ddddd  Sentry (sensor operated gun) (Snty)    

110ddddd  Chemical (Chem)

111ddddd  Radiation (Nuke)

 

Databyte2  (Hit Points / Control Function):

  MSB

Bit7

Bit6

Bit5

Bit4

Bit3

Bit2

Bit1

Bit0

 

(See Table-B , Table-C , Table-D)

 

 

Table A

   TeamID / PlayerID / System MessageID

Databyte1 Function Databyte2 Function Notes
00h not defined      
01h Add Health 1 - 98 Medic  
02h Add Rounds 1 - 98 Re-supply Ammo Max = 98
03h Add Clips 1 - 98 Re-supply Ammo Max = 98
04h Add RPG Rounds 1 - 98 Re-supply Ammo Max = 98
05h NP Weapon Hit Table C WeaponID/HitPoints  
06h Disable Weapon 1 - 20 Seconds Temporary effect
07h Access Code A 0 - 255 Key Code Arm/Disarm/Unlock/etc
08h Access Code B 0 - 255 Key Code Arm/Disarm/Unlock/etc
09h God Gun Functions Table C   Master Controller
0Ah Collateral Damage 1 - 100 Hit Points  
0Bh Game Select 1 - 20 Preset #  
0Ch Weapon Select 1 - 20 Preset #  
0Dh not defined      
0Eh not defined      
0Fh Sys-Ex Data Table E Manufacturer ID System Exclusive Data
10h Score Data Header ?? ??  
11h Score Request NA   put gun in score Tx mode
12h        
13h        
14h        
15h Set Config Code 0 - 255 EE Key Code Remotely change Code
16h Set TeamID 1 - 7 TeamID Remotely change Team
17h Set PlayerID 0 - 31 PlayerID Remotely change Player
18h not defined      
19h not defined      
1Ah not defined      
1Bh not defined      
1Ch not defined      
1Dh not defined      
1Eh not defined      
1Fh not defined      
20h-3Fh Player Weapon Hit Table B Table B Red Team, Player0-31
40h-5Fh Player Weapon Hit Table B Table B Blue Team, Player0-31
60h-7Fh Player Weapon Hit Table B Table B Yellow Team, Player0-31
80h-9Fh Player Weapon Hit Table B Table B Green Team, Player0-31
A0h-BFh Player Weapon Hit Table B Table B Black Team, Player0-31
C0h-DFh Player Weapon Hit Table B Table B White Team, Player0-31
E0h-FFh Player Weapon Hit Table B Table B Purple Team, Player0-31

 

Table B

   Player Weapon Hit

Databyte2 Function Player Health Base Health
0 Resurrect Opponent = 100 no effect
1-100 Player Damage - Value - (Value/4)
101-200 Base Damage no effect - (Value - 100)
201-254 not defined    
255 Resurrect Enemy Base no effect = 100

 

Table C
Non-Player Weapon Hits
Databyte2  (wwwddddd)  
WeaponID Damage Value Player Health Base Health
Chemical* 2 -4 per second no effect
Radiation* 1 -2 per second no effect
All Others 1 - 31 - (Value * 2) no effect
*Fixed wide-angle transmitters.  Transmits once every second as area denial weapon.
God Gun Functions
The "God Gun" is normally used by a referee or game official (non-player) to perform administrative or maintenance functions prior to, during or after a game.  The God Gun functions might also be implemented as functions within a Master Controller device.
Databyte2 Function Player Health Base Health
00h Admin - Kill Player = 0 NA
01h Admin - Pause Player No effect NA
02h Respawn Base NA = 100
03h Start Game  
04h Admin - Respawn Player = 100 NA
05h Admin - Initialize Player Reset Player for New Game
06h Full Ammo Reset player to full ammo
07h Admin End Player Game Over - no change to health
08h not defined  
09h Configure Gun Put gun in configuration mode
0Ah Configure Sensor Put sensor in configuration mode
0Bh Configure Base Put base in configuration mode
0Ch Configure Mine Put mine in configuration mode
0Dh Reset Mine  
0Eh Test Target Mode Put gun in Test Rx mode
0Fh Boresight Mode Put gun in continuous Tx mode
10h Award Point  
11h Award Medal  
12h Award Penalty  
13h Clear Log Clears Player EEPROM Log Items
14h Clear Scores Clear Player Scores
15h Test Sensor Near Miss Tone and Hit LED
16h    
17h    
18h    
19h    
1Ah-FFh not defined  

 

Table D
Secure Access Codes
Databyte1 Databyte2 Function
$07 $00-$FF 256 possible codes
$08 $00-$FF 256 possible codes

Any of the 512 possible Secure Access Codes can be freely utilized for a variety of purposes, such as:  open an electronic lock (or a series of locks); initiate or stop a countdown; arm or disarm an alarm system; disarm a bomb; etc.  The large number of codes will make it difficult (or at least time consuming) for opponents to "crack" the code.  There are endless possibilities for using these codes.  Could construct small keyfob transmitters as "keys", etc.

 

Table E

   Manufacturer IDs for System-Exclusive Message Packets

Databyte1 Databyte2 Function This is used as a header for system-exclusive data transmissions.  Total # of bytes transmitted is defined by the manufacturer.
0Fh 00h MilesTag
0Fh 01h FragTag
0Fh 02h RealTag  
0Fh 02h-FFh available    

 

Table F

   MilesTag System-Exclusive Messages (Databyte1=0Fh, Databyte2=00h)

Databyte3 Function      
00h not defined      
5Ah not defined      
FFh Clone Data Header      

 

 

Clone Data Transfer: (MilesTag)    [0Fh]--[00h]--[FFh]--[Parameter1]--[Parameter2].......[ParameterXX]--[Checksum]

 

  DATA EXAMPLES  

This should help demonstrate how simple it is to construct MilesTag packets.  All examples show Even Parity (GameA).

Typical shot fired from player's weapon:  (anti-personnel ammo)

0100 0011 0000 1100 1

Team 2; Player 3; 12 hit points (3 hit points against base); parity

Typical shot fired from player's weapon:  (anti-base ammo)

1111 0100 1000 0010 1

Team 7; Player 20; 30 hit points against base; parity

Resurrect Opponent command fired from player's weapon:

1010 1000 0000 0000 1

Team 5; Player 8; Resurrect opponent; parity

Configure Receiver command transmitted from God Gun:

0000 1001 0000 1001 0

System message; God Gun; Configure Gun; parity

Load 6 clips into gun from "ammo box":

0000 0011 0000 0110 0

System message; Load Clips; 6; parity

Shot fired from 50 cal tripod mounted weapon:

0000 0101 0100 1101 0

System message; Non-player Weapon; 50 cal; 26 hit points; parity