Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept multiple IDs in loot #3280

Open
ghost opened this issue Jan 20, 2021 · 7 comments
Open

Accept multiple IDs in loot #3280

ghost opened this issue Jan 20, 2021 · 7 comments
Labels
enhancement Increase or improvement in quality, value, or extent

Comments

@ghost
Copy link

ghost commented Jan 20, 2021

This is kinda trivial, but bothered me for years already, right now I can only remember giant shimmering pearl needing a change like this, but there may be others and also it open doors for small customizations.

Current Situation

There are monsters that drop giant shimmering pearl, but they have two colors, thus two IDs, they share the same chance (?), currently our code is like this:

<item id="7632" chance="4450" /><!-- giant shimmering pearl -->
<item id="7633" chance="4450" /><!-- giant shimmering pearl -->

My Proposal

We could use something like this instead:
<item id="7632;7633" chance="4450" /><!-- giant shimmering pearl -->

(using ; or , I don't know, up to decision)

And also maybe put a safe limit of items in the array

@ghost ghost added the enhancement Increase or improvement in quality, value, or extent label Jan 20, 2021
@MillhioreBT
Copy link
Contributor

It looks good, although my opinion is irrelevant, because I no longer use the monster system through xml
Despite this detail, personally I do not like the mechanics of using ;, and although the benefit is to reduce a couple of lines in each xml file, I do not see a reason to improve this, anyway in the future not we will use this

@marmichalski
Copy link
Contributor

Something similar has received negative feedback from @DSpeichert, IIRC. 🤔

@DSpeichert
Copy link
Member

DSpeichert commented Jan 24, 2021

Indeed, you're mixing custom format (semicolon delimited list) with XML.
A proper XML style would be:

<item-select chance="4450">
  <item id="7632" count="2" chance="80" />
  <item id="7633" count="3" />
</item-select>

Where you have 4450 chance to get one of the items, and then you get 80% chance to get 2x 7632 or else you get 3x 7633.
I'm not sure if that is useful but technically that is more proper XML.

Keep in mind that the nested "chance" is still "select 1 out of N", it's just weighted select. In other words, those are not independent lotteries like current loot items, this nested lottery is one skewed lottery.

@MillhioreBT
Copy link
Contributor

MillhioreBT commented Jan 25, 2021

@DSpeichert suggestion looks quite elegant and conforms to XML format, I don't know to what extent it may be necessary, but I like it ;)

@andremiles1
Copy link
Contributor

Indeed, you're mixing custom format (semicolon delimited list) with XML.
A proper XML style would be:

<item-select chance="4450">
  <item id="7632" count="2" chance="80" />
  <item id="7633" count="3" />
</item-select>

Where you have 4450 chance to get one of the items, and then you get 80% chance to get 2x 7632 or else you get 3x 7633.
I'm not sure if that is useful but technically that is more proper XML.

Keep in mind that the nested "chance" is still "select 1 out of N", it's just weighted select. In other words, those are not independent lotteries like current loot items, this nested lottery is one skewed lottery.

This is good, but defies the purpose of the proposed changes, which is to reduce lines. Also, there's no case on original Tibia which you loot one item or else another item, like you suggested. It's a nice idea but it's more like a custom thing than a necessary one.

@DSpeichert
Copy link
Member

defies the purpose of the proposed changes, which is to reduce lines

Then XML is simply not the way to go. It's a machine format, not human format.

Also, there's no case on original Tibia which you loot one item or else another item, like you suggested.

Probably right but we also can't know for sure, can we? I interpret @EPuncker's original issue as having a shared chance for either of two colors of the pearl.

@ghost
Copy link
Author

ghost commented Apr 17, 2021

defies the purpose of the proposed changes, which is to reduce lines

Then XML is simply not the way to go. It's a machine format, not human format.

Also, there's no case on original Tibia which you loot one item or else another item, like you suggested.

Probably right but we also can't know for sure, can we? I interpret @EPuncker's original issue as having a shared chance for either of two colors of the pearl.

actually now that they implemented the bestiary feature we can know what creature drop, this issue is no longer needed (for my initial intention) and can be closed if you want, there is no longer such thing as a monster dropping 2 different items with shared chance

@ghost ghost changed the title Accept multiple IDs on loot Accept multiple IDs in loot Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Increase or improvement in quality, value, or extent
Projects
None yet
Development

No branches or pull requests

4 participants