Friday, 8 February 2008

Gods and their names


Random names are fun, and not something I'd implemented before.

A few minutes with Scala and a few hours of debugging and disposing of edges cases later, I have a bit of code that eats a list of gods purloined from Wikipedia and spits out new names generated from the old. It's very basic and takes ages to cobble together the initial digest, but it does more or less work, and at least tries to make its thievery a bit subtle. Given the tiny input set, it does fail a bit on this latter requirement.

Generated from male celtic British/Gaulish deities:
  • Barindonnessi
  • Grantucarus
  • Zachaynu
  • Borvernus

Female versions:
  • Andrastres
  • Rosmertio
  • Adsulevia

Mesoamerican neogodlings:
  • Mateotl
  • Itztlalicu
  • Temazcaman
  • Mexochitl
Some crazy similarity metrics and fiddling with lengths might eventually produce a system capable of populating a small pantheon without having any gods lumbered with outright stupid names. For random NPCs, locations, lore... who knows. Probably not, but it's something to look at, and the less familiar the language (orcish?) the more forgiving the eye when clumsy constructs arise.


I also cobbled together the beginnings of a quake-style console. At the moment it's simply a glorified map of strings to functions, but it does have one nice feature: spelling suggestions for malformed commands. It searches two mutations away from whatever keyboard mushing you produce, and gives a (currently unsorted) list of suggestions based on current registered commands. If it knows of a command 'list', it'll direct you there from 'lust', 'lister', 'ilts' and even 'pish'.

It also does some very primitive argument sanitising. The string cmd "arg0 arg1" is in fact interpretted as a command with a single argument which happens to have embedded spaces. It also handles escaped quotes within such a string argument. Normal args (cmd arg0 arg1 arg2...) are split by spaces. Other than splitting, handling quotes and trimming, they're all passed off as unparsed text, 'cos I'm lazy and that's the command writer's job (me, but in the future!) rather than mine (right now!).

Accidentally cool stuff

The timing system I prototyped the other day has some hidden niceness. Yes, niceness! Emergent shiny! I'm sure there's a freightload of bugs to go with this small parcel of goodness, but that's par for the course. Gift horses and all that.

It turns out that adding additional characters controlled by the player is ridiculously easy, at least from the action/timing/input point of view. The code makes no assumptions over which critter the player is controlling, nor on the multiplicity of them. There would be some additional code required to display pertinent stats if a fully team or squad based game was wanted. On the other hand, a hotseat or even networked dueling/co-op game would work well.

Additionally, because of the way I chose to implement latent actions, a controller (AI or player) can very easily possess a critter for a duration. Now, monsters controlling the PC would be full of suck, but on the flipside an absolutely overpowered 'dominate creature' type of effect is now possibly available for players, granting complete control of the dominated/summoned critter. In fact, you could even write a game where the player flits between the minds of monsters. This is something that has been done to death in literature, and I seem to recall at least one other game (Messiah?), but as far as I'm aware it's new to roguelikes.


One weekend, I'll have to sit down and work out the dependencies between all these little modules I'm writing. Some will be easy (name generation) as they are coupled to nothing else. Others, like the timing/action system, AI, world and worldview classes, rendering... they're all going to be real bastards, a nest of spitting, viperous circular dependencies if I'm not careful.

Ah well, that's something for another day. And hopefully the console will make executing actions - especially when debugging - a whole lot easier, as it obviates the need for decent input systems.

No comments: