Generating grammatically correct MUD-style attack descriptions

Posted by Extrakun on Game Development See other posts from Game Development or by Extrakun
Published on 2011-01-08T09:35:21Z Indexed on 2011/01/08 9:59 UTC
Read the original article Hit count: 266

Filed under:
|

I am currently working on a text based game, where the outcome of a combat round goes something like this

%attacker% inflicts a serious wound (12 points damage) on %defender%

Right now, I just swap %attacker% with the name of the attacker, and %defender% for the name of the defender. However, the description works, but don't read correctly. Since the game is just all text, I don't want to resort to generic descriptions (Such as "You use Attack on Goblin for 5 damage", which arguably solve the problem)

How do I generate correct descriptions for cases where %attacker% refers to

  • "You", the player? "You inflicts..." is wrong
  • "Bees", or other plural? I need somehow to know I should prefix the name with a "The "
  • If %attacker% is a generic noun, such as "Goblin", it will read weird as opposed to %attacker% being a name. Compare "Goblin inflicts..." vs. "Aldraic Swordbringer inflicts...."

How does text-based games usually resolve such issues?

© Game Development or respective owner

Related posts about games

Related posts about text-based