Opened 4 years ago

Closed 11 months ago

#11699 closed defect (fixed)

XEEN: Element Affix distribution

Reported by: dreammaster Owned by: dreammaster
Priority: normal Component: Engine: MM: Xeen
Version: Keywords:
Cc: Game: Might and Magic: World of Xeen


Elemental Affix distribution: I only get items (loot or vendor) with the strongest elemental affixes available. According to the xeen wiki at
there are elemental affixes of various strength, but I only get scorching, cryo, noxious, kinetic, dyna etc..

Change History (5)

comment:1 by dreammaster, 4 years ago

Affix distribution of accessories is also strange: I get tons of "accelarator", "kinetic", "ego", "cryo", but nearly nothing else

comment:2 by darkstar, 4 years ago

I also noticed that recently, but I thought this to be a feature, not a bug :-D

But you're right, it should probably be checked against the original source code and the probabilities fixed

comment:3 by yarolig, 11 months ago

I played mm4 and also find that item generation is differs from original.

I trying to annotate and fix item generation code. I wanted to split renaming/annontation and actual fix in 2 commits. But failed :)

I belive this will fix distribution for random enchantments, but I have not checked it yet:

Elemental damage:

Attribute bonuses:

Last edited 11 months ago by yarolig (previous) (diff)

comment:4 by yarolig, 11 months ago

New patch!

It has 2 commits. First one is cosmetic, the second will change logic.

I hope it works and is closer to original game.

There is a good description of item generetion there in SECTION 5A - EQUIPMENT GENERATION AND PROPERTIES.

I used my common sense, game cluebook and that FAQ to change code that generate items.

The code I used to print random leveled item descriptions at start:

diff --git a/engines/mm/xeen/party.cpp b/engines/mm/xeen/party.cpp
index f9f2aac9a7c..c73b8b1c00d 100644
--- a/engines/mm/xeen/party.cpp
+++ b/engines/mm/xeen/party.cpp
@@ -118,6 +118,30 @@ void BlacksmithWares::regenerate() {
        // Clear existing blacksmith wares

+       // test makeItem
+       debug("== test makeItem  ==");
+       for (int level=1;level<8;level++) {
+               debug("== LEVEL %d ==", level);
+               for (int i=0;i<100;i++) {
+                       Character ch;
+                       ItemCategory itemCat = ch.makeItem(level, 0, 0);
+                       XeenItem &item = ch._items[itemCat][0];
+                       Common::String s;
+                       Common::String details = ch._items[itemCat].getIdentifiedDetails(0);
+                       Common::String desc = ch._items[itemCat].getFullDescription(0);
+                       Common::String str = Common::String::format(Res.IDENTIFY_ITEM_MSG,
+                           desc.c_str(), details.c_str());
+                       debug("L%d-cat=%d-id=%d-mat=%d-------------------------------\n%s\n", level, itemCat, item._id, item._material, str.c_str());
+               }
+       }
        // Wares setup for Clouds of Xeen
        for (int slotNum = 0; slotNum < 4; ++slotNum) {
                Common::fill(&catCount[0], &catCount[4], 0);

comment:5 by dreammaster, 11 months ago

Owner: set to dreammaster
Resolution: fixed
Status: newclosed

Thanks for the PR. Merged in.

Note: See TracTickets for help on using tickets.