Sean Middleditch » 2003 » November

Non-solution for Spam

wspace: no, that isn’t a solution at all, unfortunately, since it makes it completely impossible for many users to ever send you email. Many users have images turned off, or use browsers incapable of rendering images, or are blind/visually-impaired and couldn’t see the image even if they had a browser that displayed them.

Scriptix

Been doing some heavy work on Scriptix lately. Mainly, I’ve added custom types (as in, you can create new types in scripts, not just in the C++ API), and worked some on the threading model. The idea is to make it easy to over-ride various bits of AweMUD by simpling making a derived class and registering and instance there of.

Also still trying to clean up the compiler a bit. It’s still got a lot of C-isms in it, and is just generally very ugly. Especially the ParserNode class - it’s a generic data type meant to represent any kind of statement/expression/primitive/etc. A single class capable of representing both a simple data item and all the various bits of a foreach loop is just sick. I’m too lazy to code a ton of custom classes, tho, and to be honest, I’m not sure it’s actually worth it - eventually you get to the point where verbosity and cleanliness is less attractive that straight-forward and basic.

I’m also thinking some more on optimization. Basically, Scriptix being a dynamic language, tons and tons of things are done at run-time. Many of these things don’t even really need to be done at run-time, but are simply due to the architecture. I’m figuring that is the language was statically typed, I could optimize the living hell out of it. Which, for a language designed for game languages, is a good thing.

But then, to be honest, as I approach that point, one wonders why anyoen would use Scriptix when they could just embed Java or Mono or what not just as easily.

AweMUD File Format

Almost all of AweMUD is now using my self-dubbed File Object Format. FOF is quite simple in design; basic files look a lot like RFC 822 messages, with a “key: value” format. I’ve written about the format before.

The problem is, mainly, the ‘block’ data format. RFC 822 uses indentation to mark line continuations, which is actually rather elegant, imo. FOF can’t use that tho, because indentation is usually used in an object to make the file easier to read. (A lot like how you indent code, or how many people indent XML.)

Normal value items can use the old standard of a backslack on the end of the line. But, when you have a big chunk of text, that gets pretty unwieldly. So, I use a pair of {%% and %%} to mark the text. Which works well enough. Except it’s, well, ugly. It isn’t visually appealing. It doesn’t even really stand out much. But I’ve no idea what else to use; most of the blocks of text end up being code (the only reason I need blocks of text, to be honest) so that wipes out a good number of symbols and combinations. I wantt to find somethign I like soon, tho, I want to get the file format stable soonis.

AI Factions

Factions, or Relationships, or whatever word you prefer, is a method for NPCs to recognize who they hate, who they like, who they fear, who they eat, etc.

They’re generally just tables of values. I.e., two factions may be Prey and Predator. Wolves might be in the Predator faction, and rabbits in the Prey faction. The Predator table says it should EAT prey, and would have a very high static score. Likewise, the Prey table says it should FLEE from predators, and also have a high static score. So, when a rabbit’s AI sees a wolf, it consults the table, seeing it should FLEE - it measures the score against its current priorities, and then may (or may not) run away.

The interesting part comes with the dynamics of the factions. Wolves always eat rabbits, and rabbits always run from wolves. But how does the local blacksmith respond to an elven mage that just entered his shop? Perhaps the blacksmith hates elves. So he has a HATE elf entry in his faction table with a moderate score. He might charge higher prices, act gruffer, etc. Now say the shop gets attacked by bugbears, and an elf couple saves him. So now his score changes, perhaps lowering the HATE score a good deal, or even turning into a LIKE score. The world affects the NPCs.

But now lets look at temporary scores. You are playing a game of tag. The NPCs have need temporary entries, to be able to switch between EAT/KILL and FLEE depending on who is “It”.

Oh, but it gets even more tricky. Lets say you are an evil bastard and kill a peasant in the woods, and his friend sees. His friend knows you’re an evil bastard. But would the rest of the town? No. The peasant’s HATE/FEAR score is personal. But, say he goes to town, he would tell people, yes? So these scores have to mix and travel.

To be honest, none of the above is hard at all. It’s all quite simple; basic data structures, basic math, and so on. The problem is, its not really feasible for a massively multiplayer game. We could have potentially thousands of players. Many, many NPCs will meet with and have lasting impressions of tons of players. Even short-lived NPCs, like most monsters, will quickly rack of impressions of a number of players. This will result in tons and tons of memory being gobbled up for these huge tables.

The solution, or the only one I can think of at least, is to skimp and fake it as much as possible. i.e., NPCs only keep memories of a small number of players. Faction scores rot out fairly quickly. Individual impressions (like the single peasant that saw you murder his friend) will ’spread’ without needing tons of actual communication, but just kind of happen ‘ambiently’. And so on. The exact semantics are what make it so tricky.

Chema

I’m not really sure what to say.. I never really knew him, but I’ve talked with him before. Good talks, I might add. ^,^ One can look at all the words people have for Chema, the memories, the praise, and you can tell what a great man he really was. As cliche as the phrase is, your life truly does amount to what people remember of you. And from what I’ve read today, a lot of wonderful memories were made because of Chema. I suppose you really can’t ask for much beyond that, when all’s said and done.