Play Now Login Create Account
illyriad
  New Posts New Posts RSS Feed - New Battle Calculator - a work in progress
  FAQ FAQ  Forum Search   Register Register  Login Login

New Battle Calculator - a work in progress

 Post Reply Post Reply
Author
Tensmoor View Drop Down
Postmaster
Postmaster
Avatar

Joined: 07 Apr 2015
Location: Scotland
Status: Offline
Points: 649
Post Options Post Options   Thanks (1) Thanks(1)   Quote Tensmoor Quote  Post ReplyReply Direct Link To This Post Topic: New Battle Calculator - a work in progress
    Posted: 10 Jun 2018 at 00:27
Reading through some of the recent posts regarding battle calculations with equipment I got inspired to see if I could manage to write a new one from scratch using the calculation methods discussed in those posts.

Some restrictions on the current setup apply:
  1. Only one division in each army.
  2. Only the attacking army can have a commander.
  3. No equipment used at present.
  4. Only Heroism and division attack bonuses will be used.

All these restrictions will be removed in the future but I want to concentrate on the real basic calculations first.

So far I've managed to get a reasonably useable page done that allows the entry of attacking and defending forces as well as selection of the terrain. This is using several new (to me at least) methods of layout so is a bit rough still. The link below is a working version of the calculator as it stands at the moment. To use it simply start with 'Unit Groups' and work your way down. To close any of the popups simple click outside them however make sure you click any 'Save' buttons that may be at the bottom of the popup.

Please feel free to explore it and leave any comments below.


Tens
Back to Top
Tensmoor View Drop Down
Postmaster
Postmaster
Avatar

Joined: 07 Apr 2015
Location: Scotland
Status: Offline
Points: 649
Post Options Post Options   Thanks (1) Thanks(1)   Quote Tensmoor Quote  Post ReplyReply Direct Link To This Post Posted: 13 Jun 2018 at 11:31
I really wasn't happy with the number of different checkboxes/dropdown lists I was using just to get the races of attacker/defender so I've been busy working on trying to simplify it.

Changes
  1. Completely re-done the structure of the underlying unit data which let me get rid of the 'Groups' checkboxes.
  2. Selection of both races is by typing in a text box. Suggested races appear as you type (after a min of 2 characters) and you select one by clicking on it.
  3. Storage of the unit data is now done by a number rather than the name of the unit (there are several units from different races that have the same names but are different units). This also gives me much easier access to the various stats for the units.
  4. Added store/load to local storage ability. I was getting rather fed up having to type the same stuff in time after time while I worked on/tested bits of code. At the moment it only stores one set of data but I may change this in the future.
Next is to start work on the calculations - if I can I'll generate these using the methods described by both Sene and Hucbold so there can be a direct comparison using the same data on the same machine. First will be the attacking army values. - fingers crossed Wink
Back to Top
Tensmoor View Drop Down
Postmaster
Postmaster
Avatar

Joined: 07 Apr 2015
Location: Scotland
Status: Offline
Points: 649
Post Options Post Options   Thanks (1) Thanks(1)   Quote Tensmoor Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jun 2018 at 03:28
Been working on the calculation of the total offensive army attack score and I think I've got it working with the formulae Sene posted - bear in mind that at present you can only have one div and no equipment is used in the calcs yet. The results of each step in the calcs is shown in a rather feeble attempt at emulating a terminal window.

I've also got the code done to allow you to assign equipment to the commander but as I said above, it isn't used in the calcs yet.

Next on the list is the code to retrieve the applicable effects for the equipment depending on the race, terrain etc.

The updated code has been posted to the demo site.

Back to Top
Tensmoor View Drop Down
Postmaster
Postmaster
Avatar

Joined: 07 Apr 2015
Location: Scotland
Status: Offline
Points: 649
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tensmoor Quote  Post ReplyReply Direct Link To This Post Posted: 3 hours 20 minutes ago at 13:55
Changes
  1. Complete re-design of the layout (still some positioning bugs).
  2. Allows up to 5 divisions in each army.
  3. Allows equipment for attacking comanders.
Still to do
  1. Do the code for the defender calculations.
  2. Do the entire code for the Hucbold method of calculating.
  3. Check that the equipment bonuses are being properly calculated for all the relevant terrain types - i've got a nagging doubt tapping away in the back of my head...
  4. Code for Biome and Prestige bonuses.
Please feel free to try out this test version and let me know of any bugs.

Tens

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.