What Was I Thinking?


October 10, 2002
I need an outside opinion.

I need an outside opinion.

I'm writing a computer game wherein, among other things, fleets of spaceships meet each other and blow each other up. What can I say? I'm a sucker for the classics. For reasons of speed and computational simplicity, what I want to do is calculate the battles based on the fleets as a whole rather than as individual ships. Which means I need some way to translate individual ship stats into overall group fighting ability.

This is the combat mechanism I'm planning to use. Every ship has an Attack Value (AV) and a Defense Value (DV). Both sides randomly roll a number from 1 to 20, add the AV if they're attacking, or the DV if they're defending, high score wins. Then the attacker becomes the defender while the erstwhile defender counterattacks. They trade blows once every time the attacking fleet tries to move into the defender's space, until one side is destroyed or retreats, or the attacker doesn't feel like attacking anymore. Each ship also has a damage rating, which is the maximum amount of damage that ship can do in a single attack pass. The actual damage depends on how many points the attacker wins by, but can never be more than the total group maximum.

The problem is, I'm not sure how to calculate a fleet's AV and DV. One option is to total the AV's and DV's of every ship in the fleet, which can be arbitrarily large. The other option is to take the average of all the ships' AV and DV.

An example will be illustrative. Consider three cruisers, with AV and DV of 4 each, against a dreadnought (AV & DV 10) escorting a colony ship (AV 0, DV 0). Using Method 1, summation, the cruisers have a combined AV and DV of 12, while the dreadnought keeps its AV and DV of 10 to which the colony ship neither contributes nor detracts. The cruisers have a slight advantage.

Using Method 2, the cruisers have an aggregate AV and DV of 4 and 4, and the dreadnought/colony ship wind up with 5's. Advantage: dreadnought. However, the dreadnought is hampered by its need to protect the defenseless colony ship. If the colonists are destroyed, the dreadnought's stats jump to 10's as he cuts loose. However, as a single ship he may not be able to do enough damage to drive off the cruisers before he blows up.

I think method 2 is the way to go, but I've got an ill-defined sense that I'm not thinking of something. So, if anyone has any thoughts as to which way I ought to go, lemme know. If the comments aren't working, I've got an email address lying around here someplace.


Warning: include(/home/sekimori/public_html/david/sidebar.php) [function.include]: failed to open stream: No such file or directory in /home/sekimori/public_html/david/archives/001899.php on line 144

Warning: include() [function.include]: Failed opening '/home/sekimori/public_html/david/sidebar.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/sekimori/public_html/david/archives/001899.php on line 144