Page 1 of 1

Rebalanced item drop chances

Posted: Tue Nov 19, 2013 11:08 am
by lyx
This addon modifies the rarity values of most items, to make it so that most "kinds" of items have approximatelly the same chance to drop. For example, 2 handed weapons (ALL kinds of them) now have a similiar drop chance as 1 handed weapons (ALL of them except of daggers, mindstars). Similarily, daggers now have similiar drop chances as 1 handed weapons (again, all of them).

As i understand things, this addon does not modify (significantly) the drops of slain opponents, but only items on the floor. Modifying drops of enemies would be more complicated and cause other problems. To deal with that, this addon overcompensates a bit: For example, axes lying on the floor are now actually quite rare, BUT because so many enemies wield axes, that balances out overally.

WARNING / IMPORTANT / READ THIS!
==========================
This addon overwrites (overloads) most object definitions in the game. Because of this, it is not compatible with any other addon that modifies objects (unless it does so in new object categories). It also is only compatible with ToME 1.0.5 - do NOT use it with a higher version, because it will replace most items with 1.0.5 items.

Secondly, overloading object definitions for whatever reason strongly reduces ToME's performance, and can result in heavy slowdowns. Because of this, i recommend that you do not use this as an addon, but instead do the following:

1. Make a backup of ToME/game/modules/tome-1.0.5-nomusic.team (it might be called different, if you're using the version with music).
2. Rename tome-1.0.5-nomusic.team to tome-1.0.5-nomusic.team.zip (append .zip to it)
3. Now extract the the addon zip file somewhere.
4. Add the contents inside the "overload"-directory (so, the data-dir) into the tome game archive, overwriting.
5. Remove the zip-extension again from tome-1.0.5-nomusic.team

If instead you want to use this as a normal addon, and think your machine can handle it, then just remove the zip extension from the addon file, and put it into tome/game/addons/

_________________________________

Technical stuff:
Overloads most files in data/general/objects/

Re: Rebalanced item drop chances

Posted: Wed Nov 20, 2013 4:32 am
by Zizzo
lyx wrote:Secondly, overloading object definitions for whatever reason strongly reduces ToME's performance, and can result in heavy slowdowns.
Yeah, that's bit me before. The usual way around that is to use the Entity:loadList hook instead. In particular, it looks like you're just changing the 'rarity' field in some objects; your hook function could look for certain filenames and walk the freshy loaded entity list to find the objects whose rarity it wants to munge.

Re: Rebalanced item drop chances

Posted: Wed Nov 20, 2013 5:28 am
by Doctornull
Huh, cool stuff.

I wonder if it'd be possible to look at monster rarity, figure out what items will be "common" in a given area, and then adjust floor item rarity based on what the monsters DON'T have.

Re: Rebalanced item drop chances

Posted: Thu Nov 21, 2013 7:57 am
by lyx
The usual way around that is to use the Entity:loadList hook instead. In particular, it looks like you're just changing the 'rarity' field in some objects; your hook function could look for certain filenames and walk the freshy loaded entity list to find the objects whose rarity it wants to munge.
Thank you for the pointer. I'm not that familiar with ToME's hook and superload system, and the luaDocs don't really make it easy to get an overview of the architecture of TE, and where stuff is defined (doesn't even have a search function). Thus, so far i've been limited to overloading, and via intuition and heuristics guess how stuff works.

I currently have my hands a bit full RL, but will look up Entity:loadList and try to understand how it works.

And yes, the addon only modifies rarity fields, nothing else. In most files, only that single one codeline is changed. Things like bows and arrows have two lines changed in their file, because launcher and ammunition is defined in the same file (BTW: It is true what some observed: ammunition in vanilla ToME is set to be quite rare. Changed that as well).

Re: Rebalanced item drop chances

Posted: Thu Nov 21, 2013 8:05 am
by lyx
Doctornull wrote:I wonder if it'd be possible to look at monster rarity, figure out what items will be "common" in a given area, and then adjust floor item rarity based on what the monsters DON'T have.
Yeah, but a technically more clean solution, would be to hack the solvers: Whenever a non-unique enemy item is to be dropped, make it by 30% chance drop the enemy's equipment item, and 70% chance to drop a random item (rarity values apply). Then, remove the overcompensations (like the rare axes thing).

This would make drops in a zone still be biased towards the kinds of enemies there, but still ensure plenty of other types of items - which IMO is closer to what a player would intuitively expect.

Heck, maybe such a mechanic is actually somewhere in there, and only the chance values need to be tweaked - but figuring this out to me is like looking for the needle in the haystack.

Sadly, hacking solvers is way over my head.