19 Jan, 2009, quixadhal wrote in the 1st comment:
Votes: 0
This week, Ghasatta showed up for his farewell address as he heads down under to the Shire.
Davion and Asylumius also showed up to eat, drink, and something or other…
And Retnur made a welcome return too!
I believe Bleas tried to show up, but some technical difficulties kept him stuck in traffic.

We did talk shop briefly, so you can still write it off as a business lunch!

Here is the log output from 20090118.log!
Quote
19:08:06: Ghasatta says 'booo'
19:10:23: Ghasatta says 'shovelling snow? What's snow?'
19:10:46: Quixadhal throws a snowball in Ghasatta's face.
19:11:04: Ghasatta says 'here in southern california we have two seasons'
19:11:10: Ghasatta says 'summer. and summer.'
19:11:52: Quixadhal says 'we have summer, that's when it's 90% humidity and 85-95 degrees'
19:12:01: Ghasatta snickers softly.
19:12:16: Quixadhal says 'the weather here is nice for about 2 weeks a year, one for spring, one for fall.'
19:12:47: Davion gallantly tips his hat.
19:12:52: Quixadhal throws a snowball in Davion's face.
19:12:53: Ghasatta says 'howdy'
19:12:55: Davion ducks defensively.
19:12:58: Davion conjures a snowball out of the thin air and throws it at himself.
19:13:07: Davion says 'Good evenin!'
19:13:11: Quixadhal says 'howdy!'
19:13:48: Ghasatta says 'are we expecting anyone else tonight?'
19:14:01: Quixadhal says 'The Spanish Inquisition?'
19:14:15: Ghasatta says 'no one ever expects them'
19:15:14: Ghasatta says 'well this will be my last meeting for a while'
19:15:21: Ghasatta says 'I am travelling abroad for the next 6 weeks'
19:15:27: Quixadhal says 'Bleas mumbled soemthing about maybe showing up later, and Runter might show up at some point.'
19:15:36: Ghasatta nods.
19:15:37: Davion says 'Oo! Where ya goin?'
19:15:41: Ghasatta says 'New Zealand'
19:15:44: Quixadhal says 'Somewhere with snow, I hope *evil grin*'
19:15:51: Ghasatta says 'NZ and Fiji'
19:15:59: Ghasatta says 'don't think there's much snow in my immediate future ;)'
19:16:02: Quixadhal says 'Bah… you get to go to hobbit land?'
19:16:03: Davion says 'Oh wow!'
19:16:07: Davion says 'Say hi to Kiasyn :)'
19:16:17: Quixadhal says 'Be sure you call it hobbit land while you're there too… they love that.'
19:16:40: Davion says 'Call them Aussies! They love that too'
19:16:43: Ghasatta says 'hehe'
19:16:54: Ghasatta says 'oh is kiasyn in NZ?'
19:16:59: Davion nods.
19:17:11: Ghasatta says 'oh. Maybe I will let him know I'll be down there'
19:17:19: Quixadhal says 'If you really want to stump them, ask where Old Zealand is.'
19:17:35: Davion says 'Where is Old Zealand?'
19:17:58: Ghasatta says 'near denmark!'
19:18:04: Quixadhal says 'I dunno, but it must have existed at one point of we couldn't have a New one. :)'
19:18:09: Davion says 'Oh. Denmark'
19:18:22: Davion says '<3 Wikipedia :D'
19:18:25: Quixadhal says 'There's a Zeeland about 50 miles north of me, near Holland and Grand Rapids.'
19:18:27: Ghasatta says 'http://en.wikipedia.org/wiki/Zealand'
19:18:31: Davion grins evilly.
19:18:42: Quixadhal says 'They have snow too.'
19:18:52: Davion says 'You're in MI?'
19:19:00: Quixadhal sobs quietly to yourself.
19:19:10: Davion says 'Say hi to Asylumius :P'
19:19:19: Davion says 'Man, everyone is near a MB admin except me'
19:19:31: Quixadhal says 'Does he have a good snowblower? *grin*'
19:19:50: Davion says 'That bad, eh?'
19:20:48: Quixadhal says 'http://i302.photobucket.com/albums/nn96/...'
19:21:13: Davion says 'Wow'
19:21:16: Quixadhal says 'That's my car door being opened. :)'
19:23:22: Ghasatta says 'well I did have one rant…errr order of business I wanted to mention'
19:23:30: Quixadhal grins evilly.
19:23:32: Ghasatta says 'and it's the magic word, documentation!'
19:23:39: Ghasatta says 'DOCUMENTATION'
19:23:45: Quixadhal says 'Oh, you volunteered to write some, wonderful!'
19:23:47: Ghasatta says 'DOCCCCCCCCCUMENTATION'
19:23:59: Ghasatta says 'actually I wrote some extensive documentation when I redid bans'
19:24:09: Quixadhal chuckles politely.
19:24:10: Ghasatta says 'which is to say, I have written the only documentation in the codebase so far'
19:24:31: Quixadhal says 'There's some documentation the Diku people wrote, and I think the Merc people added to it….'
19:24:44: Ghasatta says 'so much of the code is poorly documented'
19:24:53: Ghasatta says 'imho'
19:24:54: Quixadhal says 'Was there another group between merc and rom? I don't recall.'
19:24:58: Ghasatta shrugs helplessly.
19:25:19: Ghasatta says 'anyhoo I think this is really the major contribution of the ban code I write'
19:25:38: Ghasatta says 'not the code itself, but the documentation. I added doxygen style explanations of every function in the header file'
19:25:43: Ghasatta says 'wrote*'
19:25:52: Quixadhal says 'The only really good documents Diku had were the building docs, and those are semi-unused now that OLC is the norm.'
19:26:00: Ghasatta says 'and comments in the implementation file where necessary to explain something tricky'
19:26:27: Davion says 'Heh. I think it's safe to say that all of the code is poorly documented ;)'
19:26:31: Quixadhal says 'doxygen… I should learn that I suppose, now that we're in C++.'
19:26:54: Ghasatta says 'and the point of all this is that we will not really improve the maintainability of the code unless we add good documentation as we modify things'
19:26:59: Quixadhal says 'Sure you dont' want troff format? I'm probably the only person you know who can write man pages by hand.'
19:27:15: Quixadhal smiles happily.
19:27:24: Ghasatta says 'well the good thing about the doxygen format is that the comments are inline and human readable'
19:27:43: Ghasatta says 'so even if you don't have doxygen-generated html pages handy, you can still look at the header file and understand it'
19:27:51: Ghasatta says 'but I just did that out of habit'
19:27:52: Quixadhal says 'yeah, I've heard it's fairly non-intrusive so that's good.'
19:28:20: Ghasatta says 'I think anyone who is going to check code into the dev branch should be strongly encouraged to document their new code'
19:28:29: Ghasatta says 'and that's all! *soapbox off*'
19:28:29: Quixadhal says 'and yes, documenting is going to become a very handy thing as we start pulling the spaghetti apart.'
19:28:40: Quixadhal grins evilly.
19:28:54: Ghasatta says 'yeah just want to make sure people are continually being encouraged to do so'
19:29:01: Davion says 'Spaghetti!? Ha. Look at smaug :P'
19:29:10: Ghasatta says 'more like Turd Ravioli'
19:29:22: Ghasatta says 'you think something is going to be good until you open it up and start poking around'
19:29:27: Ghasatta says 'and then it dawns on you'
19:29:31: Quixadhal says 'I think Smaug is a bit more like lasanga… a bit richer, and harder to get apart without breaking.'
19:29:33: Ghasatta says 'you are poking a at a turd'
19:30:43: Quixadhal says 'Envy was scary…. and Circle is almost clinical in some ways.'
19:31:27: Ghasatta says 'there's a common theme among all of them'
19:31:34: Ghasatta says 'they are very unmaintainable'
19:31:37: Quixadhal says 'I will poke at your ban code pretty soon though… I've been tinkering with my own, mostly to remember who to write classes, which is a good thing.'
19:32:08: Ghasatta nods.
19:32:12: Quixadhal says 'My surprise at how std::map works shows that I'm a C++ n00b. :)'
19:32:15: Ghasatta says 'I thoroughly tested it'
19:32:24: Davion grins evilly.
19:32:30: Davion says 'We all get that shock initially'
19:32:30: Ghasatta says 'yes and you need to wear the newbie hat and sit in the corner for that'
19:32:31: Quixadhal says 'or at least that I have perl stuck pretty deeply in my head.'
19:32:48: Ghasatta says 'I have been working on helps next'
19:32:56: Ghasatta says 'I plan to check that in, and that's all for me for a while'
19:33:19: Ghasatta says 'I think you should blow up the olc ;)'
19:33:49: Quixadhal falls down laughing.
19:34:04: Quixadhal says 'I can't type the scary perl thing I was going to punish you with.'
19:34:23: Ghasatta says 'no regexes'
19:34:24: Quixadhal says 'too many symbols need to be escaped by too many parts of tinyfugue.'
19:34:35: Quixadhal says 'Nope, not a regex. :)'
19:35:07: Quixadhal says 'I was blessing a reference to a hash of error messages into the current object so it would be a method.'
19:35:32: Quixadhal says 'yes, perl has a bless keyword :)'
19:36:02: Quixadhal says 'blowing up OLC is a good step…. at the very least I want to add more accurate help info and more user feedback when using it.'
19:36:34: Quixadhal says 'and make the prompt reflect what you're doing in OLC. :)'
19:36:50: Ghasatta says 'if I had more time I would add layered interpreters'
19:37:06: Ghasatta says 'but I don't'
19:37:08: Ghasatta sighs.
19:39:04: Quixadhal says 'that might get done to some small degree anyways'
19:39:22: Quixadhal says 'probalby not WELL done, but at least to support OLC a bit more.'
19:39:46: Ghasatta nods.
19:39:51: Ghasatta says 'go go polymorphism ;)'
19:40:10: Ghasatta says 'probably a good opportunity for you to practice your virtual functions'
19:41:41: Davion says 'Don't forget your copy constructors and virtual d'tors!'
19:42:06: Ghasatta says 'I think he had a seizure or something'
19:42:07: Ghasatta pokes you in the ribs.
19:43:23: Davion grins evilly.
19:43:33: Davion says 'Semi-afk for a sec'
19:46:01: Quixadhal says 'nope, for a change even my cat didnt' have one. :)'
19:47:13: Quixadhal says 'ah yes, good old virtual functions. Maybe I'll make all virtual functions include a line to ch_printf("Some dumbass forgot to overload this")'
19:53:21: Davion the Implementor is here.
19:53:21: Ghasatta the Implementor is here.
19:53:21: Quixadhal ares in the southern end of the temple hall in the Temple of Mota.
19:54:14: Quixadhal says 'I wonder who's knocking at the door, and why they can't get in?'
19:56:41: Asylumius gallantly tips his hat.
19:56:55: Quixadhal says 'howdy!'
19:57:02: Asylumius says 'Heya.'
19:57:11: Asylumius says 'I'll be mostly AFK as I do my homework :('
19:57:37: Quixadhal says 'You haven't convinced your prof that this IS your homework? :)'
19:58:02: Asylumius says 'Not for economics and decision making :('
19:58:07: Ghasatta burps loudly.
19:58:27: Asylumius says 'So.. how goes the C++izing?'
19:58:27: Ghasatta says 'we never make decisions. You could have a grand case study'
19:58:29: Quixadhal says 'We can claim to be AI routines you wrote to evaluate decisions by proxy.'
19:58:46: Ghasatta says 'yes, manifestations of different aspects of your consciousness'
19:58:58: Quixadhal says 'I'll get my d20, so we can exhibit complex behaviours.'
19:59:27: Quixadhal says 'hook it into a virtual stock market site, and you should be good to go for that thesis.'
20:00:45: Asylumius says 'No thesis, just lame book assignments :P'
20:00:50: Quixadhal says 'Oh, but you do need a snazzy sounding title… Amortized Risk vs Reward Scenarios in a Virtualized Economic Network.'
20:01:15: Quixadhal says 'the title is all they ever read anyways.'
20:02:26: Quixadhal says 'Ghasatta was talking about our lack of documentation and volunteering to get an army of hobbits from New Zealand to write it for us.'
20:02:52: Asylumius says 'Hm. Documentation is cool.'
20:03:00: Ghasatta says 'yes, I leave on Thursday'
20:03:07: Asylumius says 'Davion (hi?) started some cool documentation stuff for MB'
20:03:07: Quixadhal says 'and Davion was telling me I can't overload this() in a virtual function to implode the universe.'
20:03:18: Ghasatta says 'and have chartered a slow boat back from China to carry our hobbitses'
20:06:09: Quixadhal says 'Oh, and I can't paste evil perl to scare you, so I present this!'
20:06:16: Quixadhal says 'http://mysite.verizon.net/les.peters/id2...'
20:06:50: Quixadhal says 'The "best of show" winner of the 2000 Obfuscated Perl contest! Enjoy!'
20:07:27: Ghasatta says 'wow'
20:07:56: Quixadhal says 'the runner up was pretty good too – http://perl.plover.com/obfuscated/'
20:08:19: Quixadhal says 'If you think you understand this program, but you can't explain @P, then you are mistaken, because @P is the central data structure of the entire program.'
20:09:52: Quixadhal says 'Oh wow… now THIS one is impressive. http://perl.plover.com/obfuscated/bestev...'
20:10:02: Quixadhal says 'That source code runs in both Perl AND Postscript!'
20:10:55: Quixadhal says 'I can't even imagine writing source that works properly in two seperate (unrelated) languages.'
20:11:05: Ghasatta chuckles politely.
20:14:11: Ghasatta says 'okie dokie'
20:14:18: Ghasatta says 'I need to be running along'
20:14:27: Ghasatta says 'remember TEH DOCUMENTASHUNS!!!11'
20:14:37: Ghasatta says 'I will see all of you in a couple months'
20:14:49: Quixadhal says 'alrighty, thanks for stopping by! We'll try to break something for you to fix when you get back. :)'
20:15:01: Quixadhal says 'Beware those hobbits!'
20:15:23: Quixadhal says 'They're all addicted to pipeweed, and may kill for it.'
20:16:01: Ghasatta says 'what makes you think I'm not a hobbit myself?'
20:16:12: Ghasatta waves happily.
20:16:16: Ghasatta has left the game.
20:16:38: Quixadhal says 'I know he's not a hobbit, else he'd have been jonsing for pipeweed. :)'
20:20:57: Retnur leaves south.
20:21:39: Retnur has arrived.
20:21:44: Retnur says 'Roar'
20:21:57: Retnur says 'Meeting already over?'
20:22:52: Quixadhal says 'Hey, how goes it? Yeah, kindof… mostly just bemoaning the state of documentation. :)'
20:23:05: Retnur says 'Pity'
20:23:50: Quixadhal says 'Ghasatta wrote a ban class for me to look at (in the dev branch)'
20:24:23: Quixadhal says 'These guys are more idle than me, for a change.'
20:24:55: Retnur says 'nfortunately I can't offer more to the project as of today '
20:25:01: Retnur says 'Other than bloviating'
20:25:28: Retnur says 'ANd I'd wager it is in no shortage as is'
20:25:41: Quixadhal smiles happily.
20:26:24: Retnur says 'ASo what's new?'
20:26:39: Quixadhal says 'That's fine. One quality I do possess is patience, so I'm in no hurry. :)'
20:27:07: Retnur says 'Were my container classes ever actually put in?'
20:27:11: Quixadhal says 'Not a whole lot. We merged OLC into place and are starting to open the std::string can of worms.'
20:28:22: Quixadhal says 'Not yet, although they're on my list still. I think the last of the interest in the C branch has faded away.'
20:28:40: Retnur says 'That's good.'
20:28:43: Quixadhal says 'Not that it was all that strong to begin with… :)'
20:30:14: Quixadhal says 'I've been reacquainting myself with the STL containers, forgot how much of a n00b I am. :)'
20:31:03: Retnur says 'The containers are worth it.'
20:32:22: Quixadhal says 'Oh yeah, I just forgot some little details that I assumed were different than they are. std::map surprised me by spontaneously creating elements instead of throwing exceptions if you try to access ones you havent' assigned yet.'
20:32:42: Quixadhal says 'no biggie, just not what I was expecting. :)'
20:33:10: Retnur says 'Yeah'
20:33:17: Retnur says 'There's a way to see if it exists'
20:33:21: Retnur says 'Before accessing it'
20:33:23: Retnur says 'Which is the proper way'
20:34:53: Quixadhal says 'right, just a bit roundabout. I've got a few years of perl ingrained, so it's a habit.'
20:36:02: Quixadhal says 'I suspect I'll run into a good handful of little things like that to relearn, but it's all good.'
20:36:18: Retnur says 'I ran into that problem as well'
20:40:09: Quixadhal says 'If only I could code the snow away from my driveway… :)'
21 Jan, 2009, kaervos wrote in the 2nd comment:
Votes: 0
Damn I'm bad at making these meetings.

I'm usually slavering over some task for RaM, but I've been preoccupied since I got a new Core2 Duo laptop and installed 64-bit Linux.

I've been pulling my hair out trying to get some of my personal projects to function correctly… it took a long time (and lots of hair) for me to figure out that my foolish assumptions about the "long" datatype being 32-bits wide have finally come back to gnaw on my @55.

Anyway, I *just* finished updating my current beast of a project, and I figured I'd check in. I'll probably grab some bit of RaM code and convert some (const char*)s to (std::string)s. Also I had this quandary I was hoping to get some feedback on, so I can call the language implementation finished:

Listener comprehension skills are important, while speaker comprehension skills aren't. This means that the speaker is considered to speak a language perfectly, even if they have a meager comprehension skill. I'm considering a filter for speech output that will garble words when the speaker isn't proficient in the language they are speaking. Maybe move words around in the sentence, maybe move letters around in words, maybe add letters to words… this would make those who comprehend the language *likely* able to understand what the speaker is saying, while still sounding awkward. Wondering if anyone has any implementation ideas. The ideal implementation would result in speech like when you translate something from english to another language then back to english using google language. Obviously we can't have a database of thousands of words for this purpose, so without google language's help, any ideas on how to identify / move / corrupt certain parts of speech to make someone sound like they are just learning a language?
21 Jan, 2009, quixadhal wrote in the 3rd comment:
Votes: 0
Yes, that's another annoyance of C/C++… there's not really a single standard way to perfectly specify that you WANT a 32-bit integer. There are defines you can use, but I don't think they're guarenteed to be there on all platforms.

That's the main reason I moved all integers in RaM to be "int" instead of short int, or long int. Not that "int" will always be 32-bit, but if all integers are the same, all the various I/O functions dealing with them should also be the same.

All bets are off with nasty bit-related code, of course. :)

I think tracking language skills on both ends is probably overkill here, although in a chat room it would be a LOT of fun! The basic idea of languages in a MUD is to encourage role-play, be a money/skill-point sink, and allow for some minor strategic decisions if a common language isn't available.

For example, you can make the uber sword of d3th 8unn13s to be a crafted elven sword, only available by learning mastercraft swords + gathering rare mats + enchanting it – and some of those prereqs might only be available from elves, and they might only deal with people who speak their language.

It doesn't so much matter how the text really looks, although for decent immersion, you'd like each langauge to be distinct and recognizable from each other, as long as it's difficult or impossible to decypher without the appropriate language skill.

It's also worth considering how much of a CPU impact layering too many filters might have on folks who pay for their CPU time. My MUD runs at home on a 900MHz CPU, all by itself… so I can do quite a lot of text processing before it ever becomes noticeable, but if you're paying for a virtual machine that gives you the equivalent of a 300MHz CPU, and charges you if you spike it for too long – they might prefer to spend their cash on better mob AI. :)
21 Jan, 2009, David Haley wrote in the 4th comment:
Votes: 0
I would use int32_t and friends – I'm not sure if they are strictly speaking part of the standard, but they are available on very, very many platforms. For those cases where they aren't available, you can typedef the appropriate platform type to int32_t and not have to change a single piece of your remaining code.

But, you're also right that if you use ints to represent only ints, it doesn't really matter. Issues crop up when people do funky things like storing pointers in ints, or making assumptions about the exact size of the int.

My general rule: if I actually care, I specify the type exactly using e.g. uint16_t. If I don't care, I use the generic "int" type.
21 Jan, 2009, kaervos wrote in the 5th comment:
Votes: 0
Yeah, most of my faux pas involved using what I (erroneously) assumed to be a 32-bit unsigned integer to store RGBA color values. Four bytes fit so nicely in a 32-bit bit integer, I used this all over the place, and was merrily swizzling bytes about like a fool. I defined flexible vertex formats (maybe I stole this term and perhaps a chunk of Direct3D8.h from Microsoft) and had CVertDiff defined as a vertex that contained a 3-space vector and a diffuse color value. I finally checked the size of CVertDiff and found out it was larger than I assumed. You can imagine how OpenGL felt about my glDrawArray(…) calls.

Even worse things happened when I was writing to SDL surfaces 0x00000000 values cast into (64-bit) longs assuming one per pixel when the surface had a 32-bit color depth. O_O

Sounds like int32_t and friends would make good friends. =)

As far as the languages… I figure that even the current implementation is overkill, but if we are going for accurate languages, the speaker's comprehension should be taken into account. Due to the centralized speech channel, the language implementation can be entirely removed very easily. The drunken speech is in the same boat and independent of languages, so admins can fully adjust the speech filters with about 2 seconds of code modification. The current implementation is definitely processor heavy as previously discussed, but only compared to the rest of ROM, which as Quix pointed out, wouldn't even tax the CPU in your cell phone.
21 Jan, 2009, quixadhal wrote in the 6th comment:
Votes: 0
For RGBA values, you might find your best bang for the buck is to use an array of four unsigned char's. That way, you not only get your 32-bits (assuming your compiler follows the rules and doesn't try to "unicode" you), but you get them in the order you want them (in case you ever leave the land of intel), and you get to fiddle with green via foo[1], or the whole thing via (uint32_t)foo.

Of course, you could get snazzy and make a union too.
22 Jan, 2009, ghasatta wrote in the 7th comment:
Votes: 0
quixadhal said:
Of course, you could get snazzy and make a union too.
:stare:killkillKILLKILLKILLLSTSBBITYSTABBITYAAAAAAAARGHHASSFDAHRJEO"FHDJKLGH#RIOYASHFD NAEHKLHFSAHKAFJKAAAAAAAAAAAARGHKILLKILLKILLKILLKILL…………………….<NO CARRIER>
22 Jan, 2009, quixadhal wrote in the 8th comment:
Votes: 0
Don't make me come out there and smack you with a union of bit fields… (NOT the C++ bit vectors, the good old C bit field, that everyone fears for some reason).

Quote
union {
struct {
unsigned IsHappy : 1;
unsigned HowHappy: 2;
unsigned Happiness: 29;
} HappyBits;
int HappyInt;
} happy_helmet;

happy_helmet.HappyInt = 42;
if(happy_helmet.HappyBits.IsHappy == FALSE) {
printf("I'll TEACH you to be happy!\n");
happy_helmet.HappyInt++;
printf("You can't know the ultimate answer to life, the universe, and everything AND be happy! %d\n",
happy_helmet.HappyInt);
}


:devil:
23 Jan, 2009, kiasyn wrote in the 9th comment:
Votes: 0
I SAW MY NAME
23 Jan, 2009, quixadhal wrote in the 10th comment:
Votes: 0
Oh drat… hide the booze!
08 Feb, 2009, kaervos wrote in the 11th comment:
Votes: 0
Welp, I've been AWOL for a while again. I hope to make the weekly meeting tomorrow (today), and see whats cooking on RaM's burners. For some reason tonight the answer to the speaking proficiencies implemenation jumped out of nowhere and slapped me in the face.

Since the translation system is word-based, I can take spoken common words, and then translate them into the target language with some fuzzy logic. The fuzz depth would be based on the speaker's proficiency. Imagine a dwarf grouped with two elves… he is somewhat proficient in elven comprehension, but has some way to go before he is fluent. The dwarf takes a dagger he found, but doesn't care for and gives it to one of the elves, as he sees they are using a less powerful dagger in combat. He then speaks in elven:

You say in elven 'Wield the dagger.'

The speech system would look at his proficiency, and for each spoken word check to see if it was spoken correctly. If it was not, the system would replace the word with a random word from the language's dictionary. Lets assume the proficiency check for the word "dagger" fails, and that word is in the dictionary for that language. It is then replaced with a different word, so in reality the dwarf said something like:

Grendas says in elven 'Wield the donkey.'

The elves would then look at one another and stifle a laugh.

Similarly, if a spoken word proficiency check fails, and the word isn't found in the dictionary, the letters it contains can be replaced with a random letter from the letter translation table. This will make words perhaps be legible, but incorrectly pronounced.

I feel like once this change is in place, the language system will provide a very realistic language barrier that can easily be modified or extended… I'm somewhat of a perfectionist, but after a few tweaks I could even call the translation implementation complete.

As far as the RGBA color / union thing… this ought to provide some amusement:

// 4D Vector used for rects and quaternions as well.
template <typename tVect>
class CVector4
{
public:
union { tVect x; tVect r; tVect left; tVect Left; };
union { tVect y; tVect g; tVect top; tVect Top; };
union { tVect z; tVect b; tVect right; tVect Right; };
union { tVect w; tVect a; tVect bottom; tVect Bottom; };
// Default, individual values, and copy constructors
inline CVector4() : x(0), y(0), z(0), w(0) {};
inline CVector4(const tVect X, const tVect Y, const tVect Z, const tVect W) : x(X), y(Y), z(Z), w(W) {};
inline CVector4(const CVector4<tVect> &vIn) : x(vIn.x), y(vIn.y), z(vIn.z), w(vIn.w) {};
<snip/>


I have a templated vector library I made that I use for blasted everything. Its pretty handy… probably scary to some. Lets me do easy stuff like this though:

// integral types for raster stuff & colors
typedef CVector4<unsigned long> Rect;
typedef CVector2<unsigned long> Point;
typedef CVector3<unsigned char> Color3;
typedef CVector4<unsigned char> Color4;

// floats
typedef CVector4<float> Rectf;
typedef CVector2<float> Pointf;


Oh, and you want to convert that Color4 to a 32-bit color value?

// Return 32bit color integer
inline const unsigned int RGBAColor(const CVector4<unsigned char> &C)
{ return (unsigned int)((((C.a)&0xff)<<24)|(((C.b)&0xff)<<16)|(((C.g)&0xff)<<8)|((C.r)&0xff)); }


*ducks*
08 Feb, 2009, quixadhal wrote in the 12th comment:
Votes: 0
kaervos said:
Welp, I've been AWOL for a while again. I hope to make the weekly meeting tomorrow (today), and see whats cooking on RaM's burners. For some reason tonight the answer to the speaking proficiencies implemenation jumped out of nowhere and slapped me in the face.

Since the translation system is word-based, I can take spoken common words, and then translate them into the target language with some fuzzy logic. The fuzz depth would be based on the speaker's proficiency. Imagine a dwarf grouped with two elves… he is somewhat proficient in elven comprehension, but has some way to go before he is fluent. The dwarf takes a dagger he found, but doesn't care for and gives it to one of the elves, as he sees they are using a less powerful dagger in combat. He then speaks in elven:

You say in elven 'Wield the dagger.'

The speech system would look at his proficiency, and for each spoken word check to see if it was spoken correctly. If it was not, the system would replace the word with a random word from the language's dictionary. Lets assume the proficiency check for the word "dagger" fails, and that word is in the dictionary for that language. It is then replaced with a different word, so in reality the dwarf said something like:

Grendas says in elven 'Wield the donkey.'

The elves would then look at one another and stifle a laugh.


Now, if you want to make that fuzz a bit smarter, go ahead and pre-compute soundex values for all the words in your table and choose one that has the closest soundex match but isn't the same word. :)

"Hold the orc while I loot the chest" => "Hold the cork while I shoot the dress"

*grin*
0.0/12