Redwall: Warlords

Discussion => Reg Discussion => Topic started by: TWRWMOM on March 28, 2018, 11:13:03 PM

Title: All Values
Post by: TWRWMOM on March 28, 2018, 11:13:03 PM
Hi!

I'm new to this game, but played quite a lot of promisance-ish games....

I wanted to ask if there's any place I could read the exact formulas/values for......everything. Is it open-source? I could see the QM-Promisance code, but I don't know which values are the same and which are different....

Thank You!
See you in the game! :)
Title: Re: All Values
Post by: windhound on March 29, 2018, 11:14:18 AM
Hi and welcome!

We're based on nearly 16 year old QMT and sorta diverged on our own from there. 
tbh I don't mind sharing the code, my only concern is that a bad actor could find some vulnerability. 
Yeah, security through obscurity is no security at all, but /shrug. 
Aint nobody got time for that, we're mostly coasting here. 

A past admin got permission from the original author(s) to not release the code.

Anyways.
I'll pull some values for you, need them for the game guide redo that's on my list anyways. 

Troops - (attack / defense)
Rats: 2 / 1
Weasels: 3 / 5
Stoats: 5 / 3
Skiffs: 6 / 8
(same for all eras)

Attack types -
Standard Attack: Attack with all troops
Surprise Attack: Std attack with +25% attack power, cost +3 additional health, no allies (clan members can 'share defences', brings a small percent of their troops in for ally defense)
Guerilla Strike: Just battles Rats
Bombardment: Just battles Weasels
Frontal Assault: Just battles Stoats
Naval Assault: Just battles Skiffs


Attack modifiers (does not apply to Std attack) -
Drive: +20% attacker losses, +10% land taken
Chaos: +15% enemy losses, -20% land taken
Capture: +15% attack losses, -15% enemy losses, -10% land taken, takes a small percent of the enemy's leaders
Sack: -20% land taken, takes a small percent of the enemy's food and cash based on how many leaders you have (the more leaders you have the less you get)
Flank: a 1 in 6 chance (random) for +20% attack power & +30% attacker losses


Leaders -
Generals Hut (self-spells) -
ratio = Leaders / Huts * RaceMod

Spells: (req. ratio)
Feast:  30
Loot: 30
Raise Defense: 15
Prepare Raiders: 75
Recall Raiders: 80
Move North: 90
Move South: 90
Heal (+10 health): 95
[Magpie] Tax Break: 50
[Marten] Goldmine (extra powered loot): 80
[Ferret] RainDance: 50
[Wildcat] Pressgang (converts workers into troops) : 90
[Painted One] Pay Tribute (weaker Loot + weaker Feast combo): 30
[Stoat] Academy (converts workers to leaders): 90
[Lizard] Fortify (Extra long raise defense): 50
[Wolf] Enrich (You make more food): 50
[Fox] Cloak/Uncloak (Each cast decreases your shown networth by 1%; only affects scores, info page, and search) : 50
[Rat] Battlefield Healers (10% less losses while attacking):50


Warlords Hut (attack-spells) -
(u = user, e = enemy)
$uratio = uLeaders / ((uLand + eLand) / 2) * uRaceMod;
$eratio = ($eLeaders / $eLand * 1.05 * $eRaceMod)*(1+($eTowers/($eLand*2)));

Spells:
Espionage: $uratio > $eratio
Murder: $uratio > $eratio * 1.15
Poison: $uratio > $eratio * 1.21
Steal: $uratio > $eratio * 1.75
Incite Uprising (destroy loyalty):  $uratio > $eratio * 1.3
Sabotage (destroy buildings): $uratio > ($eratio * 1.7)
Leader Attack: Req ratio of 50, $uratio > $eratio * 2.2
Take City: Req ratio of 50, offpts > $defpts * 1.50
Make Attack Opportunity (allows you to attack a maxed enemy): Req ratio of 50, $uratio > $eratio * 1.8


That's the basics
Lemme know if you want somethin' else
Title: Re: All Values
Post by: TWRWMOM on March 30, 2018, 07:24:05 AM
Thank you very much

Didn't know towers could defend attack spells.....interesting, very interesting ;)

Could you please post also the differences between eras and the Magpie and Ferret spells? I'm sorry for the trouble
Title: Re: All Values
Post by: windhound on March 30, 2018, 12:48:18 PM
Nah, no trouble. 
All this stuff should be documented in the game guide, hoping to have time to fix it soonish.. 

Knew I was forgetting something,
Locations -
Southsward: +80% scouting bonus, +20% worker production
Mossflower: -20% troop production, +20% loyalty production
Northlands: +20% troop production, -20% loyalty production


Ferret's ability gives a chance of an extra heal while foraging (not leader feasting), based on how many foragers you have built. 
$chance = ($users[farms] / ($users[land] * 2)) * 100;
if(mt_rand(0,100) <= $chance)
    $users[health]++;

Magpie works the same way, except for looting (not leader loot) and it's based on how many markets.
Title: Re: All Values
Post by: TWRWMOM on March 30, 2018, 05:50:31 PM
Magpie it is! ;)

Taxes modify max workers, or only Immigration/Emigration?
Title: Re: All Values
Post by: Gen. Volkov on March 30, 2018, 07:06:31 PM
Immigration/emigration, but functionally it's the same thing. Higher taxes mean more money and food, but less workers will come, or even start to leave, lower taxes opposite.
Title: Re: All Values
Post by: TWRWMOM on March 30, 2018, 08:37:28 PM
Quote from: Gen. Volkov on March 30, 2018, 07:06:31 PM
Immigration/emigration, but functionally it's the same thing. Higher taxes mean more money and food, but less workers will come, or even start to leave, lower taxes opposite.

Why should they leave? I mean, if max is not reached...
Title: Re: All Values
Post by: windhound on March 30, 2018, 11:12:09 PM
Taxes affect max worker population and gain/lose rates..  here

        $popbase = round((($users[land] * 2) + ($users[freeland] * 5) + (($users[homes] + ($users[cities] * 1500)) * 60)) * (1-$users[tax]/75));
        $popbase *= $uera["t_peasants"];  //location modifier
        if ($users[peasants] != $popbase)
            $peasants = $popbase - $users[peasants];
        if ($peasants > 0)
            $peasmult = (250/20)/($users[tax]*$users[tax]-$users[tax]+5);
         else
            $peasmult = (($users[tax]-70)*($users[tax]-70)*($users[tax]-70) + 65*65*65)/(40*65*65*65)+(1/100);
        $peasants = round($peasants * $peasmult);

...I have no idea why things are being cubed
Title: Re: All Values
Post by: Shadow on March 31, 2018, 12:28:39 AM
cubes add legitimacy
Title: Re: All Values
Post by: TWRWMOM on March 31, 2018, 05:29:10 PM
Quote from: windhound on March 30, 2018, 11:12:09 PM
Taxes affect max worker population and gain/lose rates..  here

        $popbase = round((($users[land] * 2) + ($users[freeland] * 5) + (($users[homes] + ($users[cities] * 1500)) * 60)) * (1-$users[tax]/75));
        $popbase *= $uera["t_peasants"];  //location modifier
        if ($users[peasants] != $popbase)
            $peasants = $popbase - $users[peasants];
        if ($peasants > 0)
            $peasmult = (250/20)/($users[tax]*$users[tax]-$users[tax]+5);
         else
            $peasmult = (($users[tax]-70)*($users[tax]-70)*($users[tax]-70) + 65*65*65)/(40*65*65*65)+(1/100);
        $peasants = round($peasants * $peasmult);

...I have no idea why things are being cubed

Quite ingenious this formula, even though magic numbers...thank you!
Title: Re: All Values
Post by: TWRWMOM on April 01, 2018, 07:42:12 PM
Last question lol

Can I have the formula for leaders immigration? I've seen games using only Huts for it, and I've seen it as a function of huts and workers....
Title: Re: All Values
Post by: windhound on April 01, 2018, 09:18:25 PM
Sure, we're pure hut-based, scaled on your leader/huts ratio.
They load fast, then taper off.

        if ($users[wizards] < ($users[labs] * 25))
            $wizards = round($users[labs] * 0.45);
        elseif ($users[wizards] < ($users[labs] * 50))
            $wizards = round($users[labs] * 0.30);
        elseif ($users[wizards] < ($users[labs] * 90))
            $wizards = round($users[labs] * 0.15);
        elseif ($users[wizards] < ($users[labs] * 100))
            $wizards = round($users[labs] * 0.10);
        elseif ($users[wizards] > ($users[labs] * 175))
            $wizards = round($users[wizards] * -.05);
        $users[wizards] += $wizards;

Seriously though, 's not a big deal for me to grab code snips
Title: Re: All Values
Post by: Graceclaw on April 02, 2018, 10:08:09 AM
How exactly does worker count affect Foraging/Looting/general resource production? Is it ratio-based or raw numbers-based?

Trying to figure out the worker-tax combination.
Title: Re: All Values
Post by: Shadow on April 02, 2018, 10:19:10 AM
As a method of producing cash and food workers are pretty much useless in this version of the code regardless of tax. I wouldn't bother.
Title: Re: All Values
Post by: TWRWMOM on April 03, 2018, 08:26:57 AM
Quote from: Shadow on April 02, 2018, 10:19:10 AM
As a method of producing cash and food workers are pretty much useless in this version of the code regardless of tax. I wouldn't bother.

Well.......poo XD

I have 2 other questions....

1 - In this formula of worker population
Quote from: windhound on March 30, 2018, 11:12:09 PM
$popbase = round((($users[land] * 2) + ($users[freeland] * 5) + (($users[homes] + ($users[cities] * 1500)) * 60)) * (1-$users[tax]/75));

homes = weighted average of the different types of constructions (since each type can host a number of workers)? or just Tents?

2 - What happens with bank earnings when total reached the max allowed? Does bank cash counts towards total net value?
Title: Re: All Values
Post by: windhound on April 03, 2018, 11:16:33 AM
The game's code uses the default promi names and displays our custom Redwall related theme. 

'shops' = Markets
'homes' = Tents
'industry' = Barracks
'barracks' = Camps
'labs' = Huts
'farms' = Foragers
'towers' = Towers

Also lol I forgot about the Barracks/Camps thing, blame Boze our founder.

Food production: (not worker related)
   $foodpro = round((($users[freeland] * 10) + ($users[farms] * 100)) * $urace[farms]);
Food use:
   $foodcon = ($users[peasants] * .01) + ($users[wizards] * .25);
   reset($trplst);
   while (list($key, $val) = each($trplst))
       $foodcon += $users[$val] * $config[$val][cost][food];
   $foodcon *= $urace[food];
   $foodcon = round($foodcon);


Cash production:
   $size = calcSizeBonus($users[networth]);
   $income = round(((pci($users, $urace) * ($users[tax] / 100) * ($users[health] / 100) * $users[peasants]) + ($users[shops] * 1000 * $urace[pci])) / $size);
Cash use:
   $expenses = ($users[land] * 8) + ($users[wizards] * .5) + ($users[cities] * 750000);
   reset($trplst);
   while (list($key, $val) = each($trplst))
       $expenses += $users[$val] * $config[$val][cost][cash];
   $expenses = round($expenses);
   $expbonus = ($urace[costs] - (($users[barracks] + ($users[cities] * 500)) / $users[land]));
   if ($expbonus < 0.5)    // expenses bonus limit
       $expbonus = 0.5;
   $expenses *= $expbonus;


where pci = round(60 * (1 + $user[shops] / (3*$user[land])) * $race[pci]);

Normal (not leader) Loot / Feast adds +25% to production.

Normally I'd agree with Shads that Casher/Farmer don't really work with the way reg is currently, but Sevz did manage to run Farmer with Ferret for like half of last round and seemed to do well with it..


So yeah,  Homes = Tents
And once you exceed your bank cap the excess cash leaks out at 3% per turn cycle.  You don't lose anything.
iirc this was implemented when we started having proceeds from market sales go directly to the bank.  Some players were buying troops then immediately stealing the cash back.

Banked cash counts half as much as normal cash towards networth, a loan deducts double.  But cash is worth so little it doesn't make much of a diff.

Here's the full net calc
   $networth = ($user[wizards] * 2) + ($user[peasants] * 3) + (($user[cash] + $user[savings]/2 - $user[loan] * 2) / (5 * $config[armtrp][market])) + ($user[land] * 500) + ($user[freeland] * 100) + ($user[cities] * 750000);
   reset($tplst);
   while (list($key, $val) = each($tplst))
       $networth += $user[$val] * ($config[$val][market] / $config[armtrp][market]);


Cash and Troop net are calced based on how much rats (armtrp) are worth.
Title: Re: All Values
Post by: TWRWMOM on April 04, 2018, 07:26:13 PM
Hi! Me again!

I'm trying to create an excel file to calculate stuff...I wanted to know:

1 - calcSizeBonus formula

2 - What exactly is and the difference between:
$race[pci]
$urace[pci]

I guess I made some people angry today, and Asmodeus very happy.....but then, I have no idea what the teams are, so I guess I can't be blamed XD

Many many thanks! :)
Title: Re: All Values
Post by: windhound on April 04, 2018, 11:22:41 PM
function calcSizeBonus($networth) {
    if ($networth <= 100000)
        $size = 0.524;
    elseif ($networth <= 500000)
        $size = 0.887;
    elseif ($networth <= 1000000)
        $size = 1.145;
    elseif ($networth <= 10000000)
        $size = 1.294;
    elseif ($networth <= 100000000)
        $size = 1.454;
    else
        $size = 1.674;
    return $size;
}

And no diff between $race[pci] and $urace[pci]

The pci function is just:
  function pci($user, $race) {
      return round(60 * (1 + $user[shops] / (3*$user[land])) * $race[pci]);
  }
Which can be used to determine pci for the user's race ($urace) or enemy's race ($erace)



The two main cliques at RWL at the moment are Sevs/Shoot/Disl/Snare/+  and Volkov/Briar/Firetooth/Sharptooth/+
There's a handful of independent players and some who float closer to one side than the other. 
Title: Re: All Values
Post by: Shoot on April 05, 2018, 04:32:46 PM
Those are more or less the teams, but generally there aren't any problems with merely taking land provided you're not online hitting (attacking people who are actively playing turns). 20+ attacks to grab land is normal and generally nothing to be alarmed at here, especially if you have a relatively high amount of land. When things change from merely grabbing land to directly messing with your opponent's progress (standard attack, sacking, damaging missions, online hitting, etc.) then people tend to take that as an act of war, teamed or not.
Title: Re: All Values
Post by: Graceclaw on April 18, 2018, 03:29:54 PM
How does the 'available mercenaries' work? Does it recharge over time, or over turns spent? Is it capped per your Networth?

Also, what is the ratio for determining mercenary prices? What's the golden ratio for best possible prices?
Title: Re: All Values
Post by: Gen. Volkov on April 18, 2018, 06:26:08 PM
It recharges over time based on the amount of land you have. Its capped by how much land you have. As for the ratio, I assume you mean camps? If so, 40% camps is the ideal ratio for the best merc prices.
Title: Re: All Values
Post by: TWRWMOM on April 19, 2018, 05:28:04 AM
Quote from: Gen. Volkov on April 18, 2018, 06:26:08 PM
40% camps is the ideal ratio for the best merc prices.

Well, darn. I was doing 30%....I kinda thought the public market were somewhat too cheap but didn't think much of it lol
Title: Re: All Values
Post by: TWRWMOM on June 14, 2018, 10:18:44 AM
I've stopped playing, but maybe someone would appreciate the spreadsheet I made.

It's mainly about Income and Magic....one interesting finding is that taxes are pretty much irrelevant, at least in production.

https://files.fm/u/npumef5y
Title: Re: All Values
Post by: windhound on June 14, 2018, 09:47:21 PM
Neat. 
Thanks!