Wuxia Action System roll and strange Troll behavior

Wuxia Action System roll and strange Troll behavior

Return to topic list

Wed May 4 05:09:05 2016   by   Amaral
I have been trying to program in The Wuxia Action System roll for the Legends of the Wulin game by EOS Press. 
So, I managed to get Troll to output the correct roll collection with the following code:

\ Legends of the Wulin's Wuxia Action System roll

lakeSize:=7; \ Set this to your lake size, that is, 5 for unranked, 6 for rank 5. 7 for rank 4, and so on.
lake:=(lakeSize)z9;
result:=foreach faceValue in (different lake) do result:=(result U {10*(count (faceValue=lake))+faceValue});
result

However, when I try to change the last line from "result" to "max result", instead of a singleton collection with the largest result, I get... well, the same result again, as if ignoring the max keyword. Changing the last line again to "count result" gives me a collection of 1s with a count of (count different lake). Seems like instead of initializing result to an empty set and increasing it for every different value in the lake, it's adding the latest calculated value to an empty results set and outputting it within the foreach loop. How should I go about changing that code so that, at the end of the foreach loop, I have a collection I can further process? I'd need it to calculate a bunch of relevant statistics for that game, such as the probability distribution for the highest-valued set, second-highest-valued set, probability of having more than one value of 20 or more in the roll, and so on.
 
Wed May 4 09:15:41 2016   by   Torben
The problem is that you treat := as an updating assingment, which it is not.  It is a declaration of a local variable.

I don't know the Wuxia system, but you seem to want, for each different value in the lake, take ten times the number of dice with that value and then add the value itself, and then collect all of these sums, finally taking the maximum.

To do that, change the last two lines to

result:=foreach faceValue in (different lake) do 10*(count(faceValue=lake))+faceValue;
max result


The online version of Troll can calculate probabilities for lake sizes up to 6, but times out with lake size 7.  You can use the offline version for larger lakes.
 
Wed May 4 15:57:01 2016   by   Ron Vantreese
Just commenting on a few things... I think Wuxia is a genre of TV/Movies that are Kung Fu types. I'm thinking of Bruce Lee and Jackie Chan from the 1970s. So it sounds like a development of a game involving Kung Fu warriors. Or possibly a merge of D&D and Wuxia?

 
Thu May 5 22:50:01 2016   by   Amaral
Ok, while that was unexpected, knowing that it's creating a new variable is going to make it a lot easier to program going forward. I wasn't able to understand this behavior from reading the manual.

Yes, the "lake" is the system's name for your character's dice pool, and when you roll, you split your dice into sets with the same face value, and pick one of them as the result; the number of dice in the set is the tens, and the face values is the ones. Unused sets of two dice or more can be used for extra actions in a round, or stored away (in your "river") for use in some subsequent roll or to power some of the more esoteric kung fu. This is why just knowing the max result statistics won't do. I'll end up doing statistics on the second-highest result, the odds of having two or three or four or five results over twenty (which might power secondary actions), etc. It's a very interesting, if somewhat rococo, system.

@Ron:It's a game system which is supposed to model the wuxia genre of chinese literature. While Bruce Lee et al.'s movies are often called wuxia, this game models stuff like the movies "Hero", "House of Flying Daggers", and "Crouching Tiger, Hidden Dragon", which by the way is based on the fourth book of a pentalogy written between 1938 and 1942. While I won't deny some influence by D&D on the system's authors, the setting is based on a large corpus of literature with its own tropes. If you're interested in knowing more, TVTropes's Main/Wuxia article explains it better and more succintly than I ever could.

The system itself was originally developed for a tie-in RPG for a taiwanese comic book series titled "Weapons of the Gods", with gods and demons and other in-your-face supernatural elements. This version was a reboot with the serial numbers filed off, closer to generic than any specific franchise. However, it seems that the publisher EOS Press went under, so I'm not expecting any splatbooks.

 
Fri May 6 04:42:36 2016   by   Ron Vantreese
Thanks for more explanation about it. So Wuxia is literature-based. I encountered a bit of info about Wuxia in the past but didn't pay attention too closely to it. I used to watch Bruce Lee shows when I was young. And I liked CTHD with Michelle Yeoh and Zhang Ziyi.

The Troll program looks tempting to write an interface for it, but unfortunately I don't understand troll code enough to take on this task. :( If I did, I can get access to a random generator that's based on hardware noise and not on any pseudo algorithm.
 

Return to topic list



New message:
Topic:
Posted by:

Type the values of the dice shown below:

Return to topic list