Shandalar - Feature Requests
Redesign card pricing formulae (reviewed)
base_sell_price() in src/shandalar/replace_functions() controls sale price in the deckbuilder (player selling cards in a town). There's a somewhat less up-to-date but more legible-to-nonprogrammers version here. Examining card_rating_impl() in src/shandalar/ai.cpp might be a good start for ideas, and the AI Base Value column in manalink.csv should definitely be included.
I'm not yet certain where the price for buying cards from a town, or from a Nomad's Bazaar lair, are.
I'm not yet certain where the price for buying cards from a town, or from a Nomad's Bazaar lair, are.
Comments
Posted by quatrocentos-e-vinte » 04 Jun 2015, 09:14
It's good that you've put this up.
I'm interested in working on this, unless someone else is already working on it. Everyone knows the card pricing scheme of Shandalar was always bonkers... but seeing the pseudocode is just... wow.
Reading it goes a bit like this...
Anyway... I've made a preliminary analysis of 'AI Base Value' and it does seem to be helpful in determining reasonable "card value" estimates. I'll post something in the forum soon about it...
I have two questions, though:
1) Would it be possible to implement the card pricing via lookup of a .csv file, rather than calculating (and recalculating?) them at runtime? Like having a ShandalarCosts.csv (so as not to overload Manalink.csv even more).
I am only asking this because it would allow more complex pricing schemes (e.g. based on the conditional empirical distributions of stuff like "AI Base Value") without performance penalties AND it would allow non-programmers (or people who suck at C) to mod this part of the game more easily (imagine if the original programmers decided to hardcode the character decks in their binaries... it would have made all that fun people had making deckpacks almost impossible without the help of coding gurus such as Mok and you; same for the gfx).
2) Regardless of whether the answer to my previous question is "yes" or "no", would it be possible (at some point) for you to run the original Shandalar cost calculation function on every card on Manalink.csv (or, at least, every Shandalar card) and provide it as a csv (or similar) file? That would be incredibly helpful.
Thanks for your time and effort
EDIT: here is an incredibly useful resource to help solve the "Shandalar card costs" problem. Nothing like using real data on real MTG cards to deduce a reasonable pricing scheme for virtual ones
I'm interested in working on this, unless someone else is already working on it. Everyone knows the card pricing scheme of Shandalar was always bonkers... but seeing the pseudocode is just... wow.
Reading it goes a bit like this...

- Code: Select all
if (creature has plainswalk, mountainwalk, forestwalk, islandwalk, and/or swampwalk)
value = value * 1.5;
hmm.. ok...
- Code: Select all
if (creature can activate to pump its own power)
value = value * 3;
ah.. now everything is clear... Dragon Engine, how I have misunderstood you...
- Code: Select all
if (creature can activate to pump its own toughness)
value = value * 3;
uh... i don't know what to say...
- Code: Select all
value = 25 + 25*(creature_rating_mod + converted_mana_cost);
wat. i should enjoy paying more mana for a card?
- Code: Select all
if (card is activateable)
value = value * 2;
oh. now I see why Blessing is totally the shit lol
Anyway... I've made a preliminary analysis of 'AI Base Value' and it does seem to be helpful in determining reasonable "card value" estimates. I'll post something in the forum soon about it...
I have two questions, though:
1) Would it be possible to implement the card pricing via lookup of a .csv file, rather than calculating (and recalculating?) them at runtime? Like having a ShandalarCosts.csv (so as not to overload Manalink.csv even more).
I am only asking this because it would allow more complex pricing schemes (e.g. based on the conditional empirical distributions of stuff like "AI Base Value") without performance penalties AND it would allow non-programmers (or people who suck at C) to mod this part of the game more easily (imagine if the original programmers decided to hardcode the character decks in their binaries... it would have made all that fun people had making deckpacks almost impossible without the help of coding gurus such as Mok and you; same for the gfx).
2) Regardless of whether the answer to my previous question is "yes" or "no", would it be possible (at some point) for you to run the original Shandalar cost calculation function on every card on Manalink.csv (or, at least, every Shandalar card) and provide it as a csv (or similar) file? That would be incredibly helpful.
Thanks for your time and effort

EDIT: here is an incredibly useful resource to help solve the "Shandalar card costs" problem. Nothing like using real data on real MTG cards to deduce a reasonable pricing scheme for virtual ones

Last edited by quatrocentos-e-vinte on 04 Jun 2015, 09:38, edited 1 time in total.
Posted by Korath » 04 Jun 2015, 15:54
commit fac8294ebbc1a111450fc63528c5627262629f54
Author: Korath <dgk@Dirge.none>
Date: Thu Jun 4 11:53:34 2015 -0400
[Shandalar] #561: --show-prices command-line option to write prices.csv
Author: Korath <dgk@Dirge.none>
Date: Thu Jun 4 11:53:34 2015 -0400
[Shandalar] #561: --show-prices command-line option to write prices.csv
Posted by Korath » 04 Jun 2015, 15:59
1: Yup.
2: For ct_all.csv, not Manalink.csv, yes, to some approximation; there's one piece of data - whether a card is a vanilla creature - that can't be determined accurately until the card actually exists in Shandalar. (And if and when the pricing function starts taking new abilities and so on into account, it'll get inaccurate enough that we'll have to restrict it to cards in Shandalar.)
Output attached, including a column for whether the card's marked vanilla or not. Being non-vanilla increases the price by half.
Prices get further modified after being processed by this function; I think it's whether you're selling in a city as opposed to a village, and how closely the card's color matches the city's. But this should be accurate as far as relative values go.
2: For ct_all.csv, not Manalink.csv, yes, to some approximation; there's one piece of data - whether a card is a vanilla creature - that can't be determined accurately until the card actually exists in Shandalar. (And if and when the pricing function starts taking new abilities and so on into account, it'll get inaccurate enough that we'll have to restrict it to cards in Shandalar.)
Output attached, including a column for whether the card's marked vanilla or not. Being non-vanilla increases the price by half.
Prices get further modified after being processed by this function; I think it's whether you're selling in a city as opposed to a village, and how closely the card's color matches the city's. But this should be accurate as far as relative values go.
- Attachments
-
prices.zip
- (120.69 KiB) Downloaded 264 times
Posted by quatrocentos-e-vinte » 04 Jun 2015, 21:48
Thanks, that's great. I still have to try to understand the relation between that file and Manalink.csv (it's not 100% clear to me).
Anyway, in the meantime, here's a possible (proof-of-concept) fix for Shandalar card prices while still preserving as much as possible the distributional properties of the original pricing scheme. The fix is based on using the AI Base Value information, which seems to be (apart from corner cases like dual lands and other mana producers) mostly a good indicator of "card value" or "card playability".
Interestingly enough, even the original pricing scheme seems to display some level of correlation with AI Base Value (so maybe the original pricing scheme wasn't so bad after all?
). As you can see, though, the new pricing scheme follows AI Base Value much more accurately, while still maintaining some level of similarity with the original pricing scheme.



Anyway, in the meantime, here's a possible (proof-of-concept) fix for Shandalar card prices while still preserving as much as possible the distributional properties of the original pricing scheme. The fix is based on using the AI Base Value information, which seems to be (apart from corner cases like dual lands and other mana producers) mostly a good indicator of "card value" or "card playability".
Interestingly enough, even the original pricing scheme seems to display some level of correlation with AI Base Value (so maybe the original pricing scheme wasn't so bad after all?




- Attachments
-
newprices.zip
- test
- (160.98 KiB) Downloaded 371 times
4 Posts
• Page 1 of 1
Ticket details
- Ticket ID: 561
- Project: Shandalar
- Status: Reviewed
- Component: (unknown)
- Project version: (unknown)
- Priority: Normal
- Assigned to: (unassigned)
- Reported by: Korath
- Reporter's tickets: List all tickets
- Reported on: 26 May 2015, 20:02
- Last visited by Korath » 18 Sep 2018, 05:50.