Bug #18973

Commander Income System: Shared Income

Added by Bomba1 almost 4 years ago. Updated almost 4 years ago.

Status:Closed Start date:04/16/2011
Priority:Normal Due date:
Assignee:Benny % Done:

100%

Category:-
Target version:Warfare BE 2.069
Affected Version: I am using some Mods:No
Affected ArmA II version:Please select... Reproducible for you:No

Description

in the current version if player set the percentage of 0 - commander will not receives any money + team always gets the money in half

so need fix:
get from each player's taxes
and comm receives its share + taxes from each player: ie to multiply the number of players on the team to a tax, not to divide the share of each player on the number of players on the team

fix this script:
updateresources.fsm

//--- Commander System
if (_is == 3) then {
_sidePlayers = maxPlayers / 2;
_westPerc = (100 - (WestCommanderPercent / _divisor)) / 100
_eastPerc = (100 - (EastCommanderPercent / _divisor)) / 100;

_ply_income_w = round(_westIncome * _westPerc);
_ply_income_e = round(_eastIncome * _eastPerc );

_com_income_w = _ply_income_w + round(_sidePlayers * (1 - _westPerc ));
_com_income_e = _ply_income_e + round(_sidePlayers * (1 - _eastPerc ));    
};

History

Updated by Bomba1 almost 4 years ago

small fix for more accurate calculate player and commander income

if (_is == 3) then {
_westPerc = (100 - (WestCommanderPercent / _divisor)) / 100;
_eastPerc = (100 - (EastCommanderPercent / _divisor)) / 100;

_ply_income_w = floor(_westIncome * _westPerc);
_ply_income_e = floor(_eastIncome * _eastPerc );

_com_income_w = _ply_income_w + floor(maxPlayers * (_westIncome - _ply_income_w ));
_com_income_e = _ply_income_e + floor(maxPlayers * (_eastIncome - _ply_income_e));
};

Updated by gmt2001 almost 4 years ago

actually to make it work as it should the following 2 changes should be made

REPLACE LINE 112
" case 3: {_income = if (_comTeam != _x) then {_ply_income_e} else {_ply_income_e + _com_income_e}};" \n

REPLACE LINE 137
" case 3: {_income = if (_comTeam != _x) then {_ply_income_e} else {_ply_income_w + _com_income_w}};" \n

Updated by Benny almost 4 years ago

Remember that the shared income is calculated based upon the global value of all towns and of the players amount, in this mode, each town value = SV * 10

So a 120 SV Town become a 1200 V town, those 1200 are shared between the 16 players so if the com income is on 0%, each players get 75$ per minutes.

Just have to fix commander 'squad' income ihmo.

Updated by Bomba1 almost 4 years ago

Benny wrote:

Remember that the shared income is calculated based upon the global value of all towns and of the players amount, in this mode, each town value = SV * 10
So a 120 SV Town become a 1200 V town, those 1200 are shared between the 16 players so if the com income is on 0%, each players get 75$ per minutes.
Just have to fix commander 'squad' income ihmo.

But this incorrect, income summ are different if compare with full income and half income modes
So if a side has one captured town, which give at 120 SV and plays 16 people
income of each player will incorrect, even I setup commander share to 0%

income is equal to 120 * 10 / 16 = $ 75
instead of $ 120 (in classic mode), ie almost 42% less.
And if you play more players, the income is more more less
120 * 10 / 24 = $ 50. Income by more than 60% less

I propose to rename this option as a "full income with commander tax", and change small logic. This more understandable
1) set variable tax from 0 to 13%.
In current UI 100% is not understandible that mean 100%. Almost players mean that all side money will give by commander. But this not correct because you divide to divisor and actually comm give max 40%).
So I sugges change display actual taxes - 0 to 13%

2) display a chat message when a rate change. Now players do not see how much they pay
3) correcting the formulas for calculating the commander tax.

I brought them above
ply_income_brutto = sum (total town sv)
ply_income = floor (ply_income_brutto * (100 - commanderTax) / 100);
comm_income = ply_income + floor ((ply_income_brutto - ply_income) * maxplayers)

Summary tests:
A side has one city at 120 SV and plays 16 people per side
commander tax = 13%

ply_income_brutto = $ 120;
ply_income = $ 120 * (100 - 13) / 100 = $ 104
comm_income = $ 104 + (120 - 104) * 16 = $ 360

test:
totalSideIncomeA = ply_income_brutto * 16;
totalSideIncomeB = ply_income * (16-1) + comm_income;

totalSideIncomeA = 120 * 16 = $1920
totalSideIncomeB = 104 * 15 + 360 = $1920
TEST PASSED

commander tax = 0%

ply_income_brutto = $ 120;
ply_income = $ 120 * (100 - 0) / 100 = $ 120
comm_income = $ 120 + (120 - 120) * 16 = $ 120

test:
totalSideIncomeA = ply_income_brutto * 16;
totalSideIncomeB = ply_income * (16-1) + comm_income;

totalSideIncomeA = 120 * 16 = $1920
totalSideIncomeB = 120 * 15 + 120 = $1920
TEST PASSED

Updated by Benny almost 4 years ago

I'll add it as a parameter if you want but i'm not modifying the existing one as it's main goal is to limit the cash flow, not increase it (cf. 800SV 24 players -> 19200$/min).

Updated by Bomba1 almost 4 years ago

Benny wrote:

I'll add it as a parameter if you want but i'm not modifying the existing one as it's main goal is to limit the cash flow, not increase it (cf. 800SV 24 players -> 19200$/min).

understandable. but it is not income for each player, this income of the whole team (19200).
and this normal income because the vehicles price was increased too.
if you want leave this option I suggest to recalc vehicles prices too. (dynamic correct to coeff 10/16)

but also add a commander tax, if you can.
this is a very useful feature on a public server, when the commander often asking for money, but most players ignore or give money rarely

Updated by Benny almost 4 years ago

  • Status changed from New to Assigned
  • Assignee set to Benny
  • Target version set to Warfare BE 2.069

Updated by Benny almost 4 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF