• Posts
  • RSS
  • ◂◂RSS
  • Contact

  • How to run Diplomator

    June 24th, 2013
    diplomator, games, diplomacy, tech  [html]
    On Saturday I searched for [diplomacy mac] and found the top result a little strange:

    search results for [diplomacy mac]

    This is a program I wrote in high school and uploaded it to sourceforge. Softpedia is apparently redistributing it, and they claim they've tested it and found it "does not contain any form of malware, including spyware, viruses, trojans and backdoors":

    This is kind of surprising, given that there's not even any documentation on how to run it. The site and claim seemed sketchy enough that I thought they might have added malware to the program. Curious as to what they might have changed, I downloaded it from them and compared that to the sourceforge version, but the .zip files were identical.

    One problem with the program is that if you're not me it's not obvious how to run it. So, let's write some docs I should have written nine years ago.

    When you download the program you'll get dipper_0-1-8.zip. If you open it up you'll see a lot of random files and no readme:

    You need to run Game.class. On a mac that means double clicking it; on other systems that probably means opening a terminal, going to that directory, and running java Game. When it starts it wants to open an existing game:

    This makes no sense; wouldn't most people downloading this prefer to start a new game? And why isn't there even an option to start a new game. What was I thinking? But we can open another game and then reset it back to start. So let's open "default game":

    Clicking "File > Restart" we get a fresh game:

    Your first reaction is probably to try clicking on the units to order them around, but that doesn't work. Why not? The program doesn't know what pixels of the map correspond to what provinces. At the time I thought doing that would require specifying the borders of every province, but now I realize I could have just done something like a flood fill to get all the pixels in a province. I didn't think of this then, so instead you have to enter orders as text.

    The order parser is very strict. Enter orders in any format other than what I have in my head, and you'll get an error:

    The allowed format for orders is:

    • Nth -> Den
    • Nth S Den
    • Nth S Den -> Skg
    • Nth C Yor -> Den
    Once you get past these questionable design decisions, however, it does work.

    My goal in writing it at the time, however, was to learn about AIs. If you read the code it's full of lines like trust -= BROKEN_PROMISE_NOT_TO_ORDER * attention but I don't think I got any of that actually working. Instead I think it's just choosing a legal order at random for each unit, with some attempt to support or convory as needed. Here's what an AI game looks like after running from 1904 to an English victory in 1977:

    Seeing orders from England like Swe -> Gob, Gob -> Liv, Liv S Swe -> Gob reminds me why I got annoyed at the AI writing and gave up.

    Comment via: google plus, facebook

    Recent posts on blogs I like:

    More on the Deutschlandtakt

    The Deutschlandtakt plans are out now. They cover investment through 2040, but even beforehand, there’s a plan for something like a national integrated timetable by 2030, with trains connecting the major cities every 30 minutes rather than hourly. But the…

    via Pedestrian Observations July 1, 2020

    How do cars fare in crash tests they're not specifically optimized for?

    Any time you have a benchmark that gets taken seriously, some people will start gaming the benchmark. Some famous examples in computing are the CPU benchmark specfp and video game benchmarks. With specfp, Sun managed to increase its score on 179.art (a su…

    via Posts on Dan Luu June 30, 2020

    Quick note on the name of this blog

    When I was 21 a friend introduced me to a volume of poems by the 14th-century Persian poet Hafiz, translated by Daniel Ladinsky. I loved them, and eventually named this blog for one of my favorite ones. At some point I read more and found that Ladinsky’s …

    via The whole sky June 21, 2020

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact