[Freeciv-Dev] [bug #17264] Percentage chance for veteran spies to beat green diplomats is too high

2010-12-14 Thread Matthias Pfafferodt

Update of bug #17264 (project freeciv):

  Status: In Progress = Fixed  
 Open/Closed:Open = Closed 


___

Reply to this item at:

  http://gna.org/bugs/?17264

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17264] Percentage chance for veteran spies to beat green diplomats is too high

2010-12-09 Thread Matthias Pfafferodt

Update of bug #17264 (project freeciv):

  Status:  Ready For Test = In Progress

___

Follow-up Comment #5:

 Since MAX_VET_LEVELS is hardcoded at 10 what is the point of 
 doing this calculation 20/MAX_VET_LEVELS is always 2. 

MAX_VET_LEVEL is a definition for the max veteran level which can easily be
changed. If I use 2 here I would have to add a comment to tell the guy who
wants to change it in 2 years that he has to change this number too.

 You add 2 for a green diplomat attacker only to subtract 2 for a 
 green diplomat defender immediately afterwards. 

I did it to get nice numbers ... there is no need for it as the rounding to
int does it anyway

 We are now back to the original code except 15 has been 
 replaced by 2. The problem here is that the value for an elite 
 diplomat fighting a green diplomat is too low. 56% does not 
 give the correct advantage. An elite should be twice as 
 powerful hence 66% is more appropriate. 

It would mean to save the number of veteran level for each unit. Thus,
MAX_VET_LEVEL could be replace by the actual number and the increase per level
would be 20/(real number of levels). For 4 levels it would result in a chance
of 65% (elite diplomat fighting a green diplomat).

___

Reply to this item at:

  http://gna.org/bugs/?17264

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17264] Percentage chance for veteran spies to beat green diplomats is too high

2010-12-08 Thread Matthias Pfafferodt

Update of bug #17264 (project freeciv):

  Status:None = Ready For Test 
 Assigned to:None = syntron
 Release: = 2.3.0, 2.4.0   

___

Follow-up Comment #1:

patch: fix diplomat_success_vs_defender()

* veteran level add max. 20%
* add some comments

Something about the calculations:

* The base change is 50%.
* If it is spy agains spy it is +25% - 25%
* a veteran add / reduces the chance by max. 20%
= max. value is 95%

(file #11512)
___

Additional Item Attachment:

File name: 20101208-trunk-fix-diplomat_success_vs_defender.patch Size:1 KB


___

Reply to this item at:

  http://gna.org/bugs/?17264

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17264] Percentage chance for veteran spies to beat green diplomats is too high

2010-12-08 Thread anonymous

Follow-up Comment #2, bug #17264 (project freeciv):


Your patch does not seem correct.
I see MAX_VET_LEVELS defined as 10 in in fc_types.h
Yet I assume you are using the number 4.

If you use 4 then the chances would be

The chance for a green spy to beat a green diplomat = 75%
The chance for a veteran spy to beat a green diplomat = 80%
The chance for a hardened spy to beat a green diplomat = 85%
The chance for an elite spy to beat a green diplomat = 90% 

Note max is 90% not 95%

An added benefit is that promoted diplomats no longer have much of a bonus
over green ones. This removes the problem of 'invincible' elite diplomats.
Here an elite unit is only likely to win two times out of three.

The chance for a green diplomat to beat a green diplomat = 50%
The chance for a veteran diplomat to beat a green diplomat = 55%
The chance for a hardened diplomat to beat a green diplomat = 60%
The chance for an elite diplomat to beat a green diplomat = 65% 

___

Reply to this item at:

  http://gna.org/bugs/?17264

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17264] Percentage chance for veteran spies to beat green diplomats is too high

2010-12-08 Thread Matthias Pfafferodt

Follow-up Comment #3, bug #17264 (project freeciv):

 I see MAX_VET_LEVELS defined as 10 in in fc_types.h 
 Yet I assume you are using the number 4. 

I'm using _10_ as different rulesets could use more veteran levels as the
default ruleset.

 Note max is 90% not 95% 

That's right as I did not start at 0 but at 1 ;-) (and if you set the max to
4). I addapted the calculation a little bit but it does not changes the
result, as the negative bonus due to the defending unit will cancel the
increase ;-)

Lets take the function diplomat_success_vs_defender() step by step for spy
attack agains a green diplomat:

  int chance = 50; /* Base 50% chance */
* spy win = 50%
* (no superspy)
  /* Add or remove 25% if spy flag. */
  if (unit_has_type_flag(pattacker, F_SPY)) {
chance += 25;
  }
* spy win = 75%
  /* Add or remove up to 20% for veteran level. */
  chance += 20 * (pattacker-veteran + 1) / MAX_VET_LEVELS;
  chance -= 20 * (pdefender-veteran + 1) / MAX_VET_LEVELS;
* depending on the veteran level of the spy this will result in different
numbers. For the default ruleset (4 levels) 2, 4, 6 or 8 percent are added,
but also at least 2% are removed due to the veteran level of the defender.
Thus, the spy win chances against a green diplomat are now at 75, 77, 79 or
81%. If 10 veteran level are used it could go up to 93%.


for a diplomat against a green diplomat you get:
* diplomat win = 50%
* (no superspy)
* (no spy)
* using the default ruleset (4 veteran levels) the chances are 50, 52, 54 or
56%


Added percents due to veteran level are negated if the defender has the same
level.


I think this is OK as it keeps the chances at a value around 50%.

(file #11519)
___

Additional Item Attachment:

File name: 20101208.2-trunk-fix-diplomat_success_vs_defender.patch Size:1 KB


___

Reply to this item at:

  http://gna.org/bugs/?17264

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17264] Percentage chance for veteran spies to beat green diplomats is too high

2010-12-08 Thread anonymous

Follow-up Comment #4, bug #17264 (project freeciv):

Since MAX_VET_LEVELS is hardcoded at 10 what is the point of doing this
calculation 20/MAX_VET_LEVELS is always 2.

Also why bother with the +1
chance += 2 * (pattacker-veteran + 1)

You add 2 for a green diplomat attacker only to subtract 2 for a green
diplomat defender immediately afterwards.

It would be better to write
chance += 2 * (pattacker-veteran)

We are now back to the original code except 15 has been replaced by 2. The
problem here is that the value for an elite diplomat fighting a green diplomat
is too low. 56% does not give the correct advantage. An elite should be twice
as powerful hence 66% is more appropriate. 

___

Reply to this item at:

  http://gna.org/bugs/?17264

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17264] Percentage chance for veteran spies to beat green diplomats is too high

2010-12-07 Thread anonymous

URL:
  http://gna.org/bugs/?17264

 Summary: Percentage chance for veteran spies to beat green
diplomats is too high 
 Project: Freeciv
Submitted by: None
Submitted on: Wed Dec  8 01:39:48 2010
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:


In the file diplomats.c is the code for diplomat/spy contests.
It is in the function diplomat_success_vs_defender.

The base chance for these contests is 50%
A spy attacker or defender adds 25% to this.

Then a second addition or subtraction is done depending what level the spy or
diplomat is.  The code multiplies the level by 15. This is clearly a mistake.
It is too high for hardened and elite units.

The chance for a green spy to beat a green diplomat = 75%
The chance for a veteran spy to beat a green diplomat = 90%
The chance for a hardened spy to beat a green diplomat = 105%
The chance for an elite spy to beat a green diplomat = 120%

This is an important bug. In the last longturn game my spies eliminated over
60 enemy diplomats without loss a few hours after espionage was researched




___

Reply to this item at:

  http://gna.org/bugs/?17264

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev