town capture simulator

Offa

Bretwalda
Joined
Feb 3, 2002
Messages
1,255
Location
Mercia
For a long time now I have wanted to know the attacking force needed to capture a town. For example how likely are 6 horsemen to take a town defended by 3 spears on a hill. Individual combat calculators help you to get an idea about this but don't really give the answer. Sirp has written a programme which calculates this, but on my computer his utility crashes if asked to evaluate attacks involving many units.

This is a little Java program that simulates trying to take a town. It seems fiendishly tricky to me to calculate the true chance of taking a town but it is reasonably easy to simulate lots of attempts and work out the chances that way.

The program lets you specify the attackers and the defenders, and then simulates lots of attempts to take the town. It allows for retreats according to the formula by BomberEscort, and for those irritating defender promotions. I haven't attempted to allow for bombardment, armies or for units that can attack more than once in a turn. The current defender is selected according to the product of power and remaining hit points as I am not sure how the game does this.

Latest version:

28 dec 04 version
 
It's a very interesting, thank you! :D
But how I can start your utility without installed java on my PC? :(
 
It is a zipped jar file. The server won't let me upload a jar file, so I had to zip it first. I don't think you need to do anyting special to run a jar file, just double click: at least that works on my machine.

Here is a screenshot. It is a tad garish, but I could tone it down:

 
You will have to install JRE (some version) to be able to run java files.

jar files are run with java -jar filename.jar normally an association is setup on install
 
I guess I have installed lots of java stuff on my computer so that explains why I can run executable jars with a double click. I only now see that it opens with javaw, whatever that is. I had assumed executable jars would open on most computers: so much for portability. Anyway it runs just great on my machine :p .

Frankly I only tinker with programs as a bit of fun, it's just a game for me, like playing civ really. Therefore I am a bit ignorant :blush: . If I knew how to I would convert the program to an applet. I suspect that this is easy but I don't know how to do it :crazyeye: .

Having said all that, I think this will run from windows Internet Explorer, or is that just my machine as well?
 
Hey, interesting tool and good work.

2 proposals:
1.One button where only the results are cleared (so I can just add an attacker without having to enter them all again)
2. Adding a third and fourth row, one for attacking bombardment units, one for defending ones.
 
socralynnek said:
Hey, interesting tool and good work.

2 proposals:
1.One button where only the results are cleared (so I can just add an attacker without having to enter them all again)
2. Adding a third and fourth row, one for attacking bombardment units, one for defending ones.

Thanks:
Your first idea is easily done. I agree that re-entering all the units is a drag. It would be pretty easy to have buttons to remove the last unit entered too but might make the interface a bit cluttered. I am also going to increase the allowed limits on the number of simulations as it was running very fast on my machine, 100000 simulations takes a few seconds.

Re the second proposal, adding buttons for bombardment is of course pretty easy, but accurately simulating it not quite so easy. At the moment I don't know how bombardment works. It would complicate the simulation a fair bit but I might try it at some point.

Similarly attackers which can attack several times a turn (eg armies, tanks) would be interesting to simulate, if potentially a little complicated: eg how do you work out whether or not to use the second attack and at what point of the battle do you use it.

More stats about the results would also be possible, if wanted.
 
Ok I know that no one is reading but I find my calculator very useful so I have buffed it up more. I haven't added bombardment as I can't think of a sensible way in which to implement it that would really simulate what a player does, ie in a real game a player would potentially bombard for several turns to kill more population etc. I haven't added blitz either as it plays little or no role in games I play.

here is an example simulating an attack with vet horsemen on a hill town defended by 2 fortified spears.



new calculator

I think all that needs to be done is unzip the programme which is an executable jar. If there is no java on the computer I think it can be run from IE, but if there is a double click will work. Anyone who wants can have the source.
 
Installing Java worked best for me.
Offa, this tool looks really useful, and I'll sure use it in the next COTM, but I'd be very very grateful if you could tone down the colors a bit. :twitch: ;)
 
Yes it is pretty garish isn't it. I put colours in so I could see what was going on easily, and really should have some subtle shades instaed of these rather violent default colours.

I will tone it down or just make it all grey.
 
I did think about putting in bombardment but it would be hard to model what you would do in practice. For example if your first go at bombardment reduced city size to 7, you probably wouldn't attack but would try to bombard again next turn to reduce city size to 6. In addition, I hardly ever use bombardment myself. I guess armies would be nice too but are actually slightly tricky to implement for much the same reason: eg when down to 2hp should it attack? I guess I could make them attack if they figured their chance of winning was say >80%, but it is quite cumbersome to do.

You can just put the defenders down as having 1HP. You can prevent them from promoting by making them elite, otherwise promotions will potentially make life much harder for your attackers. Another effect of bombardment is reduction in population, which can of course also be calculated.
 
50 to 100 artillery???!! I usually have 50 to 100 units! :lol:

Anyway, this is really cool since military commanders have access to this kind of information in real life. So it's not like cheating... I don't think so anyway.
 
Dom Pedro II said:
50 to 100 artillery???!! I usually have 50 to 100 units! :lol:

Anyway, this is really cool since military commanders have access to this kind of information in real life. So it's not like cheating... I don't think so anyway.

No, it is never considered cheating to know your odds :)
 
OK, here it is in pastels. Actually I think it looks anaemic and my wife says it looks military.

I added a fully bombarded button as well: this sets all the defenders to 1HP elite units (I made them elite to stop them promoting).

I fixed an error :blush: as well, which was nice of no-one to mention. Retreat chances now work properly.



pastel combat sim
 
Great little tool, hopefully you will fill it full of options!
 
Top Bottom