DiceNotation: roll some dice in C#

So, in building out Anaeax1, I needed a way to express random quantities for game systems: weapon damage, level-up effects, so on and so forth. Code is one thing, but the game uses SheetParser to maintain tabular lists of weapons, monsters, and so on and so forth—I don’t exactly want to be defining this stuff in a C# file, no matter how easy Exor makes it (and it is pretty easy).

I play tabletop games. Dice make sense to me; I have an OK understanding of the sorts of distributions you can put together from them and they’re at least reasonably intuitive for most people. So my first inclination was to go write a dice parser, something that could turn 3d6+10 into a usable range. But why build when you can steal, etcetera etcetera, and I found an abandoned project on CodePlex (with tests, even!) that I could bend to fit my needs, PCL and MathNet compatibility among them. The resulting fork of DiceNotation is on GitHub and NuGet (with the MathNet integration in a separate package).

While this is going to be used in the game, it’s also going to be used for something else: doing statistical analysis for game balance in Excel. Which means I get to learn how to bridge Excel and C#. Which means I need a lot more liquor.


Comments

  1. Nicholas Perry (@ultimape)

    C# and excel work very well together from my experience. There are a variety of libs out there that can do the legwork, but I found the ones that support linq integration seem to lead to the best experience.

    I decided to go with google sheets myself in the end. It was going to be too many hops to link things up to a website backend and I found sheet’s scraping api to be easy since I already knew XPath.

    I’d love to know what you ended up using.

    Reply
    • I haven’t actually gotten around to it yet. =) Other things have popped up. I’m going to want to do it directly in Excel, though – probably loading in DiceNotation through a VBA bridge or something – to properly plot stuff like damage curves versus health, that sort of thing.

      Reply

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>