It started as a script to profile and play around with blamcon light guns but has turned into a full-blown game output handler. Currently connects to the network outputs from MAME and Demulshooter. Can leave it running or load per game, it should adjust based on processes it can see. It translates outputs into serial commands and relays those to the device. It's currently just proof of concept so expect bugs. Written in python so should run anywhere python is supported.
Devices are configured with profiles, you can name the profiles whatever you want. Configuration files will be put in a folder named after the profile name. A game may have configuration files in multiple profiles allowing you to configure how each device attached to that profile responds to the outputs.Each device maintains its own queue. Outputs are broadcast to all connected devices allowing devices respond to configured outputs.
example: #CLWAMMO:00FF00:FFFF00:FF0000#
Default configuration file "blasty.ini" will be created on first run next to the program. Device player id's, profile and connection settings are configured here for each device you want connected. Other options will be here if they enable something per device. Output monitoring for example.
Default configuration files are created in the config folder as well as each profile folder. Game configuration files are created automatically in the config folder only and serve as starting templates. The first time you play a game the default settings will be used to make the game configuration file and then any outputs it receives without default configurations will be added to the outputs section as well as all value positions monitored; commited out and ready to configure. Game configuration files in profiles need to be manually created. The default.ini settings will be used if no game specific configuration file is in the profile/directory.
Blasty uses ini files and requires serial commands to be defined.
example:
P1_CtmRecoil=|FB.0.1+
Each output coming from the game has a name and a value. Each possible value for a given name will be separated by a "|". These values will be tied to serial commands that are sent to the device. So in the above example a value of 0 will send nothing but a value of 1 will send "FB.0.1+" to the configured device. Multiple commands can be added for a value using a ',' as seperator.
To make things easier token replacement can be used.
example:
P1_CtmRecoil=|%RECOIL%
P2_CtmRecoil=|%P1_CtmRecoil%
or even better:
RECOIL=|FB.0.1+
P1_CtmRecoil=|%RECOIL%
P2_CtmRecoil=|%RECOIL%
When either P1_CtmRecoil or P2_CtmRecoil has value 1 it will use what RECOIL has for value 1. Note that if a token replacement is used it still uses the command at that value. If P1_CtmRecoil or P2_CtmRecoil has a 0 value there is no token replacement for that value in the above example.
If a value is read beyond what is configured it will use the last value. So for example:
P1_Ammo=|CM.26.1+FB.1.1+
If an output of "P1_Ammo" has a value of 10 it will use the last value configured which would be 1. Because of this behavior we have a couple special tokens that adjust the value. RMP,EVL,RVL allow modifying value or current command at the value.
To monitor the commands being assembled from the configuration enable monitoring on each device to monitor in the blasty.ini by putting a 1 on the monitor option. Next in the game configuration put a 1 for the monitor option in the general section. To see serial command timing and expired status put a 2 for monitoring in game configuration.