Main VGAP4 page

Diplomat simulator - a battle simulation utility for VGA Planets version 4

Latest release is Version 3.12 (April 2008).

Diplomat is basically a script generator. It uses the scripts to Master a new universe with all units in the same location, whereupon they fight. Since the combat is resolved by the real Host.exe program, and viewed with the normal VCR program, the results should be true to life.
I've found that sharing the code freely has brought huge and unlooked for returns. People post me corrections and suggestions - even entire new features such as translations. The program has become a group achievement, and an example of the co-operative group spirit found throughout VGAP players.

An alternative combat simulator:

alkirej has created a web based combat simulator tool. It offers an alternative to Diplomat but runs on a remote server rather than your own PC.

Screenshot

Important notes

What's new in 3.12 (April 2008)

This version of Diplomat supports most of the new ship and wing combat options in the new Host. (Unfortunately some, like "Escort target", can't be scripted.)
Many of the other ideas came from Thriyon and Gabor Teroe.

Add Ship screen clarifications: cost is now in bold, and a different font colour, to make it easier to find. Tips have been modified to help people understand the new combat options. There's even a new screen explaining how mobility works.
Add ship screen: Number of High Guard saved and shown correctly.
Add Ship Screen: Avoid Base option re-enabled, Avoid Fighters option removed. I had got confused between Ship and Wing options.
Add Ship screen: Attack and Flee options are no longer mutually exclusive. It turns out that you can still shoot while fleeing! Flee is related to the ship's movement, not its weapons. To match the new client, these are now called Aggressive and Retreat.
New: Add Ship screen shows hyperdrive range and fuel cost for this hull when you select a hyperdrive. This should be a really useful tool for hyper-races.
Fixed: The number of colonists in a base is now written correctly to a script. Previously, an error here meant that base ion cannon were not being powered correctly.
Changed: Add Wing screen - "Bang per buck" score - I have increased the weighting of long range beams / missiles. Particularly with the new Host combat code, where they maneuvre intelligently and stay out of range of return fire, such fighters have a huge advantage.
Weapon tip for Gatling Phasor updated - it can now hit fighters. Tips for certain engine types also updated - they give a mobility bonus during battles to help the ship e.g. maintain standoff. (R50 Mega Fusion, and the three Thrusters.)
New: Mobility Meter - this indicates how maneuverable your ship is in a battle. If your ship has better mobility than the enemy, it is likely to obey its orders well and obey standoff, etc commands. If the enemy is more maneuverable, your ship will act like a slug and the enemy has the initiative. This feature was added because mobility (ie acceleration) is an important concept in the new host combat code.

What was new in 3.11 (December 2007)

Changed: layout of the Add Ship screen. There are so many variables to set now, I have divided the screen approximately in half. In the upper half are the key things like weapons which you definitely need to define for combat! In the darker, lower side of the screen are more obscure variables and readouts which don't need to be set if you just want a quick simulation. By clustering the commonly used buttons together, there should be less mousework.
Fixed: occasional crash when editing a Wing just after opening Diplomat and loading a new sim. Found and fixed by Thriyon
Fixed: Wings' high guard were being saved wrongly in sim files. Found and fixed by Thriyon
Updated: Boarding.xls, the spreadsheet bundled in the Zip file. Jochen Schwarz has modified it to include IMT; Crystals' boarding laser immunity; defending crew 5x bonus; similar defending colonist bonus; Aczanny security device; improved damage calculator from boarding lasers; general improvements to usability.
Fixed: Indexing error resulting in clicking on one object selecting another, in the overview screen. Reported by Magik, fixed by Thriyon.
New ship combat switches: Guard base; anti fighter; power boost mode; closest first; blaster cannon power boost mode. This is to support the new combat code in host 213.
Added: "no engines" option for ships (suggested by Gabor Toeroe)
New wing combat switches: Guard base; avoid base
Fixed: Wings' recharge value wasn't consistently correct. Fixed by Thriyon
Changed: Add Wing screen selects owner using a drop-down menu like the Add Ship screen, instead of entering a player number. (Idea by Gabor Toeroe.) Noticed an unused variable, fuel, while doing this - removed it to streamline program.
Added: Ship skill and command code can now be specified. (Suggested by Gabor Toeroe.)
Updated: Wing tips updated. (An obscure screen accessed from the Add Wing screen with tips for newbies.)
Removed / merged: The buttons for Exit without adding ship and Create ship. These are now one command button called Add ship.
Tweaked: the mc and duranium costs for ships with Organic Armour are now nil. (Fixed by Thriyon)

What was new in 3.10 (September 2006)

New: In the basescreen you can now specify the number of cities and factories. (As G Teroe points out, the effectiveness of lasercannon depends on their charge rate, which depends on the number of cities, factories and ioncannon.)
Also fixed some bugs to do with saving / reloading bases to / from saved .sim files.

What was new in 3.0.9 (August 2006)

Fixed: (Bug found by Thriyon) The increased randomness introduced in 3.0.8, depends on using semi random locations around the Echo map. One of these did not coincide with a planet. This made simulations with bases 'problematic', as Thriyon politely put it.

What was new in 3.08 (July 2006)

diplomat.csv updated so Diplomat recognises extra ship in IMT racepack
diplomat.csv updated to correct missing ships in Robot racepack (error noticed by Thriyon)
Diplomat now allows wings smaller than 10 fighters. (This was a pointless 'helpful' feature which actually hindered people. Another problem spotted by Thriyon)
Error in Attackplan switch fixed. Standoff range now works. Spotted and explained to me by Gabor Toroe.
More silly names!
(Idea from Sebastian Ulmer:) The x,y co-ordinates of combat are now semi random. It is suspected that Host.exe uses these as the 'seeds' for some random numbers in combat, and because Diplomat always used the same x,y the results of simulations were sometimes misleading. The new co-ordinates are a set of 11, scattered across the Echo Cluster map used by Diplomat. Sebastian has done some checks with the new version, and reports that Wing behaviour is now much more varied.
(Idea by Thriyon:) following changes to Host, which make food stockpiles important, bases in simulations get 100,000 food so there are no unrealistic effects like population collapse, from their population starving.
(Idea by Thriyon:) When saving a simulation, Diplomat asks if you want to re-use the previous filename.
Ground Combat simulator improved. This is the major upgrade. Minor tweaks: terminology brought up to date (KKK mode changed to CrushKillDestroy); I noticed that it didn't allow for 20% of a base's HG staying behind when the base attacked. But mainly, the new Capture mode is now supported. As a result, the screen is more complex - you have more choices - but it should help you narrow down what you need to do to capture prisoners. While at it, I added all the combat modes, built some extra tips into the analyses, and rechecked the algorithms matched Tim's latest ones.

What was new in 3.07 (Feb 2005) Credits

Updated: Gabor Toro's Ground Assault Simulator now includes mode 5, "Capture". [Tim introduced a new GA mode: CAPTURE.]
New: Ships can be set to use the new "avoid base" option.
Fixed: The default crew number of imported qsp ships was "one". If you made sims with that ship, it always ends up captured because this lonely crewman gets killed very fast ;-) (this is a evil one... i just spend one hour searching the reason why *some* ship always get captured...) - Andreas Benne
New: I received the following suggestion from Andrew Hirst: "Make sim file names related to the subject matter." Now, a typical .sim file name defaults to Player1'srace-vs-Player2'srace-Date.sim, e.g. Feds-vs-Crystals-5-2-2005.sim
Fixed: The switches about including large weapon/engine-costs are always set to on if you open a ship screen, regardless how you set them before. - Pointed out by Thriyon.

What was new in 3.06 (Jan 2005)

New: Gabor Toro's GA simulator added - note: this needs Excel 2000, it won't work with Excel 97. Filename: Ground_Assault_Simulator.xls. This needs to be in the \Planets4 directory. It can work as a standalone file, or be called directly from Diplomat. It is more comprehensive and accurate than the old one built into Diplomat. It has received high praise for accuracy from several Beta users (mainly Lizards after prisoners!)
New Exotic Tech scriptable: Fighter ECM. (Are there any other combat ones I've missed?) (Suggested by Thriyon)
RCS ship comments updated following corrections from Thriyon.
Certain Ship Devices were not being displayed correctly. I found the reason and corrected it. Thanks to Thriyon for pointing this one out.
4 Med units added to RCS Lotus cargo so its Exotic Hull will be active during combat.
The standard engine on Aczanny ships is the Transwarp, rather than Tylium Thruster. Most of the time they will use these engines. (Suggested by Sebastian)

What was new in 3.05 (December 2004)

New: Multilingual: limited support for Catalan, Spanish (translations by David Palma) and German (Andreas Benne). Weapon tips, and some other strings, can be shown in language of your choice using a new Language option in the Options menu.
New: comments on specific hulls appear when you select a hull (English language only)
Changed: Add Ship screen: "Fire Ion Cannon at ships with shields still up" now defaults to ON (idea by Thriyon)
Changed: Reorganised main screen so the list is larger - you can see more things at once now.
Changed: Some cosmetic fixes on odd screens.
Changed: Patched a bug with exporting QSP files which could cause Diplomat to occasionally crash.
Changed: Ship Experience now defaults to 0, instead of 100, to reflect normal battle conditions.
Changed: Following research by Jason Northrup, ship ID's are now scripted as "RANDOM" instead of "NOTRANDOM". This ensures "random" attack vectors don't depend on the order ships are scripted in, and should make battles less deterministic, so the results actually differ a bit from simulation to simulation.

Diplomat is a group effort and people like David and Andreas have helped its development many times. They contacted me and offer their time and services for free. I would like to thank them for all their help!

What was new in 3.04 (July 2004) - lots of annoying things fixed

Fixed: race 1's hulls appearing twice in the Hull List on the Add Ship form. (As a byproduct this has speeded up loading of that screen.)
Improved: the Edit Ship screen was taking ages to load. This is much faster now.
Improved: some screens' layouts were slightly obscuring legends next to buttons etc.
Fixed: allows you to edit PD now, and remembers the changes. (As reported by Thriyon, Hilmar Benne, et alia.)
Fixed: Exit Without Adding Ship button takes ages.
Fixed: PD weapons were showing nonsense like "Max: 5; fitted: 10" when you opened the Add Ship screen. The total number now tracks the true number.
Fixed: you can no longer fit negative numbers of Small Weapons (!)
Unable to reproduce problem: VCR.exe shows the wrong type of PD being used. Ie, you fit Holodecoys, VCR.exe shows 35mm Vulcans. All I can say is, the scripts generated by Diplomat seem to be correct...
Removed: Mivorari hulls have been commented out from the diplomat.csv file until that race pack is released. It just confuses things to leave them there.
Improved: temporary boot-up picture is larger and thus more interesting.

Notes:
Picture
DiplomatSplashScreen.bmp (230kB) can be deleted from your \Planets4 directory.
Diplomat now needs
DiplomatPicture.jpg (83kB) in the \Planets4 directory. It is in the latest .zip file.
diplomat.csv is slightly different and you should overwrite the one in your \Planets4 directory with this one.

Not fixed yet: A number of people have reported that mc costs (and some say mineral costs), are not consistent when you create / edit / re-edit ships. Rather annoying! This is related to another cmplaint, tht the "include Free Stuff" switches aren't saved when you leave the Add Ship screen. I have really got to improve that sometime. (The following is musings to myself:) I can see that there is some kind of problem with Free Weapons and Free Engines (check boxes on the Add Ship screen). Sometimes subroutine "UpdateShipCost" takes these into account... sometimes not. And I ought to add a memory of whether the ships had free weapons or not into their Class, so it is stored when you save/load sim files and QSP files. (Actually it is irelevant to QSP's... maybe I just need to store it as a global variable or an option in diplomat.csv).

What was new in 3.03 (Feb 2004)

Fixed: Point Defense bug. All PD's were being scripted one tech too low.
Improved: interface to Shipcalc, i.e. import / export of shipcalc.qsp files.

Note: there was no 3.02 release

What was New in 3.01 (Feb 2004)

90% Declan's work again!

Note: Steve Nuffer found that Weapon Tips did not appear. We didn't get to the bottom of why, but he found a way round this: "Got it working.  I moved the directory as another user.  Logged in again which recreated my <userID> directory, and it worked." Ie,

C:/Documents and Settings/<userID> to
C:/Documents and Settings/<userID>.old

What was new in 3.0 (Feb 2004)

Some minor stuff:

Details of Declan O'Connor's changes:
Add Base
form:

Hot Keys Added
Tab Order Fixed
Small change to the way Defense Base Structures are displayed to get the Hot Keys to work.

Exotic Tech Form GUI Changes:

Hot Keys Added
Tab Order Fixed

Add Pod Form GUI Changes:

Hot Keys Added
Tab Order Fixed

Add Ship form:

Loads quicker. It still takes about a second to load the first time due to the amount of stuff it has to do. (Declan removed a lot of redundant, repeated calls in unecessary loops.) "I am just trying to... remove the dead wood from the organic growth of code over the past few years", he wrote politely.
The E&xit type commands (&) were not working in the Check boxes because you were using labels beside the Check boxes. So I have removed the unnecessary labels and placed the label's caption into the Check box's caption and extended the size of the Check box so that the hot-keys work on them (and the caption of the Check box can be seen). In short they work now.
Placed some code behind the radio buttons to uncheck the other radio button when the first is checked i.e. When you click "Attack All" the "Flee" radio button is unchecked and visa versa.

Hot Keys Added
Tab Order Added in the way one would add a ship
All in all, it will look like there has been no changes to a mouse user but if you are a keyboard user then big things will open up to up and you will be able to add a ship in a couple of key strokes. When you get the form back just try using the Tab, Space Bar, Enter Key and any Alt^(x) keys that are underlined.
Form re-arranged a little to make best use of space available
Added option to have no shields
Following discussions with a Beta Tester group, changed the way in which you add the PD. The idea is to help you add PD weapons faster. It does not default into all the slots whatever you place in slot 1. I have added buttons down along the side and it will copy the PD down into each of the available free slots. (There is also a speed
improvement that I do in my own code here.)
Shield Generator Changed to a Combo BoxEngines Changed to a Combo Box.
Shield Generator Combo Box Extended to Show all Shields
Engine Combo Box Extended to Show all Engines
Ship List Extended into Freed up space (Now fits 10, perfect for the Borg players)
Generator Changed to a Combo Box.
Generator Combo Box Extended to Show all Generators
On Loading a Ship: The Max Number of Engines and Generators that will be on the ship are now displayed.
When you edit a Ship I noticed that no matter how often you try to edit the Hull type you cannot not. You can hit the Save button and nothing it is the same ship hull (It is more noticable when you have the number of Engines and Generators displayed Or it was to me cause I was testing it). Therefore to avoid confusion when you edit a ship the Hull List is disabled and re-enabled when you create a new ship.

Ground Assault form:

Some Error Handling Code

Boarding Calculator form:

Some Error Handling Code

Main screen:

Some tidying up of menus' code

Add Wing screen:

Appearance tidied up a little.

From the above, you can probably see that Declan knows the code as well as I do now.

Known bugs reported and still awaiting fixing. More urgent ones are towards the top:

Key features of Diplomat

Notes:

First Time Installation

Running it

Double-click on Diplomat.exe

Miscellaneous

Price: make a donation to charity.

Fleet sizes: Diplomat can handle up to 4 Bases, 40 types of ships and 80 types of Wings. You can have several duplicates of each - that's what the 'Quantity' box is for on the main screen - there's no particular limit to how many duplicates you can enter, I've had up to 200, but of course it slows down Host runs.

Diplomat is written in Visual Basic 6 and has been tested on Windows 95, 98, ME, XP, NT. I'm not a professional programmer so I have no interest in Linux, etc; I just wanted a tool I could use myself.

I accept no responsibility for any loss or damage caused by use of this program.

Heartfelt thanks to Sidewinder, Gray Stanton, et alia for their detailed and thoughtful feedback on bugs, usability issues etc. And, of course, to Tim Wisseman for making it possible!

Some features may not be supported yet by Master.exe's script interpreter, but Tim Wisseman told me what format Master.exe will eventually use, e.g. "StandoffRange = 123", and ship / wing attack orders like "Ram" (which is actually specified by a bit field).

Answers to a couple of recent questions:

Ironic humour: Whilst deleting old emails recently I discovered a mail I (yes, I) innocently sent to the VGAP4 Mailing List in April 1999. Read it here . Eventually I just had to have a tool...

Reporting bugs and stuff

Mail me at mailto address (picture not clear text, to avoid spambot harvesters)

One NT user reported problems installing even after I introduced the InstallShield program. I have an NT version I can mail you which worked for him.

Release notes

Diplomat.exe ship1.qsp ship2.qsp ship3.qsp
Bug fix: the picture for the first ship of every race was being shown as a Fed Outrider. New: Bases can now have Undercities and Raid Shelters. Idea suggested by Michael Henderson: "I commonly hit bases from orbit with small weapons and/or weak fighters to lower population levels prior to ground assaults just to make the troops' jobs easier. It would be nice to sim this with Diplomat's 'show RST' function." Fixed: ships with no Small Weapons no longer get Disruptors by default. Fixed: ships with no Point Defense no longer get Flake Cannons by default. QSP files have been tightened up. I removed some discrepancies, i.e. Weapon Techs were previously always assumed to be 1, which can make you think something is buildable - only to find Host didn't allow you build it when you get your next RST. New: Boarding calculator added. (New button on main screen.) This feature helps you estimate whether you have enough troops in your cloaker (or whatever) to capture a given ship by beaming them over. Tim was kind enough to send me a chunk of Host code and I quickly realised that I could either waste months of my life recreating it (like I tried with Ground Combat), or I could do a rough guesstimate and ignore the fact that it's a phased combat, Light Powers affect which race's High Guard get first shot with the boarding cutlasses, etc. I opted for the coward's route and made it a rough-and-ready guesstimator of the type I might use myself. Perhaps an option for another third party utility here if anyone out there is feeling very anal retentive? This new window also has a ready reckoner for how much damage a Boarding Laser will do to an enemy hull. Factors which are taken into account, however, are:
  • Fixed: overflow error when you try to equip a ship with >18 Large Turbo Laser Arrays. Fixed: "After I have edited the list and save, I always get the message "You need at least 2 players present for combat to occur". I use players 1 and 2 (both Borg), so there are 2 players! When I get back to the main window and click on run master/host, the same message appears and it does not run the master/host. The problem even occurs when I just open the EDIT SCRIPT FILE option, and immediately click Save without editing something!"
  • 2.4.9 - Lots f help from Mark Heinrich, Jelmer Renema and Thomas Peters in this version: New: the order in which Point Defense weapons are mounted, is very important. (The ones in slots 1,2,3 etc fire preferentially to 8,9,10.) Therefore, Diplomat can now specify the order they're fitted in....There are now 10 individual drop-down combo boxes, 1 per PD Weapon. As a short cut, selecting a PD weapon in the first combo box selects that type for all of them, unless there are already some in other slots. Overflow / divide by zero errors fixed in GA simulations with Coalition mechs. The 'Set Fleet Vector' screen was expanded to 'Fleet Commands'. Cost is now saved and reloaded from saved simulations (.sim files), and Quick-Build (.QSP) files. Hyperdrive cost is now included in total ship cost. If a ship has no fighter bays, the "Fighter Wings" button is now greyed out (idea of Jelmer Renema's)
  • The following (blue) text is awaiting editing into the above list of release notes in reverse order and a more compat form, when I find time...

    What was new in 2.5.7

    What was new in Diplomat 2.5.6

    What was new in Diplomat 2.5.5

    What's New in Diplomat 2.5.4

    What's New in Diplomat 2.5.3

    What's New in Diplomat 2.5.2

    What's New in Diplomat 2.5.1

    What's New in Diplomat 2.5.0

    What's new in Diplomat 2.5.13 (September 2003)

    This is sort of a rush job so people can test the new Exotics. I'd been adding minor tweaks here and there since the last update, but nothing too major.
    Important note: you must overwrite your old diplomat.csv file with the new one inthe Zip file, because I've changed the format slightly. The reason is, I store the default QSP directory in the CSV file, so you don't need to re-enter it each time you re-use Diplomat. Ie if you save a QSP file as, say, player 3 in game 4, the default directory is remembered for the next time you use QSP files.

    What's New in Diplomat 2.5.12 (March 2003)

    What's New in Diplomat 2.5.11 (December 2002)

    Just some minor specialist stuff...

    What was new in Diplomat 2.5.10 (October 2002)

    'A note on the newsgroup from David Bandy in Oct 2002 made me realise that mechs now count in the surrender phase.
    'I checked with Tim and he sent new GA code (my last sample was almost 2 years old). Obviously there's been a change
    'I didn't notice because they did NOT count in my old Host code. No matter; I have added their effect in in
    'Diplomat 2.5.10.
    'Here's the old code, radically different from new lines below!
    [If ForcePower1 is > 3*ForcePower2, or vice-versa, one base surrenders...]
    'ForcePower1 = (B1.colonists * B1combatColonist)   'I had to split these lines up because with 50 million colonists, we were getting overflow errors.
    'ForcePower1 = ForcePower1 + (B1.Crew * B1combatCrew)
    'ForcePower1 = ForcePower1 + (B1.troops * B1combatTroop)
    'ForcePower1 = ForcePower1 + (B1.higuards * B1combatHG)
    'ForcePower2 = (B2.colonists * B2combatColonist)
    'ForcePower2 = ForcePower2 + (B2.Crew * B2combatCrew)
    'ForcePower2 = ForcePower2 + (B2.troops * B2combatTroop)
    'ForcePower2 = ForcePower2 + (B2.higuards * B2combatHG)

    New code:
    ForcePower1 = (B1.colonists * B1combatColonist) / 10000
                'I had to split these lines up because with 50 million colonists, we were getting overflow errors.
    ForcePower1 = ForcePower1 + ((B1.Crew * B1combatCrew) / 100)
    ForcePower1 = ForcePower1 + (B1.troops * B1combatTroop)
    ForcePower1 = ForcePower1 + (B1.higuards * B1combatHG)
    ForcePower1 = ForcePower1 + (B1.MechType1 + B1.MechType2 + B1.MechType3) * 100

    ForcePower2 = (B2.colonists * B2combatColonist) / 10000
    ForcePower2 = ForcePower2 + ((B2.Crew * B2combatCrew) / 100)
    ForcePower2 = ForcePower2 + (B2.troops * B2combatTroop)
    ForcePower2 = ForcePower2 + (B2.higuards * B2combatHG)
    ForcePower2 = ForcePower2 + (B2.MechType1 + B2.MechType2 + B2.MechType3) * 100


    What was new in 2.5.9 (September 2002)

    What was new in 2.5.8

    Fixed: spurious (blank) Notes screen opening when you opened a saved .sim

    Added: when you save a .sim file, a ship's hyperdrive is now remembered - reported by Marco Schon et alia

    Added: Scripts now include 500 fuel per ship and a ship's hyperdrive. (So if you want to set up a mini-universe to test something with Master, your ships can hyperjump if needed.)

    Lordfire pointed out that Sandcaster Exotic Tech wasn't working. However, it seems to have been a Host-side problem, which Tim fixed in Host 110.

    New: When you select a ship, its Devices are displayed in the Tips screen. About 60 Devices are covered but some common ones like Dust Off won't be. The idea is to help you decide which ships t