Thread Tools
Old May 20, 2001, 20:34   #1
reds4ever
Prince
 
reds4ever's Avatar
 
Local Time: 00:01
Local Date: October 31, 2010
Join Date: Mar 2001
Location: of the Spion Kop
Posts: 861
combat program?
has anyone written a program to give the percentage chance of victory for any given battle, that will run at the same time as Civ (as in AC)? i was thinking of doing it myself but there's no point in re-inventing, well anything really.
reds4ever is offline  
Old May 20, 2001, 23:08   #2
Marquis de Sodaq
King
 
Marquis de Sodaq's Avatar
 
Local Time: 17:01
Local Date: October 30, 2010
Join Date: Jul 2000
Location: ... no, a Marquis.
Posts: 2,179
I've written one for Excel, altho it would need a bit of tweaking before I'd send it out in public. Basically, it would need some more rows of calculation added, and some touch-up. It's fast, all you do is type in the two units' attack, defense, HP, and FP, et voila, the probability of the attacker winning pops up in another cell. It does not work for 0-defense units, tho (division by zero errors).

For everything the collective apolyton mind knows about combat, see the oft-linked (usually by me) thread Info: Combat (GL).

------------------
"There is no fortress impregnable to an ass laden with gold."
-Philip of Macedon
[This message has been edited by Marquis de Sodaq (edited May 20, 2001).]
Marquis de Sodaq is offline  
Old May 21, 2001, 08:07   #3
reds4ever
Prince
 
reds4ever's Avatar
 
Local Time: 00:01
Local Date: October 31, 2010
Join Date: Mar 2001
Location: of the Spion Kop
Posts: 861
sounds good! are you going to post it when its finished? also does it allow for terrian types? also with divide by zero errors could you set to defense strengh to something like 0.0000000000000001 when zero was entered and round the answer to (say) 2 decimal places so the probabiltity will be the same.

i've got to learn to use a programmable calculator (TI 84) as part of a maths course i'm doing and i thought this might be a good exercise.
reds4ever is offline  
Old May 21, 2001, 09:41   #4
Marquis de Sodaq
King
 
Marquis de Sodaq's Avatar
 
Local Time: 17:01
Local Date: October 30, 2010
Join Date: Jul 2000
Location: ... no, a Marquis.
Posts: 2,179
I suppose if there is interest, I'll finish it. I'd whipped it together for calculating odds while testing. The zero-defense unit problem might work with a small number, I've not tried that. The attack and defense values to be entered are already modified (terrain, vet status, etc) - I've only written it for one input number. I'd thought about making a VB program that had checkboxes for all possible modifications, but I just don't have the time for that. I'll let you know when I get around to finishing it...
Marquis de Sodaq is offline  
Old May 21, 2001, 11:19   #5
Scouse Gits
lifer
Civilization II PBEMTrade Wars / BlackNova TradersGalCiv Apolyton EmpireApolytoners Hall of FameCivilization II Succession Games
Emperor
 
Scouse Gits's Avatar
 
Local Time: 23:01
Local Date: October 30, 2010
Join Date: Nov 1999
Location: Liverpool, United Kingdom
Posts: 6,344
I might just give VB a try after I emerge from under 200 exam scripts ...

------------------
Scouse Git[1] -- git1@scousers.net

"Staring at your screen in horror and disbelief when you open a saved game is one of the fun things of a succession game " - Hueij
"The Great Library has been built!"
"A short cut has to be challenging,
were it not so it would be 'the way'."
- Paul Craven
Scouse Gits is offline  
Old May 21, 2001, 13:37   #6
Marquis de Sodaq
King
 
Marquis de Sodaq's Avatar
 
Local Time: 17:01
Local Date: October 30, 2010
Join Date: Jul 2000
Location: ... no, a Marquis.
Posts: 2,179
The VB idea is good because it can spew out the final probability more neatly than Excel. The spreadsheet takes a sum of each combination's probabilities - each one taking up a row. There are dozens of possible HP/FP combos to take into account, each needing its own summary cell. A VB program could simply pop in the high and low of the range to reach the same number. If that doesn't make sense, nevermind. Just trust me that VB would not be anywhere near as messy.

Edit: The zero-defense units might be given a 1/8 defense in calculation, considering the situations in which they win. Others have suggested other values, but I'd like to see the .125 put to the test.
------------------
"There is no fortress impregnable to an ass laden with gold."
-Philip of Macedon
[This message has been edited by Marquis de Sodaq (edited May 21, 2001).]
Marquis de Sodaq is offline  
Old May 26, 2001, 11:11   #7
reds4ever
Prince
 
reds4ever's Avatar
 
Local Time: 00:01
Local Date: October 31, 2010
Join Date: Mar 2001
Location: of the Spion Kop
Posts: 861
i was looking thru the GL for information on the combat equation when i came accoss a program by a guy called Mark Wagner writen 1999 that gives the probabilty of an attacker winning a given battle, its appears to use something very close to the SUMn(COMB) equation as it gives results identical to the ones posted by the Marqis in the GL. i emailed Mark and he confirmed this "but with a slight modification". it's a great program small, neat and inobtrusive you can download it from
www.geocities.com/siliconvalley/program/9231.

has anyne done any more predicted results for the SUMn(COMB) equation? i'd like to run a few through the program to see what i get.
reds4ever is offline  
Old May 26, 2001, 14:10   #8
Marquis de Sodaq
King
 
Marquis de Sodaq's Avatar
 
Local Time: 17:01
Local Date: October 30, 2010
Join Date: Jul 2000
Location: ... no, a Marquis.
Posts: 2,179
I downloaded that program a while ago, but it doesn't do the same math as the Sum/Comb formula. I've started making a VB program to do the full formula - I'll probably finish right before Civ3 comes out... Actually, I'll plug away at it as I have free time.
__________________
The first President of the first Apolyton Democracy Game (CivII, that is)

The gift of speech is given to many,
intelligence to few.
Marquis de Sodaq is offline  
Old May 26, 2001, 16:40   #9
SlowThinker
GameLeagueApolytoners Hall of Fame
King
 
SlowThinker's Avatar
 
Local Time: 01:01
Local Date: October 31, 2010
Join Date: Jan 2000
Location: homeless, Praha, Czech Republic
Posts: 2,603
Quote:
Originally posted by Marquis de Sodaq
Edit: The zero-defense units might be given a 1/8 defense in calculation,

might? must be given a 1/8 defense. IMHO.
SlowThinker is offline  
Old May 28, 2001, 22:59   #10
Marquis de Sodaq
King
 
Marquis de Sodaq's Avatar
 
Local Time: 17:01
Local Date: October 30, 2010
Join Date: Jul 2000
Location: ... no, a Marquis.
Posts: 2,179
Sorry, to clarify, might get a 1/8 - instead of 1/16 or .00001 or anything at all other than zero...

Okay, I've done all the easy work in VB (making the interface). Now I have to code all the math behind the gray box. This might take some time, as I'm only a novice at VB programming. I could write it in an hour in the proprietary language I use at work. Alas, this cannot be translated into common code...
__________________
The first President of the first Apolyton Democracy Game (CivII, that is)

The gift of speech is given to many,
intelligence to few.
Marquis de Sodaq is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 19:01.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team