Click here to Skip to main content
Click here to Skip to main content

Supremacy: Field Marshal's Aide-de-Camp

, 17 Nov 2009 CPOL
Rate this:
Please Sign up or sign in to vote.
Helpful interface for an existing on-line game of Supremacy

Introduction

The board game of Supremacy is a copyright game invented by Robert J. Simpson, and if you're reading this article, you may have not only heard of it, but spent entire weekends sitting around a dinner table plotting out strategies, counting resources, making (and breaking) alliances, in a desperate struggle to conquer the world. A few years ago, an intrepid code-junkie known on-line as 'Paul the guy who manages this site' put together an on-line version of the game. I'm not sure about the legality of his 'copyright' infringement since he doesn't use the logo which I've got displayed above (I may soon hear a knock on the door about including it here), but his online game of Supremacy at http://asup.washingtonmarshalls.com is awesome. It very closely follows the rules of the original board game, with some allowance for internet play that adds an extra layer of complexity and interactive play that you just can't get with your cousin Bob and his bag of Doritos which continually persist on encroaching into Burma.

Background

Because the online version is so great, I decided I had to write a program for my own personal use to help me keep track of my alliances and strategies, and thus this project began. I worked on it for about a year, adding new features as I thought of them, and now have something somewhere near half decent.

Using the Code

When you launch the application, the web browser takes you straight to the game's login page. You'll have to request a user ID. I think the Sysop manages the passwords himself, so it could take a few days before your request is processed. In the meantime, you should read the documentation and get acquainted with the site.

When you start playing a game, you'll be able to make use of the various options which this application provides. Selecting the Options menu will bring up a group box that acts as a console for you to interface with your digital Aide-De-Camp. As Field Marshall for one of the superpowers in the game, it is your responsibility to be well informed. Though this application does not give you any information which the game doesn't already provide, the first thing you'll notice is the sound effects which the site lacks. No, I don't mean your cousin's long-winded burps or the sound of potato chip crumbs crunching under your feet. There are a bunch of alarms which tell you when it is your turn to play, when someone else has played, and even when someone has written something in the forum. You can toggle these effects on or off on the console, control the volume, and set the number of minutes between each time the application checks the site before informing you of any changes.

One of the more convenient features is the 'Pop-Up Missive'. In the game, you communicate with other superpowers by sending messages, and when someone sends you a message, an email is sent to you and you would normally have to read it using your email account. And, that's all good and fine, but if you sit at your computer all day and you have an open internet connection, you might as well run this application and let it check your email for any messages. The benefit of this is you don't have to clean your email account every time you get a message from this site, and while you're writing up last month's account's receiving report which is already late and you're desperate for a distraction, suddenly a window appears on your screen with the important message telling your that your Australian colonies were invaded. Forget the dingos, you've got bigger problems now.

The Quarter Master Report allows you to examine your resources while looking at the map, which you can't do in the game without this application because many of the commands appear in the same window. Having these resources available to you at the same time can help you make more informed decisions. Especially when Africa starts to encroach into the Middle East and Russia's forces are dangerously close to Manchuria. Should you defend Tibet? Or spend the extra oil and fly an advance force into Nigeria? Diamonds are forever, but what price can you put on inner peace?

When you're making alliances, it is important to have a look at what companies everybody has. You can see these on the map, but there's nothing like a concise table listing all the resources in a quick, easy to read Resource Report. Do you think that maybe because neither North or South America have any mineral companies, they might look at your Uxmal Miners Co. in Central America a second time? What's a warlord to do?

The 'Show Game State' button near the right of the console brings up a form with the list of games that you're currently in. Whenever you hear a dog bark, that's the alarm telling you that someone has played their turn and you can follow along to get a good look at the map and who bombed who, and when 'reveille' sounds, you'll know its your turn. Because a game can take months to play out, it is very easy to forget who your allies are and why your forces are deployed the way they are. Or, if you are in four or five games at once, it is much easier still to mistake which game you're looking at. Most players will tell you that they've angered many a potential ally by forgetting who they made promises to and then were promptly invaded and bumped from the game because of these diplomatic faux-pas. So, for these reasons, you'll want to use the 'Notes' feature that comes with this application. When you're logged into a game, you can click the Notes button and the notes you are keeping for that game appear on the screen. And, there's no chance of confusing notes from one game for another because the same Notepad automatically updates itself when you jump from game to game.

Along with text notes, you can save a copy of the map. This way, when you log in and see that your neighbor's country was invaded and wonder if you should worry, you can look at the saved map and compare it with the current one before saving it over the old one.

Writing this article, I realize that I should probably get a life. But, this game is really cool. It's turn based, and you can log-in once a day and have a look, or keep this application running in the background to follow any updates as they popup.

"All we are saaaaaaaying..... is give nuclear war a chance!" (BFG)

Points of Interest

Everything in this program runs on web browser objects. There's a main web browser which the user actually plays the game with, but for the application's various features, five extra web browsers are required, though they're not visible to the user.

WebBrowser calculateAverageBrowser = new WebBrowser();        
WebBrowser webLoadResources = new WebBrowser();
public WebBrowser webMarketPrices = new WebBrowser();
public WebBrowser webTerritories = new WebBrowser();
public WebBrowser webCompanies = new WebBrowser();

The Quarter Master Report is the simplest feature to explain. When the main browser finishes loading its latest document, which happens every time the player manipulates the game, the secondary web browser, webLoadResources, is told to reload the 'Resource Card' page. When this document is completely loaded, the Quarter Master Report copies the HTML text into a string variable which is parsed out into a temporary variable of user-defined-type called udtResources.

[Serializable]
public struct udtResources
{
     public int Total_Funds;
     public int Loan;
     public int Outstanding_Interest;
     public int Mineral;
     public int Mineral_Blockaded;
     public int Mineral_Capacity;
     public int Oil;
     public int Oil_Blockaded;
     public int Oil_Capacity;
     public int Grain;
     public int Grain_Blockaded;
     public int Grain_Capacity;
     public int Nukes;
     public int L_Stars;
     public int K_Sats;
     public int Neutron_Bombs;
     public int Armies_Technology;
     public int Naval_Technology;
     public int Strategic_Technology;
     public int Resource_Technology;
     public int Espionage_Technology;
}

Then, these values are compared to the old values which the program stores in one of the separate variables of the same user-defined-type that keeps track of the resources the player has in each game. If there are any differences between the new values and the old values, then a report is shown to the user highlighting all of these changes. The same report can be called up at any time by moving the mouse cursor over the Quarter Master Report checkbox if the user needs to have a quick look at his resources while still staring at the map.

Resource Report is a slightly different matter. Because the information contained in this report is found on four different web pages, four different browsers need to be launched. And, because these browsers won't ever finish loading their pages at the same time, they set their respective global boolean variables which are checked by the timer.

public struct udtResourceReport
{
    public bool bolMarketPrices;
    public bool bolTerritories;
    public bool bolCompanies;
}

When all three (because the fourth one, webLoadResources, is updated regularly, the data stored in memory is used) have set their boolean variables to signal that they've downloaded their pages and are ready to be read, the Resource Report is compiled from these different sources in a way similar to the Quarter Master Report. The document is saved to a string, the string is parsed into the required information, and all is well with the world of multinational corporate espionage until the next cluster of nukes streaks the sky.

History

  • 14th April, 2009: Initial post
  • 15th November, 2009: Updated source code

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Christ Kennedy
CEO unemployable
Canada Canada
Christ Kennedy, published his fourth novel "Cleats of the Counter Revolution" in the summer of 2010. He grew up in the suburbs of Montreal and is a bilingual Quebecois with a bachelor’s degree in computer engineering from McGill University and is currently walking across ontario plotting a new novel, far away from any computer.

Comments and Discussions

 
NewsIt’s Back!! PinmemberMember 1000188620-Apr-13 18:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150129.1 | Last Updated 17 Nov 2009
Article Copyright 2009 by Christ Kennedy
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid