Black Boxes and Stat Calculators

Flying Chaincken analyzed Canae using the QJM system here:

http://forums.civfanatics.com/showpost.php?p=7477444&postcount=59

I did my own using the model posted in this thrread. I started with FC numbers and made some adjsutments.
Roamn legions and regualr infantry weighted 1
Allied legions weighted .75
Light troops weighted .5
Cavalry weighted 2
I also subtracted 10,000 men left by the Romans to guard their camps.
I designated Hannibal the Attacker.
I gave the Cartheginian army +2 for its superiority in cavalry
I game them a +1 in military leadership for their tactical flexibility on the battlefield
I game the Carthegininas a +1 for the experience of their army
I gave them a +2 for Hannibal and subtracted 1 from the Romans for their inept generals and leadership system.

On manpower Hannibal starts down but makes it up in the other stats for a net advantage of 67%. If victory requires a 100% score for the attacker Hannibal is 2/3 of the way there. In my case the random roll was 87%; so adding 67% gives a final total of 154% for a significant Cartheginian victory.

Model line items:
Troop strength: A=46,000 D=69,200 ration A/D=0.66
Troop Mix balance: A=2 D=0 Net=A+2
Weapons bonus: none for either side
Military leadership: A=1 D=0 Net=A+1
Troop Quality: A=1 D=0 Net= A+1
General: A=2 D=-1 Net=A+3
Defence/Terrain: none for either side
Supply: none for either side
Manpower odds: Att:Def = -0.34
Leadership weapons etc.:A=+7
Attacker advantage: +6.66
Attacker Bonus: 67%
Random Number -------> 87%
Attacker score after random events: 154%

Hannibal wins!
 
To be clearer, I mean that when I open up the excel file, the Random Number is 26%, then when I remove and retype the 1, I get 71%, I redo the 1 procudure, and get 53%, then I get 58%. It always the same order of numbers on even different times I open up "Combat v2003".

I ran mine 15 times and got the following: 58,29, 30, 72, 1, 76, 81, 71, 5, 41, 86, 79, 37, 96, 87.
 
Designation of Hannibal as the Attacker doesn't work, historically.
 
Flying Chaincken analyzed Canae using the QJM system here:

http://forums.civfanatics.com/showpost.php?p=7477444&postcount=59

I did my own using the model posted in this thrread. I started with FC numbers and made some adjsutments.
Roamn legions and regualr infantry weighted 1
Allied legions weighted .75
Light troops weighted .5
Cavalry weighted 2
I also subtracted 10,000 men left by the Romans to guard their camps.
I designated Hannibal the Attacker.
I gave the Cartheginian army +2 for its superiority in cavalry
I game them a +1 in military leadership for their tactical flexibility on the battlefield
I game the Carthegininas a +1 for the experience of their army
I gave them a +2 for Hannibal and subtracted 1 from the Romans for their inept generals and leadership system.

On manpower Hannibal starts down but makes it up in the other stats for a net advantage of 67%. If victory requires a 100% score for the attacker Hannibal is 2/3 of the way there. In my case the random roll was 87%; so adding 67% gives a final total of 154% for a significant Cartheginian victory.

Model line items:
Troop strength: A=46,000 D=69,200 ration A/D=0.66
Troop Mix balance: A=2 D=0 Net=A+2
Weapons bonus: none for either side
Military leadership: A=1 D=0 Net=A+1
Troop Quality: A=1 D=0 Net= A+1
General: A=2 D=-1 Net=A+3
Defence/Terrain: none for either side
Supply: none for either side
Manpower odds: Att:Def = -0.34
Leadership weapons etc.:A=+7
Attacker advantage: +6.66
Attacker Bonus: 67%
Random Number -------> 87%
Attacker score after random events: 154%

Hannibal wins!
I think the point, though, is that your system is essentially subjective once you get past the troop numbers--why did you decide to give, say, a +1 for experience but a +2 for cavalry? On a quick skim, it looks like the only subjective factors in FC's calculation are morale and surprise--but morale was equivalent for the two sides, so it didn't factor in, while surprise is something that's fairly easy to determine (and QJM actually gives guidelines for translating subjective impressions about surprise into numbers).

So yes, you can get results that are similar to QJM, but 1)you have a massive role for random numbers, which kind of defeats the point of having a system (if anything, random numbers should really only be used to calculate surprise and weather), and 2)I'm not sure I'd believe you if you said you just came up with those numbers on your first try rather than tweaking them to get the "correct" result, which defeats the entire point of the exercise.
 
Designation of Hannibal as the Attacker doesn't work, historically.
You can turn it around; the plusses become minuses and the Roman attacker has a harder time winning (getting over 100%).
 
I think the point, though, is that your system is essentially subjective once you get past the troop numbers--why did you decide to give, say, a +1 for experience but a +2 for cavalry? On a quick skim, it looks like the only subjective factors in FC's calculation are morale and surprise--but morale was equivalent for the two sides, so it didn't factor in, while surprise is something that's fairly easy to determine (and QJM actually gives guidelines for translating subjective impressions about surprise into numbers).

So yes, you can get results that are similar to QJM, but 1)you have a massive role for random numbers, which kind of defeats the point of having a system (if anything, random numbers should really only be used to calculate surprise and weather), and 2)I'm not sure I'd believe you if you said you just came up with those numbers on your first try rather than tweaking them to get the "correct" result, which defeats the entire point of the exercise.
Teh goals of the two systems are different. I'm looking for a way to resolve combat in NESes and used the model to show how it would "predict" a historical battle. A low roll would have lost the battle for Hannibal.

I based my the various values on what I know of pre 20th C warfare in general and ancient warfare specifically. Rome had lost two armies to Hannibal (Trebbia and Trasimena) and fielded troops with less battle experience. A +1 provides a 10% advantage. The +2 for cavalry is rooted in the significant amount of additional horsemen Hannibal had on the field.I could have chosen other numbers sure, and in a NES national stats would be the basis for making such decisions.

I agree that morale did not seem to be a problem for either side, but neither was surprise. The encirclement happened as the battle progressed. The return of Hanniblas horsemen was perhaps not foreseen by the Romans, but I would not count that as a "surprise". It was standard practice in ancient warfare of the time. The ambush at Trebbia was though.

Yes, I have given chance a big roll in resolution, but I think it does play a huge part in war. General's can reduce the chance of losing, but not eliminate it. (see Marengo) Again, I'm looking to creating a model that will work for NESing. Mods, feed in stats and other information and an answer appears. By modeling a battle like Cannae, I think that it shows the risk that Hannibal took. Had the center not held or his cavalry not returned, the outcome would have been different and neither of those were forgone conclusions.

As for your point about me fixing the results, you are wrong, but I cannot prove it. Download the model yourself and play around with it. I'm sure it can be improved, that's why I posted it. Test it on battles like Roakes Drift and Auerstadt to see if you get something close to reality.
 
I'm looking for a way to resolve combat in NESes and used the model to show how it would "predict" a historical battle.
[...]
Again, I'm looking to creating a model that will work for NESing.
More like you're looking for a way to slander the opposition because you either can't or don't want to understand it. You still have completely refused to actually explicate on how QJM doesn't work other than tossing out random bizarre and non-factual arguments, with your continued insistence that it somehow doesn't give answers despite the fact that it does having been explained several times, in several different fashions, and having been demonstrated now several times. If you're going to make stuff up, do it well, please.
 
I ran mine 15 times and got the following: 58,29, 30, 72, 1, 76, 81, 71, 5, 41, 86, 79, 37, 96, 87.

But open it up again and see what pattern you get.
I still get: 26, 71, 53, 58, 29, 30, 72, 1...

I think the point, though, is that your system is essentially subjective once you get past the troop numbers--why did you decide to give, say, a +1 for experience but a +2 for cavalry? On a quick skim, it looks like the only subjective factors in FC's calculation are morale and surprise--but morale was equivalent for the two sides, so it didn't factor in, while surprise is something that's fairly easy to determine (and QJM actually gives guidelines for translating subjective impressions about surprise into numbers).

So yes, you can get results that are similar to QJM, but 1)you have a massive role for random numbers, which kind of defeats the point of having a system (if anything, random numbers should really only be used to calculate surprise and weather), and 2)I'm not sure I'd believe you if you said you just came up with those numbers on your first try rather than tweaking them to get the "correct" result, which defeats the entire point of the exercise.

The aboveis why I wanted a guide, or to be precise, guidelines for which to input factors other than troop numbers. Without guidelines, you will vary every now and then on what you put as this or that.

More like you're looking for a way to slander the opposition because you either can't or don't want to understand it. You still have completely refused to actually explicate on how QJM doesn't work other than tossing out random bizarre and non-factual arguments, with your continued insistence that it somehow doesn't give answers despite the fact that it does having been explained several times, in several different fashions, and having been demonstrated now several times. If you're going to make stuff up, do it well, please.

Yes, but can QJM results be calculated by the average joe in a useful amount of time? No, or aleast no for me. I would rather decide on battle based on my on judgement then with QJM. It is simply too time consuming to be useful. Which caused me to go to help develop Birdy's. It takes me 5 minutes to produce a result with minimal effort required. Its that simple. However, if you eventually create a excel spreadsheet, you will capture my interest.
 
More like you're looking for a way to slander the opposition because you either can't or don't want to understand it. You still have completely refused to actually explicate on how QJM doesn't work other than tossing out random bizarre and non-factual arguments, with your continued insistence that it somehow doesn't give answers despite the fact that it does having been explained several times, in several different fashions, and having been demonstrated now several times. If you're going to make stuff up, do it well, please.
Upon reading your last reply to me in your thread I thought about replying, but decided that we were going nowhere. So I let your post stand unanswered as the final word on the matter.

I do not see what you are doing as any kind of opposition nor have I made an effort to speak ill of QJM beyond its overly complex presentation and unsuitability, in its current form, for use in NESing. My chief complaint was about your managment of the project you presented. I actually tried to keep your effort moving along. Perhaps not like you wanted, but in my own way. You have put a stop to that.

Flying Chicken's post on Cannae prompted me to post my own version in my thread, not yours. I did not mention QJM except to note the link. I did not comment on his analysis or his results. When asked about my assumptions for the calculations, I gave them; again with comment on QJM.

I have emphasized all along that my effort is to make an easy to use calculator to help resolve NESing wars. The lackluster response tells me that such a tool is not high priority among mods or that what I posted is still too complicated for most NESers.
 
But open it up again and see what pattern you get.
I still get: 26, 71, 53, 58, 29, 30, 72, 1...

Interesting. I did get the repitiion. I could vary it a bit by chanign to a '2' as a divisior, but when I went back to 1 the pattern picked up again. I will look into it to see if I can fnd out what is going on. Thanks.
 
I do not see what you are doing as any kind of opposition nor have I made an effort to speak ill of QJM beyond its overly complex presentation and unsuitability, in its current form, for use in NESing.
So you continue to completely fail to understand the idea of automation then, and the idea of a linear program to arrive at it? Because I know I've said that we're going to heavily automate it several times, yet here you are still complaining about its current state as if that had any kind of bearing whatsoever on what we're aiming for.

My chief complaint was about your managment of the project you presented. I actually tried to keep your effort moving along. Perhaps not like you wanted, but in my own way. You have put a stop to that.
Maybe because it was totally ridiculous. If you aren't going to bother addressing why it wasn't, I will continue claiming that it is, with the evidence I already cited.

The lackluster response tells me that such a tool is not high priority among mods or that what I posted is still too complicated for most NESers.
You seem to be under the assumption they've ever contributed heavily to any sort of theoretical discussion on advance. Allow me to dissuade you of that notion.
 
So you continue to completely fail to understand the idea of automation then, and the idea of a linear program to arrive at it? Because I know I've said that we're going to heavily automate it several times, yet here you are still complaining about its current state as if that had any kind of bearing whatsoever on what we're aiming for.
I look forward to your final results.

Maybe because it was totally ridiculous. If you aren't going to bother addressing why it wasn't, I will continue claiming that it is, with the evidence I already cited.
I will settle for being ridiculous in my criticism as you have made it clear I was.

You seem to be under the assumption they've ever contributed heavily to any sort of theoretical discussion on advance. Allow me to dissuade you of that notion.
I have had several spirited discussions on changing ways of doing things in NESes. Most have been in my game threads and, therefore, less public. I will see where this one goes, if anywhere. But even a single poster can make it all worthwhile. Matt has uncovered a possible problem with the "=staticRand()" formula that needs to be looked into. That alone makes this thread a success.
 
Matt0088 said:
Yes, but can QJM results be calculated by the average joe in a useful amount of time? No, or aleast no for me. I would rather decide on battle based on my on judgement then with QJM. It is simply too time consuming to be useful. Which caused me to go to help develop Birdy's. It takes me 5 minutes to produce a result with minimal effort required. Its that simple. However, if you eventually create a excel spreadsheet, you will capture my interest.
Dood, we have a problem here. The point of the other thread is to verify the validity and veracity of the QJM for various and varied viewpoints from history, and then automate it. If you think that Birdjaguar's system is superior because it is easier to use, then I suppose it is safe to say that you would think that the QJM is superior if it was automated then discussed while Birdjaguar's system was just a pile of instructions on what to do?
Birdjaguar said:
I have had several spirited discussions on changing ways of doing things in NESes. Most have been in my game threads and, therefore, less public.
Probably because players are more interested in discussion if they're already invested in whatever the discussion is addressing. See, here, it is mostly Matt0088 who is interested, as he is probably a kindred spirit of mine who likes the theoretical a lot.
Birdjaguar said:
I will see where this one goes, if anywhere. But even a single poster can make it all worthwhile. Matt has uncovered a possible problem with the "=staticRand()" formula that needs to be looked into. That alone makes this thread a success.
I am no Excel expert, but I do have a little experience with random number generators. By the word "static" (I don' know why) and my prior experience I think that it is using the same default seed every time the program starts: look for a way to change the seed (preferably by using something that changes a lot: the usual thing to use is time).

In C, for example, rand() would use a specific default seed unless you do something like srand(<whatever C uses to get the current time, I forgot>) beforehand.

I'll also warn against "running" reseeding with time because you'll get something like this (6-sided die as example):

1 1 1 1 4 4 4 4 6 6 6 6

That occurs because the current time tends not to change until a millisecond or second or so, and these calculations for the pseudorandom numbers tend to happen a lot quicker than that. You seed it once, and the randomizer will do the rest (usually).
 
I am no Excel expert, but I do have a little experience with random number generators. By the word "static" (I don' know why) and my prior experience I think that it is using the same default seed every time the program starts: look for a way to change the seed (preferably by using something that changes a lot: the usual thing to use is time).

In C, for example, rand() would use a specific default seed unless you do something like srand(<whatever C uses to get the current time, I forgot>) beforehand.

I'll also warn against "running" reseeding with time because you'll get something like this (6-sided die as example):

1 1 1 1 4 4 4 4 6 6 6 6

That occurs because the current time tends not to change until a millisecond or second or so, and these calculations for the pseudorandom numbers tend to happen a lot quicker than that. You seed it once, and the randomizer will do the rest (usually).
The typical RNG in Excel recalculates every time the spreadsheet recalculates, but the "static" one does not. You have to force a recalculate. In the formula =staticRAND()/1 the 1 sets the range of possible numbers and that is what I've been changing to force the recalculation. That may be the problem though. I am asking some folks who might know, what is going on.

EDIT: I downloaded a $30 Excel add-in RNG that works very well and exactly how I want, but to be useful here I need a free solution.
 
Bird Jaguar said:
Well I've been using this solution for a bit now and a surprising development has occured: a pattern to the random numbers.

58, 29, 30, 72, 1, 76, 81, 71, 5, 41, 86, 79, 37, 96, 87, then if I close the spreadsheet and re-open it, the =staticrand()/1 function starts over with 58 and renews the pattern.

I change the /1 to new /1 and hit enter to generate a new number.
Dude, I'm telling you, it's a matter of reseeding. After searching a bit (i.e. Googling vb rand seed), I found this.

I am sure it will be helpful (just ram it into your macro).

EDIT: Whoops, forgot to tell you to search for Visual Basic's method of getting the current time in milliseconds! Use that instead of 123 with Randomize, and you're all set! :D
 
Dude, I'm telling you, it's a matter of reseeding. After searching a bit (i.e. Googling vb rand seed), I found this.

I am sure it will be helpful (just ram it into your macro).

EDIT: Whoops, forgot to tell you to search for Visual Basic's method of getting the current time in milliseconds! Use that instead of 123 with Randomize, and you're all set! :D
Currently my VB code module reads like this:
Function StaticRAND()
'Returns a random number which doesn't change when recalculated
StaticRAND = Rnd
End Function

Are you saying that I need to add these two pieces into that module too?

Private Sub Form_Load()
'Initialize the random # generator.
Randomize
End Sub
'Tell VB to initialize using Randomize's parameter.
Rnd -1
'Tell VB to use 123 as the initialization point (seed).
Randomize 123
 
I do not know VB other than to follow someone else's instructions. Is this what you mean:

Randomize Now.Millisecond [or whatever is correct]
End Function

Function StaticRAND()
'Returns a random number which doesn't change when recalculated
StaticRAND = Rnd
End Function

I'm off to bed, and will check back first thing tomorrow.
 
All hail my persistence (I'm coding excel macros for the first time here), it is
Function staticRand()
Randomize (DateTime.Time)
staticRand = Rnd
End Function
THERE.

---

Well, to give you more examples of what's possible with programming (not specifically Visual Basic--this is really the first time I've ever used this language as I've said):
Function addThese(arg1, arg2, arg3)
addThese = arg1 + arg2 + arg3
End Function
when called as, say, =addThese(1,2,3) will return (calculate and show) 6. If you know built-in math functions you could do more advanced stuff like sqrt(arg1) + sqrt(arg2) or something.

Visual Basic is obviously not from the C-line of languages, cause I didn't have to specify a thing! For example, in C I'd have to had put:
int addThese(int arg1, int arg2, int arg3){
return arg1 + arg2 + arg3;
}
Notice that I had to specify that they are integers, and that it actually returns a value (by specifying that the function returns an integer and the whole return thing down there. In a language like VB I guess the types are determined sometime later, allowing for more flexibility (if you put 1.1 as one of the arguments in the C code above, then the program would say you're a moron/go errory).

A whole new series of possibilities opens up for a whole lot of things in excel knowing how to use macros (at least, this is the revelation I had when doing this, finding out that this is simple stuff)... Well, actually, the biggest thing for me is that if statements become a whole lot easier to implement.

---

Birdjaguar said:
The return of Hanniblas horsemen was perhaps not foreseen by the Romans, but I would not count that as a "surprise". It was standard practice in ancient warfare of the time.
Then you our understanding of Dupuy's surprise differ wildly. In his assessment of Austerlitz, he counted an unexpected ripping into the center of enemy lines as substantial surprise. It's not surprise in the sense of a hiding Rogue doing a Sneak Attack--it's more of a big and unexpected battle development, like a Fighter getting a Critical Hit (pardon my DND-speak). Clearly the Romans weren't expecting their own cavalry to be cut down so easily, leading to a still-strong cavalry force to force its way into the legions, or that their entire formation would end up completely surrounded and struck from the rear, as well as the loss of its flanks.

Of course that interpretation of surprise would only be relevant to QJM, but I had to make my position clear.
 
All hail my persistence (I'm coding excel macros for the first time here), it is

THERE.
thanks, It appears to work fine and provide a variety of RN. I will repost my files with this improvement later today.

Well, to give you more examples of what's possible with programming (not specifically Visual Basic--this is really the first time I've ever used this language as I've said):
when called as, say, =addThese(1,2,3) will return (calculate and show) 6. If you know built-in math functions you could do more advanced stuff like sqrt(arg1) + sqrt(arg2) or something.

Visual Basic is obviously not from the C-line of languages, cause I didn't have to specify a thing! For example, in C I'd have to had put:
Notice that I had to specify that they are integers, and that it actually returns a value (by specifying that the function returns an integer and the whole return thing down there. In a language like VB I guess the types are determined sometime later, allowing for more flexibility (if you put 1.1 as one of the arguments in the C code above, then the program would say you're a moron/go errory).

A whole new series of possibilities opens up for a whole lot of things in excel knowing how to use macros (at least, this is the revelation I had when doing this, finding out that this is simple stuff)... Well, actually, the biggest thing for me is that if statements become a whole lot easier to implement.
Yes, discussion can be fruitful in unexpected ways.

Then you our understanding of Dupuy's surprise differ wildly. In his assessment of Austerlitz, he counted an unexpected ripping into the center of enemy lines as substantial surprise. It's not surprise in the sense of a hiding Rogue doing a Sneak Attack--it's more of a big and unexpected battle development, like a Fighter getting a Critical Hit (pardon my DND-speak). Clearly the Romans weren't expecting their own cavalry to be cut down so easily, leading to a still-strong cavalry force to force its way into the legions, or that their entire formation would end up completely surrounded and struck from the rear, as well as the loss of its flanks.

Of course that interpretation of surprise would only be relevant to QJM, but I had to make my position clear.
If by "surprise" you include anything unexpected from the death of a general to a morale break on your left flank, then the factor is mearly a way to compensate for the weakness of the model.

At Austerlitz, the 'surprise' to the allies was that the French attacked at all and they were unprepared for it. I would attribute that to Napoleon as a general. The fact that his generals carried it out under a morning fog shows their tactical expertise and leadership.

How would you handle Auerstadt: 60,000 Prussions and 22,000 French? Do you count the fact that Davout stayed and fought a 'surprise'?
 
Back
Top Bottom