Author Topic: Combine quality considerations.  (Read 644 times)

Aensor

  • Traveller
  • *
  • Posts: 36
    • View Profile
Combine quality considerations.
« on: February 17, 2014, 07:24:47 am »
Greetings!

As calculation of results in a combine step will soon take the qualities of all ingredients of such combine into account i want to collect your thoughts and ideas on issues that might arise on this change. I personally welcome this, it adds some issues though and im not sure what would be the best way to come by them. Maybe you have some thoughts or ideas.

The main issue i am concerned about is the aviability of a variety of ingredients which are restricted to low quality.
  • Animal parts are currently restricted to have q50
  • Plenty of Alchemy, Herbal and Cooking ingredients are currently aviably ony at NPC Merchants in q50

Obviously a fix would be to allow high quality animal parts to be looted aswell as allowing various ingredients to be craftable off collected base materials - however until this is implemented, how could it be solved?

What came to my mind first, which would maybe be feasible anyway for better control of transforms but is not at all supported by the current system would be to allow to set values for the influence of an ingredient on the quality of the combine. This way one could set the currently not craftable ingredients to have low influence.

Example: Combining a Chain Mail Helm with a Set of steel bands - It would make sense that the steel bands have less effect on the overall quality than the Full chain mail helm.
Another obvious example: Adding common herbs in really good water should probably not result in a superior tea.

However this might be reserved for future considerations, solutions that can be easily added with low efforts should be discussed

Some ideas:
  • Add some Ingredients for high prices in better quality
  • Add an NPC that trades those items for similar quality i.e. "Give 3 Hop in q123 - get 6 Flour in q123" or "Give 1 Maulber Hide in q50 - get 1 Tefu Hide in q200"
  • ...

Any thoughts or ideas?

Bonifarzia

  • Hydlaa Notable
  • *
  • Posts: 718
    • View Profile
Re: Combine quality considerations.
« Reply #1 on: February 17, 2014, 08:06:55 am »
What about a weighted average based on the ingredient values?
Code: [Select]
quality_combined = sum_i(quality_i * price_i) / sum_i(price_i)

Aensor

  • Traveller
  • *
  • Posts: 36
    • View Profile
Re: Combine quality considerations.
« Reply #2 on: February 17, 2014, 09:24:21 am »
I like this idea. Using the value, or better the base value (without quality adjusted price) of an item to weigth could work as it is easily aviable to evaluate in the calculation step in workmanager. You would have to adjust some prices which might have sideffects though, but maybe thats even feasible I.E. in alchemy some ingredients crafted from expensive ingots become really low value.

It would be really easy to implement with just a few lines as youd just have to expand the qualities by its item's value and normalize it at the end with the totalValue of the parts. For the current mathscript on trunk There is factored in a deviation of min/max qualities involved which is discarded in the following lines.



Slightly modified part from workmanager IsContainerCombinable(...) where the combine result is being prepared and the mathscript executed:
Code: [Select]
    // Load item array from the conatiner
    csArray<psItem*> itemArray;
    gemContainer::psContainerIterator it(container);
    currentQuality = 1.00;
    float minQuality = 300.0;
    float maxQuality = 0.0;
    float totalQuality = 0.0;
    float totalValue = 0.0;
    while(it.HasNext())
    {
        // Only check the stuff that player owns or is public
        psItem* item = it.Next();
        if((item->GetGuardingCharacterID() == owner->GetPID())
                || (item->GetGuardingCharacterID() == 0))
        {
            itemArray.Push(item);

            // Calculate total value
            float value = item->GetItemBaseValue(); // Kind of Getter for base_stats->GetPrice().GetTotal() or something.
            totalValue += value;
        }
    }
   for (size_t i = 0; i < itemArray.GetSize(); i++)
   {
           
            // Weight Quality here:
            float quality = item->GetItemQuality() * item->GetItemBaseValue();
            /* Not sure about how to imbue it into the min/max quality rules.
            if(minQuality > quality)
            {
                minQuality = quality;
            }
            if(maxQuality < quality)
            {
                maxQuality = quality;
            } */
            totalQuality += quality;
    }
    // Normalize after sumin up:
    totalQuality /= totalValue;
   


Sajut

  • Traveller
  • *
  • Posts: 36
    • View Profile
Re: Combine quality considerations.
« Reply #3 on: February 18, 2014, 01:15:11 pm »
My idea is that NPC's sell the items/ingredients players sold him + a generated number of items with random quality, especially for items that can't be crafted or only looted with Q50.
So you can sell your crafted ingredients and another player can craft high quality items with them. This is already possible without an NPC, but its hard to meet the right people at the right time, especially when the players live in different time zones.
Another pro would be that you can buy the items needed for questing,  e. g. the hides for the golden ring.
« Last Edit: February 18, 2014, 01:37:03 pm by Sajut »

Pakarro

  • Hydlaa Resident
  • *
  • Posts: 119
  • My kind mistress is Pakerl from "The Family"
    • View Profile
    • meet Pakerl
Re: Combine quality considerations.
« Reply #4 on: February 19, 2014, 03:01:59 am »
Sajut, I do not agree. The way it is, players are encouraged to interact (e.g. to obtain tefu hides, which no one can obtain him/her/kra-self when needed). To take out this element from the game would take away a very special feature (!not a bug!) of the game.

Just my 2 tria...
Glad to meet you :)

Sajut

  • Traveller
  • *
  • Posts: 36
    • View Profile
Re: Combine quality considerations.
« Reply #5 on: February 19, 2014, 03:19:58 am »
i know that, but its very hard to find a hunter when there are only 40-60 players online (and half of them are busy with roleplaying). You can close the store when more players are online and the interaction is not anymore a frustrating feature ;) Another point is that an NPC's sells items with an addition of 20% so its much more cheaper to buy from Players.

Eonwind

  • Developers
  • Hydlaa Notable
  • *
  • Posts: 815
    • View Profile
Re: Combine quality considerations.
« Reply #6 on: February 20, 2014, 10:16:58 am »
Many intermediate items prices have been made lower than their actual value on purpose, this way we want to encourage crafting the final items (which can in turn be sold to other players too) instead of producing the same intermidiate item only to rank up. Adjusting them is no small feat, it means calculating hundreds of prices.

While we were discussing internally the new mathscript a question has risen: should we factor in a random factor or would you favor having predictable results?

Sadie

  • Hydlaa Resident
  • *
  • Posts: 115
    • View Profile
Re: Combine quality considerations.
« Reply #7 on: February 20, 2014, 10:27:14 am »
Predictable, please!

 :sorcerer:
my name is Sanrai ;)

Calmus

  • Traveller
  • *
  • Posts: 29
    • View Profile
Re: Combine quality considerations.
« Reply #8 on: February 20, 2014, 01:00:38 pm »
Predictable, please!

 :sorcerer:

Wouldn't it be a bit boring if crafting only depends on the skill level and on base item quality? Another issue might be that crafters who are not a master in their certain skill might also like to sell their items to other (non-NPC) people sometimes. Crafters who are not nearly masters in their skill will have a disadvantage, if there is no luck factor in the calculations.

Aensor

  • Traveller
  • *
  • Posts: 36
    • View Profile
Re: Combine quality considerations.
« Reply #9 on: February 20, 2014, 01:31:36 pm »
Imho some rnd is fine BUT make it become less deviation the higher the skill - up to a very reliable amount because this encourages becoming master in a proffession,  while still allowing nice results for lower levels.

If you add rng, it should not be only lowering the quality but also shouldnt de/increase quality as much as the real processing.

How was your consensus on items only aviable in q50 in your internal discussion?

Bonifarzia

  • Hydlaa Notable
  • *
  • Posts: 718
    • View Profile
Re: Combine quality considerations.
« Reply #10 on: February 20, 2014, 03:51:07 pm »
Wouldn't it be a bit boring if crafting only depends on the skill level and on base item quality? Another issue might be that crafters who are not a master in their certain skill might also like to sell their items to other (non-NPC) people sometimes. Crafters who are not nearly masters in their skill will have a disadvantage, if there is no luck factor in the calculations.
I think Eonwind referred to the combine step only. And as far as i understood, each transformation has a certain skill range, so training beyond the corresponding limit will have no advantage for a given crafting step.

I agree that value weighted averages make little sense if NPC sold ingredients have higher base prices than intermediate items, and reassigning prices is pointless.
I admit I have not looked at the actual code on SVN, and you probably already came up with a good solution. Otherwise one could give less weight to low quality components in a "simple" way, maybe taking the root mean square? E.g. sqrt( (50^2 + 300^2)/2 )  ~ 215

Aensor

  • Traveller
  • *
  • Posts: 36
    • View Profile
Re: Combine quality considerations.
« Reply #11 on: February 20, 2014, 04:08:59 pm »
I admit I have not looked at the actual code on SVN, and you probably already came up with a good solution. Otherwise one could give less weight to low quality components in a "simple" way, maybe taking the root mean square? E.g. sqrt( (50^2 + 300^2)/2 )  ~ 215
This would just make low quality a better quality?

The main problem is - combine result quality does not get calculated reciepe-specific. All combinations calculate on the same formula.
1. Check if there is a valid combine possible with items in container owned by you, else break.
2. calculate quality by sum of qualities divided by itemcount (and some min q/max q difference factored in).

It does not differ if you make some potion or some sword in the quality calculation and implementing this needs some major changes in DB layout for combines and overhauled quality calculation functions.

Imho it would be worth implementing this functionality, especially for the future where you might want to have more control in that section - it might still be quite low on the priority list compared to other additions so an intermediate easy-to-implement solution that doesnt need alot of testing and touching of already set values would be feasible.

bilbous

  • Guest
Re: Combine quality considerations.
« Reply #12 on: February 20, 2014, 04:25:37 pm »
Wouldn't it be easier to just randomize critter drop quality and have npcs sell a variety of quality stuff?

Tuathanach

  • Associate Developer
  • Hydlaa Citizen
  • *
  • Posts: 206
  • Arch Chancellor of the Knowledge Seekers
    • View Profile
    • Knowledge seekers
Re: Combine quality considerations.
« Reply #13 on: February 20, 2014, 04:31:12 pm »
Imho some rnd is fine BUT make it become less deviation the higher the skill - up to a very reliable amount because this encourages becoming master in a proffession,  while still allowing nice results for lower levels.

If you add rng, it should not be only lowering the quality but also shouldnt de/increase quality as much as the real processing.

I like the idea of reducing random factor as skill increases, not sure how easy (or possible) it will be to implement but worth looking at imo.
« Last Edit: February 21, 2014, 05:09:13 am by Tuathanach »
Shindroks Crater Project Wiki
Interested contact Myself or Zunna.
We are contactable ingame, by PM or on Discord

apyj13

  • Traveller
  • *
  • Posts: 26
    • View Profile
Re: Combine quality considerations.
« Reply #14 on: February 20, 2014, 05:27:18 pm »
Wouldn't it be easier to just randomize critter drop quality and have npcs sell a variety of quality stuff?

I wouldn't be opposed to this, but I would hope that the critter drop q is a little more limited than harvesting and mining are right now so it's not every value between 50-300 (perhaps limit quality it to every 25 or 50 q points).  Having to manually stack things in your inventory when you are mining or keeping multiple stacks is annoying enough when you're mining one thing, but if you start doing that with multiple animal parts while hunting, inventory management is going to turn into a nightmare.

Also like the idea of reducing randomness as skill increases.  I'm not sure if you could do this on a per item basis, or if it's already set up this way. 

Example:  Making leather gloves is easy but making a chain mail torso is hard, and making leather gloves will be "mastered" much earlier than making a chain mail torso so the script should take into account at what skill level each item is considered "mastered" and have the lowest randomness assigned at the "mastery level" for that item.  So say you can master leather gloves at 20 levels of armor making, then the lowest random variable will be assigned around level 20 for leather gloves, but say you need 80 levels to master chain mail torso, then the lowest random variable will be assigned around level 80 for chain mail torso.  If two skills are needed in a step to make something, the random variable should be averaged between the two skills needed, or possibly slightly weighted toward the primary skill.