## Greasemonkey Script Assault Odds

Archival storage to keep things organized and uncluttered. Can't find what you need? Search for old topics here.

Moderators: Tech Team, Global Moderators

Forum rules
Please read the Community Guidelines before posting.

### Re: NEW: Assault Odds

Great job, chip,

You continue to amaze us all,

When we thought we had everything possible!

AndrewB

Posts: 1814
Joined: Mon Jun 12, 2006 5:02 pm
Location: Edmonton, Canada, MST
Medals: 72

### Re: NEW: Assault Odds

BaldAdonis wrote:What I mean is can it account for the additional attacks from a secondary territory? Suppose I've got two stacks of 6, and I want to kill a guy with 15, who also has 10 on the other side of the board. What I'd like to do is deploy some troops onto one stack of 6, and put the rest on the other side of the board to finish him. So what I need to know is how to distribute those troops so that my odds will be about the same on both sides, but in order to figure that out, I'd want to know how well my 6 stack will do against 15, before I attack with the bigger force. I'd be silly to assume this is a usual attack of Xv15 and Yv10, and place 3-4 extra armies on X when the smaller 6 can do that much damage.

Ok code is done but not published yet because I want to discuss whether this is going to be suitable for everyone:

In the quick calcs you will be able to specify multiple attackers.
They will all start attacking the first defending territory in the order that you specify.
No other assumptions are made so the odds are the overall odds of victory over the defence.
That means the possibility of the first army advancing is taken into account.

For example

Attack 4,6 vs 3,2 = 72%
Attack 6,4 vs 3,2 = 75%

The odds are slightly different because you've started attacking with a different territory.

I would rather not introduce assumptions of how you would actually attack, people should work this out on their own, I think.

chipv

Posts: 2756
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44

### Re: NEW: Assault Odds

As far as I can imagine, the odds on a long string of attacks are the same as long as the last few territories are the same. That is, permutations of the first few territories don't make a difference, so attacks like 20v1,1,1,6,1,1,1 should be the same as 20v6,1,1,1,1,1,1. That'll mean that no matter where the big stack is, I should be able to place it first in line on defense, then place my smaller attackers before the large force and have it all work out the same.

This solution you've got is perfect.

In this case
Attack 4,6 vs 3,2 = 72%
Attack 6,4 vs 3,2 = 75%
The odds in the first one include a win 4v3, so that the next attack will be 3v2, which is poor, hence worse odds. I don't think anyone is silly enough to make the mistake of auto-attacking with the small force, so this should be fine. If the force is small enough, the chance of victory is negligible and you can place it first. If it isn't, hmmm.... when the numbers are small I can't intuitively tell what the best attacks are. Let me get back to this.

Posts: 2321
Joined: Fri Aug 24, 2007 1:57 am
Location: Trapped in Pleasantville with Toby McGuire
Medals: 48

### Re: NEW: Assault Odds

Ok, thanks for feedback. Maybe I just publish and let people play with the numbers.

The algorithm is as described above, I think the odds presented should be overall odds rather than second guessing method of attack
which might well vary from player to player. I'll wait for feedback from you or if you think it would help, publish and let you have a proper play with numbers.

chipv

Posts: 2756
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44

### Re: NEW: Assault Odds

I agree they should be overall odds. As long as they players know what it means when they imput certain strings, they should be able to tailor their plan of attack accordingly. Publish what you've got now, I'm going to play around with some small numbers and compare what I get with what you get. Large numbers should be fine anytime, it's just the cases where the smaller force could conceivably win that might be strange. In any event, the odds would be better than expected, so it shouldn't bother many people if they do it the wrong way.

Posts: 2321
Joined: Fri Aug 24, 2007 1:57 am
Location: Trapped in Pleasantville with Toby McGuire
Medals: 48

### Re: NEW: Assault Odds

BaldAdonis wrote:I agree they should be overall odds. As long as they players know what it means when they imput certain strings, they should be able to tailor their plan of attack accordingly. Publish what you've got now, I'm going to play around with some small numbers and compare what I get with what you get. Large numbers should be fine anytime, it's just the cases where the smaller force could conceivably win that might be strange. In any event, the odds would be better than expected, so it shouldn't bother many people if they do it the wrong way.

Published. Click on Latest Version Installed to get this new version.

I will be doing version control after adding bombards in quick calc and stats by survivors.

chipv

Posts: 2756
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44

### Re: NEW: Assault Odds

Could you add a "Remove Calc" button, next to the "Add Calc"?
jay_a2j wrote:lets not be so quick to judge Hitler

Timminz

Posts: 5564
Joined: Tue Feb 27, 2007 1:05 pm
Location: At the store
Medals: 55

### Re: NEW: Assault Odds

Timminz wrote:Could you add a "Remove Calc" button, next to the "Add Calc"?

I suppose so. Or refresh and start again?

chipv

Posts: 2756
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44

### Re: NEW: Assault Odds

chipv wrote:
Timminz wrote:Could you add a "Remove Calc" button, next to the "Add Calc"?

I suppose so. Or refresh and start again?

F5 does that. Sometimes I add one more calc than I need, and having to start from scratch can be quite time consuming.

Also, I would like if whenever I clicked "Odds" on any of the quick calc lines, it refreshed all lines of the quick calcs, and total odds. Possibly just make one "odds" button, that refreshed all lines.
jay_a2j wrote:lets not be so quick to judge Hitler

Timminz

Posts: 5564
Joined: Tue Feb 27, 2007 1:05 pm
Location: At the store
Medals: 55

### Re: NEW: Assault Odds

Timminz wrote:Could you add a "Remove Calc" button, next to the "Add Calc"?
Sometimes I add one more calc than I need, and having to start from scratch can be quite time consuming.

Ok.
Timminz wrote:Also, I would like if whenever I clicked "Odds" on any of the quick calc lines, it refreshed all lines of the quick calcs, and total odds. Possibly just make one "odds" button, that refreshed all lines.

They already do! If you click on any Odds it refreshes its line and also the total. They are separate odds and the total is the product.

I think you may be asking for cumulative odds again which I thought we decided against.

chipv

Posts: 2756
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44

### Re: NEW: Assault Odds

chipv wrote:I think you may be asking for cumulative odds again which I thought we decided against.

no, I mean, so that when I adjust my fronts (put 2 less here, and 2 more there), I don't have to click "odds" for both rows.
jay_a2j wrote:lets not be so quick to judge Hitler

Timminz

Posts: 5564
Joined: Tue Feb 27, 2007 1:05 pm
Location: At the store
Medals: 55

### Re: NEW: Assault Odds

Timminz wrote:
chipv wrote:I think you may be asking for cumulative odds again which I thought we decided against.

no, I mean, so that when I adjust my fronts (put 2 less here, and 2 more there), I don't have to click "odds" for both rows.

Ah, I see, ok easy enough and a better idea than what is present, too, so will be done.

chipv

Posts: 2756
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44

### Re: NEW: Assault Odds

Version 1.0.1 is available - click on Latest Version Installed.

This version will auto check for new version available, so you need this one to alert you of future versions.

Multiple Attackers and Statistics have been added (see head post for details).

What is to be done:

I'm thinking about creating statistics for quick calc combinations (not sure if necessary).
At present Statistics will show results from last individual calc which is why individual buttons are still there.
Remove calc
Bombards (sorry, stats was more important)
Possibly defender stats under a separate option.

Let me know if there is anything else on the to do list.

chipv

Posts: 2756
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44

### Re: NEW: Assault Odds

Just thinking once people are up to v 1.0.1 then I can do version updates so get upgrading then things will get easier.

chipv

Posts: 2756
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44

### Re: NEW: Assault Odds

New version uploaded but still 1.0.1 because it's a bug fix. Click on latest Version Installed.

There was a problem with statistics for multiple defenders - this has been corrected now.

Just FYI at the moment you will only see surviving attacking statistics for successful assaults.

That means for example 6 v 1,2 will only show surviving numbers 3 and greater because it is
impossible to have a successful assault on 2 territories and have less than 3 armies remaining.

This is mostly for speed reasons, the algorithm even with statistics turned on is still very quick
and also makes re-use of old calcs.

There would be a speed hit (not that much as it would also re-use old calcs) if I allowed losing attacking survivors
and defenders statistics but I have a feeling I will have to do this anyway, the question is whether or not to include
by default or have an option for defender stats.

chipv

Posts: 2756
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44

### Re: NEW: Assault Odds

AMAZING!

Really good job, chipv!
Welcoming the long awaited Trench Warfare Setting (Previously Adjacent Attacks).

My Maps:
Research and Conquer - Civilization meets Conquer Club

Best score: 2,346 - Best position: #618 - Best percentile: 4.87%

OliverFA

Posts: 2361
Joined: Wed Jul 09, 2008 4:30 am
Location: Somewhere in Spain
Medals: 32

### Re: NEW: Assault Odds

*repeatedly bashing head against brick wall trying to fix a problem with statistics*

There is a fix for clickable maps (typing in numbers affected CM during turn)
and some other fix which I can't remember...

chipv

Posts: 2756
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44

### Re: NEW: Assault Odds

Google Chrome users can use this script now - see viewtopic.php?f=59&t=73696#p2137958 for
details of how to install.

chipv

Posts: 2756
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44

### Re: NEW: Assault Odds

Brilliant little tool. Absolutely essential, almost more so than BOB to me on small maps.

danryan

Posts: 3428
Joined: Tue Jan 09, 2007 8:30 pm
Medals: 153

### Re: NEW: Assault Odds

Excellent script chipv, thanks a lot for your work

Any chance we can have a 'hide/show' option added to the menu on the left? While the script is extremely useful when trying to figure out odds for certain runs, particularly for killing, I don't need it for most of the turns I take and with all the other add-ons I have running, it adds to the bulk of stuff that needs to be scrolled through.

Thanks again for the awesome script

Shino Tenshi

Posts: 161
Joined: Sat Sep 01, 2007 1:35 pm
Location: getting banned for exposing CC for protecting the identity of a pedo predator
Medals: 45

### Re: NEW: Assault Odds

Just disable the script when you don't need it.

chipv

Posts: 2756
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44

### Re: NEW: Assault Odds

i've only recently just found this thread, i've not looked through plugsins and addons in the forums until now, and i'm concerned about this. i'm sure this is a pretty cool toy and chipv has put heaps of work into it, and by saying this i'm not meaning to discredit his efforts, but why should this be allowed? to attack or not to attack, to attempt to take someone out or not, how many troops to deploy & reinforce, to leave how many to protect bonuses; those decisions are precisely what this game is about. that is where the skill lies.

i feel cheated to know that i may have lost games to people who have had this add-on, who perhaps were told the probability of taking me out, to 17 decimal places, and how many troops they'll have leftover. this is a worrying trend. by allowing such tools as this, we are lowering the skill content of the game, and enhancing the luck element (dice & drop). what makes risk/cc great, is that it's predominantly a game of skill, with luck involved. I do not want to see it become a game of luck, with skill involved. i liken this to performance enhancing drugs in sport, as this is a performance enhancing tool.

i will never use this, no disrepect to you chipv, and if people have this and read this post i would appreciate then not playing me. foe me if you like. but if you lose to me, i will win unassisted. i hope when i lose to people, it's the same.

i hope i'm not the only person who doesn't agree with this direction. it's bordering on cheating. and where will it stop?

peacemakers

Posts: 78
Joined: Wed Apr 15, 2009 11:13 pm
Medals: 29

### Re: NEW: Assault Odds

Urm, quick question for you Peacemakers, which of these scenarios more fits into the category of 'luck' and which into 'skill' (because, after reading your post, I can't help but believe that we were raised with very, very different definitions of the words...):

a. An individual drops 15 troops to take out another player. That player did no calculations before hand (not even the number of troops the other player has) and managed to have amazing dice and take the player out.

b. An individual the same # of troops, but fails miserably, again- due to dice, seeing as he failed to plan ahead and check the number of troops he was up against.

c. An individual plans ahead a few turns to take out another player, waiting until the odds are ON HIS SIDE and he won't have to rely on dice to properly (at least, with a good chane) take out the other player.

In the first two scenarios, the individual does not rely on skill. If you are not making calculations on your attacks and relying on dice/luck- you are not a skilled player. If the same individual plans a kill using the proper odds and statistics, he has more luck? How is that so? That players has more brains and foresight, not luck.

To play a turn without the advantage on your side is foolish, and that is how you will lose games. Dice/drops still happen, but removing an entirely logical advantage (statistics) to instead make random guesses on attacks simply doesn't make sense.

This script doesn't change your dice, make you any faster, or give you some sort of edge other players couldn't have if they sat for more than 45 seconds to think out a turn. It simply helps you make calculations anyone with 'skill' should be making (aka: anyone who doesn't want to rely on the luck of the dice/drop to win a game).

Thanks for the AWESOME script chip. You never fail to amaze me

Posts: 526
Joined: Mon Apr 07, 2008 8:49 pm
Location: Somewhere in the 20th century.
Medals: 49

### Re: NEW: Assault Odds

What he is saying is that people should have to count for themselves rather than have a program do it for them. I have no beef with this program and can be a useful tool. Nicely done chip!
Highest Rank: 26 Highest Score: 3480

Bruceswar

Posts: 9571
Joined: Sun Dec 23, 2007 12:36 am
Location: Cow Pastures
Medals: 141

### Re: NEW: Assault Odds

Some of us aren't godly with statistics, like Mr. Chip, and cannot do aforementioned calculations in our heads.

Have a number doesn't give you an edge like CM does, it gives you foresight and tactics (aka: skill).

Posts: 526
Joined: Mon Apr 07, 2008 8:49 pm
Location: Somewhere in the 20th century.
Medals: 49

PreviousNext