Browsed by
Month: August 2016

CMANO Import Files (.inst) to Google Earth (.kml)

CMANO Import Files (.inst) to Google Earth (.kml)

As a game referee one of my initial challenges is to be able to communicate unit positions and line of site without depending on a player actually having Command (although they’d be whole a lot cooler if they did!). Google Earth is the best choice as a viewer as it is platform neutral, free and players can get better visuals of terrain and line of site than Command currently provides. Luckily Command import files (filename.inst) can be leveraged as they have the necessary fields in them (name, latitude and longitude)that with a little regex action you can write your own .kml file to drop placemarks with unit names into Google Earth.. I chose Perl because I know it and its just good at regular expressions.

The workflow to accomplish this is.

  1. Generate an import file in Command.
  2. Place .inst file in script directory.
  3. Replace input and output file names in the perl script with whatever you want.
  4. Run Code using installed perl interpreter (Strawberry).
  5. Click the KML file to launch in Google Earth.

Perl Code:

#!/usr/bin/perl
#You will need a PERL interpreter to run this. Suggest strawberry.
#All files should reside in same directory as script. Make sure you place the Command .inst file in the script directory.
use strict;
use warnings;sub main {
#Name of your input file
my $input = ‘tankpos.inst’;
open(INPUT, $input) or die(“Input file $input not found.\n”);
#Name of your output file.
my $output = ‘tankposout.kml’;
open (OUTPUT, ‘>’.$output) or die “Can’t create $output.\n”;
print OUTPUT ‘<?xml version=”1.0″ encoding=”UTF-8″?>’;
print OUTPUT ‘<kml xmlns=”http://www.opengis.net/kml/2.2″>’;
print OUTPUT ‘<Document>’;
print OUTPUT ‘<name>Tankposout.kml</name><open>1</open><Style id=”exampleStyleDocument”><LabelStyle><color>ff0000cc</color></LabelStyle></Style>’;
while(my $line = <INPUT>)
{
if($line =~/MemberName/)
{
my @fields = split/”/, $line;
my $name = $fields[3];
print OUTPUT “<Placemark>\n<name>$name</name>\n”;
}
if($line =~/Longitude/)
{
my ($long) = $line =~ /(-?\d+\.\d+)/;
print OUTPUT “<styleUrl>#exampleStyleDocument</styleUrl><Point>\n<coordinates>$long,”;
}
if($line =~/Latitude/)
{
my ($latitude) = $line =~ /(-?\d+\.\d+)/;
print OUTPUT “$latitude</coordinates>\n</Point>\n</Placemark>\n”;
}
}
print OUTPUT “</Document>”;
print OUTPUT “</kml>”;
close(INPUT);
close(OUTPUT);
}
main();

 

Future goals for this:

  1. Different language with stand alone executable so users don’t have to install a perl interpreter. My goal is to build systems that have as few steps as possible.
  2. Speaking of. Think about a web language as eventually want to devise a way for players to generate this on their own via a web site button.

Notes:

  • FYI. KMZ files are actually zipped archives. To get to the KML inside just change the file extension from kmz to zip and you can grab the kml.  If you want look at the source open the kml in a text editor.
  • KML source is not complicated but given the range of options you can add it can be tedious. Use only what you need.
Homebrew Wargaming

Homebrew Wargaming

The first and likely a lifelong project I’ll be reporting on will be an exploration of methods and tools wargamers can use to game modern conflicts with others.  My sense is along with many great desktop wargames there are a lot of business oriented IT tools and methods that can be leveraged to help gamers build, process and communicate outcomes efficiently. I also hope to use it to actually host a modern MBX type war gaming in the future. This should benefit any future CMANO multiplayer implementation as well.

The “Why do this” for me goes back to CPX/MBX type wargames such as Global Thunder and Europe 88.   MBX games were play by email games that used human referees, home brew rules and commercial wargames to process interactions and websites and email to report outcomes.  Global Thunder and EU88 were the most successful as the refs actually had the time to do the work of building nice websites and crafting emails and in EU88’s case had a scope was small enough to be manageable. Follow on projects failed one after the other as the work turned out to be too cumbersome and people started having more fun things competing for their free time.

Our solution was Command aka “The Game we always wanted”. The catch is game actually started as two. One was an earlier form of what you see today and the other was strictly a game aid. The idea was a ref could drop some units in, game interactions and we’d come up with some brilliant ways to report out (Flat file to API). This was short lived though as we soon discovered a commercial interest in the game and more or less dropped the less marketable variant in hopes we could first get the game out and then add the wargame tools we needed to accomplish a MBX and/or multiplayer.  Resources were slim and we couldn’t possibly manage two different code bases and meet a deadline for something that might give us a return that we could then use to grow.

Today Warfaresims is still chasing commercial and now professional  requirements but the good news is there has been forward movement. First, many pro requirements actually overlap. Professionals want a great tool and Command really is it. While I can’t get into details my gut feeling is they will drive us closer to full multiplayer, good reporting and the ability to use Command independently of any other system.  Second, in the commercial realm Baloogan has developed Joint Command which is a helper app that allows players to play a turned based form of multiplayer and report results. It has showed real promise and provided good evidence that it is worth time and effort on the commercial side.

So the question is why am I looking at other tools and methods if Command will have these?  The first reason is I am impatient. I have waited years to do this, hit forty and suddenly realize I’m now on the back nine of life and better get some war gaming done. Second, there are pen and paper wargamers that will never use a computer wargame. They don’t like them mostly because the lack of transparency, human interaction and the AI can be a real idiot. I totally agree but the IT weenie in me wants to still find ways to help them find methods and tools to do what they love more efficiently. Exploring ways computers can help people do their thing has always been a thing for me.  Finally, it’s a challenge. I need to work a bit outside my comfort zone and see where I can go and what I can learn.

This all being said the project stuff will be under Homebrew Wargaming. I hope to hear some feedback as things progress and hope you get something out of it.