Tuesday, April 5, 2011

Super duper automated character creation

So, I made this like three years ago: Labyrinth Lord Character Generator

I had pretty much left it as-is until now because, hey, it worked fine and I didn't really use it anymore. Then, I saw this thread on Dragonsfoot...apparently, someone took the program I wrote and made a B/X character generator. At first I thought, kickass, maybe he cleaned up all the cruft and made it snazzy looking. No such luck. Basically, from what I can tell looking through the code, he simply made my giant OO mess into a much nicer mess. Not even a nicer interface. Kind of annoying, as I wanted to redo the whole thing, basing it off something better. (Also, it's rather irritating that he's asking for donations when 95% of the code he's using is mine. I did release it under the BSD license, but geeze, it just rubs me the wrong way)

Still, I was inspired now...if I decided to recode the chargen, why not do it right? Implement all the features I initially wanted (portraits, character database, direct editing of characters, all of that) and make it a stand alone, platform independent program. Well, the only thing that might possibly work would be Java. And I don't know Java worth a shit, especially not the GUI programming part.

The past three days I took a crash course in Swing and some of the data handling aspects of Java. After fooling around with it for a while, I figured out the relevant bits I needed to know to code this up. Thankfully, Java's syntax is C-like, which means I can pretty much port over all my data structures and algorithms with minimal editing. Some of that stuff was a bitch to figure out; what seems insanely simple for a human can sometimes be nearly impossible to code on a computer. So much for computers being superior, right? Anyway, at least now I have a project to work on, something that'll be fun and hopefully useful to other people.

When I code the character generator this time, I'm definitely going to use text-based data files for things like spell lists, hit dice, experience, custom classes, etc. Anything that a user might want to edit, I'll put that in a text file, read when the program loads. This will not only make it easy for me to cut-n-paste crap, but it also means if anyone wants to tailor the program to give thieves slightly better attacks or clerics worse saving throws, they should be able to do so with minimal effort. I still gotta figure out how to embed SQLite into my project for saving data...it's trivial in PHP, but Java seems to have about 50 different implementations for database drivers. Maybe I'll stick with flat text files for saves. Who knows?

Anyway, if you read this and have some suggestions for features, lemme know. Hopefully I can crank out the basic generator fairly quickly.

Yes, the image below is programming related.


2 comments:

  1. I've used that sheet to spit out taverns full of potential retainers. Didn't know it was yours! Thanks.

    Wish I could help, but I've been out of the Sun/Open Source world for a decade. The evil overlord paid the bills better. :(

    And of course they are programming related. Somebody had to code all those . . . vertices. :)

    - Ark

    ReplyDelete
  2. The DOA series has the best...physics of any game I've ever seen. The character models react extremely realistically. Especially for the volleyball game. I'm a researcher.

    Anyway, I'm only going the Java route because, A) Free tools, B) It'll run on any system and a web applet is trivial to make, C) Not everyone has access to the internet 24/7. Like I said, I have little experience with Java, but I don't think it'll be too rough.

    ReplyDelete