How does loot really work?

Users who are viewing this thread

Uhtred of Bebbanburg

Sergeant at Arms
I've been getting frustrated with loot. I take 300 troops against 900 Heretics and only wind up with a bunch of shields and ratty swords and spiked maces and rusty hammers.

I've tried to use Morgh's to improve things but the only way I can really change it is to use the "always loot" flag. That's not something I like to do since I want there to be a chance of not getting it but also I want that chance of success to be higher than all the crap they put in there.

I can't figure out how to increase the chance of getting more better loot.

I've got a loot skill of 10.

I increased the Abundance value to 100 but I think this only affects merchant availability.

The only other thing I can think of is to remove some of the items in the inventory and flood the inventory with the items that are most valuable. I'm not sure this will work since I don't know whether loot is based on potential items in inventories or the items that actually spawn and are equipped during a battle. How could I even test that?

I do see there are Heretic Writings in some inventories and they can't be equipped so this gives me some idea that altering the inventory list might be the way to go. This can get tedious though.

Also, I even tried disbanding my entire army after a battle to see how that affected loot and it didn't seem to help for the Heretics but it has helped in past games with Noldor.

I don't want to break the game but the only way I can equip my companions and self the way I want is to simply make things available in merchants.
 
You take 10 shares of loot. Each companion takes 3. Each stack of troops takes 1.

Fight a battle with just yourself + ~300 troops of the same type and you'll see much better loot.
 
I get all that.

But when I look in the inventories using Morgh's I see they have all kinds of stuff.

For instance, a Demonic Magnus has like 6  shields in the inventory. Most of them are identical. Why is that?

I think the game uses all items in the inventory to compute what loot drops and if that's the case then it's no wonder loot is so crappy sometimes.
 
If you give a troop the same item five times it's more likely that this troop will spawn with it. Saxon posted a good explanation about it previously explaining how the system works, if you want to have an exact description use the search function.

Basically, if a troop has five morningstars and two swords in it's inventory the chance for the troop to spawn with a morningstar is 5/7 (if the "guarantee melee weapon" flag is set).

(And yes it's more complicated than that and a troop could spawn with two morningstars or one of each or whatever but I'm too lazy to explain that now)

Another thing about loot, you always only get the loot from the last battle. So if you fight a heretic army you'll have the better troops (with better loot) in the first two rounds and after that you'll only fight ****ty minions with ****ty loot. That is quite a big flaw in the engine but afaik it's not changeable (or quite complicated by using scripts to compile the loot) with mods.

As I'm writing this, wouldn't it be possible to break down the army to the size of one battle (keeping the proportions of troop stacks) and make a loot calculation for that virtual party after the battle?
 
Why not just make like 100 waves for each side? Most valuable loot will be put at the top, battles are a bit more interesting and difficult, tactics matter more. I think its a pretty good solution to get better loot in this game.
 
Doesn't loot also depend on party strength vs. enemy strength? I.e. if your strength is evenly matched then you are on top of the bell curve (if it uses normal distribution at all) and get max loot. If you stronger or weaker than the enemy then you get less. I've been trying to find specific numbers on that but they don't seem to exist anywhere.
 
I haven't found specific numbers for this either. Noosers has stated that based on observation, you get the best loot when your party is slightly weaker than the opponent's force. My own experience seems similar, but I might be biased by reading what he said.
 
Raviollius said:
Each stack of troops takes 1.

Not each stack, but each non-hero soldier.
"Each stack" thing is a false rumor spread by noosers.

b34bb_H said:
Another thing about loot, you always only get the loot from the last battle. So if you fight a heretic army you'll have the better troops (with better loot) in the first two rounds and after that you'll only fight **** minions with **** loot.

Another false rumor.
You can easily disprove it by fighting an army that has 300 knights in it followed by 300 farmers. The last round will only give you farmers and yet you will have knight equipment in loot.
_____________________________________

Looting was thoroughly tested on a Russian forum.
Here is the post written by me there that also has links to other posts (some of them are not mine):
http://rusmnb.ru/index.php?topic=8737.msg7439687#msg7439687

Long story short:
1) Total share = 10 + 3*Ncompanions + 1*Nsoldiers
Loot probability = 10*3*(Looting+10)*HeroPartyRole/(8*TotalShare)
HeroPartyRole = 1.0 if you fight an enemy alone (by "alone" I mean "just your own party"). 0.5 if you have an ally party of identical autocalc strength. Etc.
Loot probability is a value that is used by an engine in a mysterious way. No-one but those who have access to the engine can dig any deeper.
Items are looted from a pool of items that a troop has. The more copies of an item, the higher the chance to loot this item.
2) Troops are looted in the same order they are killed. The maximum buffer size is 288 items, so if you have a high Loot probability and a huge enemy party, you will not get all the loot, but only the loot from troops that were killed and looted first (the troop type is what matters since dead troops are stacked; so, for example, if you battle heretics, your first victim should be a demonic magnus, then a heretic magnus, then a heretic invoker, then a worshipper, and only then a minion; never kill a minion first, or your loot will be crap).
At the end of a battle 288 items are sorted by price and you get the most expensive 96 (or 93? I keep forgetting this number...).
3) Unique items don't loot.
The more expensive an item is, the lower the chance to loot it. An item that has a price of 10000 denars will have a roughly 7 times smaller probability to be looted than an item that's worth 10 denars.
Abundance does not affect looting chance.
A type of an item (like boots, gloves etc.) probably does not matter, but more tests are needed.
4) There is another thing.
If you fight a huge army consisting of one type of troops (like Rogue Knights) alone (for tests I just used a cheat key combination) or with a small party of allies (which means you have a very high loot probability), you will only get certain items but will never get other items. If you reduce the size of an enemy army, your loot will be more diverse.
Like:
400 knights => oh, I see morningstars, horses A, horses B, helmets C and shields D.
350 knight => now this + there are also bastard swords in the loot
300 knights => ... + there are also lances in the loot
250 knights => + there are also helmets E in the loot.
So there is also a certain sequence in which items are looted. But it's not based on abundance, price, position in item_kinds1.txt or position in a troop's item pool. I don't know what it is based on.
 
Leonion said:
Thank you for the info. It would explain some of my strange luck in PoP. I was about to start a new game, looks like it's time to try a very different approach to party composition/tactics. Maybe 11 companions is the way to go after all. I used to think that 1 companion = 3 troop stacks and based the party composition around this assumption.

I'll get my new party rolling and see what happens  :grin:
 
Leonion said:
Raviollius said:
Each stack of troops takes 1.
(the troop type is what matters since dead troops are stacked; so, for example, if you battle heretics, your first victim should be a demonic magnus, then a heretic magnus, then a heretic invoker, then a worshipper, and only then a minion; never kill a minion first, or your loot will be crap).
At the end of a battle 288 items are sorted by price and
Not each stack, but each non-hero troop.
"Each stack" thing is a false rumor spread by noosers.

So you´re saying every single trooper takes a share? The way I read your post, Ntroops is every stack of a certain troop type =(e.g. 123 Militas) which pulls a single share, just like I said, and what the manual says.

Pretty interesting findout though. Thank you for posting it. Explains quite some of my observations and leads to a few conclusions.

Loot is best hunted against small, uniform parties -like the various Knightish bands using a slightly smaller and homogenous party composition. This means fun-wise it´s either very early of very late game, rather early. As you may depend on good loot then a lot more than lategame.
 
noosers said:
So you´re saying every single trooper takes a share? The way I read your post, Ntroops is every stack of a certain troop type =(e.g. 123 Militas) which pulls a single share, just like I said, and what the manual says.
Ow...
No, by Ntroops I actually meant "N soldiers", "N single soldiers".
I've just never actually seen a dictionary definition of "troops" before now, I simply guessed its meaning from messages of other people that I've seen, and I believed that words "a troop" and "a soldier" were interchangeable.  That's embarrassing...
Although, well, not the first English word that I used for years before finding out that it has a different meaning or a different pronunciation.  :sad:

I think I'll just post a Native code from script_calculate_main_party_shares here which I'm pretty sure didn't change in PoP:
  ("calculate_main_party_shares",
    [
      (assign, ":num_player_party_shares", player_loot_share),
      # Add shares for player's party
      (party_get_num_companion_stacks, ":num_stacks", "p_main_party"),
      (try_for_range, ":i_stack", 1, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop", "p_main_party", ":i_stack"),
        (try_begin),
          (neg|troop_is_hero, ":stack_troop"),
          (party_stack_get_size, ":stack_size","p_main_party",":i_stack"),
          (val_add, ":num_player_party_shares", ":stack_size"),
        (else_try),
          (val_add, ":num_player_party_shares", hero_loot_share),
        (try_end),
      (try_end),
     
      (assign, reg0, ":num_player_party_shares"),
  ]),

As for the other part of the quote (the troop type is what matters since dead troops are stacked; so, for example, if you battle heretics, your first victim should be a demonic magnus, then a heretic magnus, then a heretic invoker, then a worshipper, and only then a minion; never kill a minion first, or your loot will be crap), that's a different thing.
Think about how your party looks. This is exactly how a "party of the dead" looks.
So first dies a demonic magnus. He becomes the first troop. Any demonic magni that will die later will be added to this stack. And they will be the first stack that will be looted by a script. But each and every one of demonic magni in this stack will still "contribute" their items to your loot.
For examples, the loot from them totaled 88 items.
The second soldier that died in the battle was a heretic minion. So the next stack in the "party of the dead" will be a stack of heretic minions. And they will be the second ones to be looted.
Let's say the loot from the totaled 300 items.
That's it. The buffer is full. It doesn't matter that there are also worshipers, invokers and heretic magni. You will not get loot from them.

I'm not saying that players should now be obsessed with the correct order of killing. A situation like the one described above will only happen when you have a small party (=> very high loot probability) and a huge enemy party (lots of troops with lots of items to be looted at high probability). In like 98-99% of battles this will not happen.
 
Unfortunately, I understand too little from coding to fully understand that snippet of code but I hazard a guess:

The script called checks the party composition, automatically assigns the loot share of the player, then adds the amount of companion stacks. If it´s not a companion, it checks for the actual stacks size and adds the actual size to player party shares and finally generates the total number of party shares?

So where´s the definition of 10 shares for the PC and 3 for the NPC?
 
noosers said:
So where´s the definition of 10 shares for the PC and 3 for the NPC?

player_loot_share (for the player) and hero_loot_share (for companions) are defined in header_parties in module system.
In .txt files variables just turn into numbers, so we get the following:
2133 2 1224979098644774912 10
1650 2 1224979098644774913 648518346341351424
6 3 1224979098644774914 1 1224979098644774913
1652 3 1224979098644774915 648518346341351424 1224979098644774914
4 0
2147485155 1 1224979098644774915
1653 3 1224979098644774916 648518346341351424 1224979098644774914
2105 2 1224979098644774912 1224979098644774916
5 0
2105 2 1224979098644774912 3
3 0
3 0
2133 2 72057594037927936 1224979098644774912

P.S. Your interpretation is not entirely correct.
The game first assigns a player's share to the num_player_party_shares variable.
Then it starts "picking" every companion (the word "companion" means "any troop that accompanies a player character (or a lord or simply other members of a party if a party does not have a leader)" in the scripts, while who we call "companions" are generally referred to as "heroes") one by one and do the following:
- Is it not a hero? Alright, then let's add a total stack size to the num_player_party_shares variable.
- Oh, is it not not a hero? Let's try "else_try" then and add +3 to the num_player_party_shares variable.
 
Wow. That's really great information Leonion.

Since I've got you here let me pose a couple more questions.

If I disband all my troops before the loot window will my loot be better since I don't have to share with those troops?



And on a slightly different topic: what's the deal with saving villages?

I just saved a village from a 1500 Ravenstein Army with only 330 troops (only lost 100). I got no loot. I got no prisoners. I was only able to recruit/rescue prisoners and that's it.

Is there any way to improve this or is this just hard wired into the game mechanics?  Will it ever be fixed and what is the rationale or reason behind it?
 
Uhtred of Bebbanburg said:
If I disband all my troops before the loot window will my loot be better since I don't have to share with those troops?
Yes.  :grin:

Uhtred of Bebbanburg said:
I just saved a village from a 1500 Ravenstein Army with only 330 troops (only lost 100). I got no loot. I got no prisoners. I was only able to recruit/rescue prisoners and that's it.
Oh yeah, this **** happens. Village battles as well as fiefs defense battles are not rewarding... I'll try to look into this and see if I can come up with a tweak to fix it....

P.S. Done. Sort of. Take a look at the 16th tweak here:
https://forums.taleworlds.com/index.php/topic,348796.msg8353631.html#msg8353631
It will prevent the game from ever using village scenes when you fight lords, which means such battles will be ordinary. 
For a more "appropriate" fix (like keeping village battles but fixing the loot/prisoner issue) you will have to ask the devs.
As for me, I always hated these battles for dismounting my cavalry and in general, so, unfortunately, I have no motivation do "dig" deeper.  :smile:
 
Thanks. I may try that.

I actually like the village battles as there is great opportunity for slaughter because you have a terrain advantage if you know how to use it.

In Troughbren, for example, I moved my infantry and cavalry to the side of a house and put my archers up on the hill. The enemy archers were blocked by the buildings and would not come around because my infantry was there. So that meant that their infantry had no archer support and were slaughtered by my archers on the hill as they came around the corner to engage my infantry. I had very few casualties this way.

Villages offer a different tactical situation which is a nice variation from the constant field battles.
 
I found this thread interesting since I'm still in early game, but have a rather strong army composed of many many stacks. Suddenly loot just dried up and now I'm getting nothing. I got all my good armour from fighting Vanskerry earlier, but when I fight them now, all they have are a few broken shields.

Unfortunately I don't speak code, so just to sum up:
-Be equal or weaker in army strength compared to your opponent.
-Have as few stacks as possible.
-Have high Looting skill (or have a Companion with high Looting skill)
-Kill strongest enemies first
-Anything else?

This really seems like a bug and is super annoying. Logically there's no reason you should get worse loot the stronger you get and the larger armies you fight =/
 
Phoss said:
Unfortunately I don't speak code, so just to sum up:
-Be equal or weaker in army strength compared to your opponent.
-Have as few stacks as possible.
-Have high Looting skill (or have a Companion with high Looting skill)
-Kill strongest enemies first
-Anything else?
1) Strength doesn't mater. Only a number of soldiers. So the best option for a player would be to field a small yet strong army (like a party of HAs, for example).
2) Again, a number of stacks doesn't matter. Only a total number of soldiers (as well as what kind your soldiers are: normal warriors or heroes/companions).
3) Yes.
4) When you fight a huge army with a small party of soldiers on your side - yes. But in normal battles (like 100 vs 100) it doesn't really matter who you kill first.
5) If you want more loot, fight enemies that have plenty of items in their item pool (like rogue knights).
 
Cool, thanks. I think I'll have to try your tweak for this cause it's kinda ridiculous how little loot I'm getting right now and I'm only 50 days in.
 
I thought I read somewhere that having companions means you get a little MORE loot than you would otherwise get(even if they had 0 looting skill). So did I completely misunderstand or get bad information? Did I misunderstand something here? Is it better(as far as loot is concerned) to beat a group of enemies single-handedly or with a group of 10 heroes(I mean unique unkillable soldiers like Roland, etc). I have been having as many companions as possible since I heard they help you get more loot and like having them anyway but it looks like you are saying that having 10 heroes would be the equivolent to having 30 normal soldiers in my party.

Also, I know that more loot generally means better loot(and that looting skill in pendor also increases quality along with quantity) but I was wondering how something else works. Let's say you win a battle and it calculates that you and your army get's 50 items of loot and 20 items go to your army. Does it determine what those items are and then randomly subtract 20 from from the 50 items or does it subtract 20 from 50 and then determine what the remaining 30 items(that you get will be)?
 
Back
Top Bottom