Sunday, February 03, 2013

"He was waiting for something to develop, and WHAP. He got developed."

I've pretty much shelved the SVG game project thing. I didn't have much time for it (or much of anything really), and I don't like the general direction Web specifications are going.

For now, I've turned toward C++11 and Qt development. To pay tribute (or a complete lack of attention) to a certain football game that's going on at the moment, I made a fantasy-game character equipment generator that makes randomly-named and enchanted equipment like so:

A window with a tree of named pieces of armor and weapons on the left and a description of a mage's hat on the right.

Here are links to Dropbox of 7-zip archives of my regular expression-based text generator library's source and my equipment generator's source. (Regex-based generators have been made before, but the one here is my own work.) Once compiled, they and applicable Qt and system libraries should be in the same directory or at least each other's PATH so you can run the generator and it can use the library to make the names.

The pieces of equipment don't do much on their own, but I have a rudimentary, unfinished framework there to apply equipment-type-based and additional enchantments and to call them in a function. I'm a bit iffy about tethering myself to any framework (let alone one that wants to turn its focus toward snazzy tablet UIs, given the sheer user-hostility of Windows 8), so I make a bunch of likely-expensive casts between the C++ Standard Library types and Qt types. (I love the ad-hoc vectorasync threadpool I made in mainwindow.cpp.) It works on Qt 4.8.4 (the version on Arch Linux as of post time) and on Qt 5.0.0 and 5.0.1 on Windows. It seems to run slower and generally more strangely on 5.0.1.

Speaking of standard library types, I'm quite thankful for the enlightening pages of cppreference.com.

Enjoy the generator! Maybe I'll improve it or make it a full-blown game at some point, but for now have fun with all the strange names you draw from the vast pockets of the RNG.

Labels: , ,