Should AI be a Drupal user?

Morbus Iff's picture

Consider a game in which battle is the (first thing to be finished). In this game you, as a player, take a collection of units (forming your army), and battle other armies. Armies can be made up of other players (other Drupal users), but armies can also be owned by an AI. A number of questions arise: is AI necessary in a community of healthy real-life users? Should the AI be a set of logic only, or should it take advantage of code that's already written, with Drupal users being automated by that logic?

The game.module is being written to support two concepts: a) non-interactive battling, and b) scaling user battles (starting at 1 user vs 1 user, expanding to 2 user vs 2 user etc.). "Non-interactive battling" simply means that not everyone has to be there at the same time - a player can take his turn, and the other player will be notified. When that player has time (i.e., when they wake up, or return from their father's funeral), they can then take THEIR turn, and so on, repeating until one player wins.

This means, of course, that a single battle could take a long time if both players aren't attentive to the other. So, an AI will also exist. My question is: should I fake up a non-Drupal-user interaction and workflow, or simply create a new Drupal user, flag it as an AI, and let all my existing code work already, only with logic determining the actions of this new Drupal user?

What this means, from an installation standpoint, is a bit more setup (though, we could automate it during the install, and will, probably): for a player to battle an AI, the Drupal admin would have to first create a new Drupal user, tell us that it's an game AI, and then, potentially, determine its brain and personality - the type of units its army contains, how aggressive (or stupid) its tactics are, and so forth. On the down side, this makes the Drupal admin more responsible for the automated processes going on in his game (it becomes less a "5 minute install"). On the plus side, if we could automate the initial AI creation (5 created users of variable difficulty/armies/tactics), the Drupal admin would still have the ability to tweak each AI, giving them personalities. Treating an AI as a Drupal user would also mean they'd show up, in my opinion, on any and all "high score lists" or tables, allowing them to be tracked just like any other player.

I, personally, really like "Drupal user as AI". Thoughts?

Groups:
Login to post comments

Ghost in the Machine

aaron's picture
aaron - Tue, 2008-12-02 19:14

Personally, I like your last idea (of semi-automatic AI user creation). This might also allow an admin to 'possess' an AI user for special battles.

Aaron Winborn
Drupal Multimedia (book, in October!)
AaronWinborn.com (blog)
Advomatic (work)


RobLoach and litwol seemed

Morbus Iff's picture
Morbus Iff - Tue, 2008-12-02 23:49

RobLoach and litwol seemed to agree too - AI as literal Drupal users has a lot of neat possibilities. However, with all these neat possibilities comes personality that may want to live on if Game is ever uninstalled. As such, while I'd still delete all Game related material (their armies, etc.), I don't think I'd ever delete a user who has been flagged as an AI.