Author Topic: 7DRL Idea - Plugin AI  (Read 12011 times)

jlund3

  • Newcomer
  • Posts: 33
  • Karma: +0/-0
    • View Profile
7DRL Idea - Plugin AI
« on: March 04, 2014, 09:01:40 PM »
Every so often someone proposes the idea of an AI which is trained with a genetic algorithm (GA), often with some sort of artificial neural network (ANN). There are a myriad of other ideas for AI that are also worth checking out. I personally do not think the GA/ANN idea sounds very robust in general (compared to a good developer designed AI that is), but would be an interesting experiment which you could then point to whenever someone proposes the idea again.

To facilitate AI experimentation, my idea for the upcoming 7DRL challenge is to implement a bare-bones roguelike with the AI run as a separate executable plugin. There would be a simple text-based protocol run similar to how many AI contest are run. As an example of what I mean, see http://ants.aichallenge.org/specification.php (not that this is a great example, its just one that came to mind first). Basically the game would run the AI as a subprocess and send and receive information via the AI stdin/stdout. Hopefully such a protocol combined with a simple roguelike  game would mean that the barrier to entry in writing the AI would be fairly low. You could also make the hero AI a plugin so that training is more easily accomplished.

My hope is that such a 7DRL would be interesting to other devs as a playground for AI experiments. My question is whether or not there would be interest from other developers in contributing AI plugins during the 7DRL challenge. If so, I would love to try this idea out. If not...well I've got a long list of more interesting game ideas I could do.

guest509

  • Guest
Re: 7DRL Idea - Plugin AI
« Reply #1 on: March 04, 2014, 11:09:08 PM »
Probably a hard sell. People like to make their own 7DRLs, know what I mean?

Sounds interesting though.

jlund3

  • Newcomer
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: 7DRL Idea - Plugin AI
« Reply #2 on: March 05, 2014, 12:41:20 AM »
Probably a hard sell. People like to make their own 7DRLs, know what I mean?

I figured that this would be the case for most folks on these forums, and rightly so. However, I wouldn't be surprised if there were a few folks out there who won't have the time or energy for a full game, but would welcome a project with a low barrier to entry for contributing. In any case, I think I've manage to sell myself on the idea, so even if no one else is interested, I'm gonna give it a shot. I'll post links to a github project as I figure out the game mechanics and AI protocols.
« Last Edit: March 05, 2014, 07:24:07 AM by jlund3 »

Paul Jeffries

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 257
  • Karma: +1/-0
    • View Profile
    • Vitruality.com
Re: 7DRL Idea - Plugin AI
« Reply #3 on: March 05, 2014, 01:33:21 AM »
This sounds like really interesting experiment, but I don't think that the 7DRL would be the best time for it - as Jo points out, the people with the skill and the interest to contribute to it are likely to be busy with their own thing.  I think that writing the 'base' game during the challenge would be a good thing to do, just that you shouldn't expect too much input from other people until after the week is over.

Out of interest, how are you planning on approaching the plugin system?  A lot of game AIs in practice involve a lot of code outside of a specific AI module (for example, map representation, item metadata and so on).  I would have thought that making a game system that would be generalisable to absolutely any kind of AI would actually be very very difficult.

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Re: 7DRL Idea - Plugin AI
« Reply #4 on: March 05, 2014, 07:58:10 AM »
Very interesting idea. I probably won't have enough time for a 7DRL, but would happily develop some AI code. In the future, we could make another jam, an AI competition. I would be very interested in organizing such a thing.

About the architecture, I think doing plain text communication might be a lot of work, because you have serialize the game state, which can be pretty complex in a RL. And then every AI developer would have to work on parsing it. Instead, why not just enforce a language, like Lua or Python? AI code is usually fairly compact anyway, so I doubt anyone would mind.
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

jlund3

  • Newcomer
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: 7DRL Idea - Plugin AI
« Reply #5 on: March 05, 2014, 06:20:26 PM »
About the architecture, I think doing plain text communication might be a lot of work, because you have serialize the game state, which can be pretty complex in a RL. And then every AI developer would have to work on parsing it. Instead, why not just enforce a language, like Lua or Python? AI code is usually fairly compact anyway, so I doubt anyone would mind.

That is a fair point. Using a text-based protocol does add a bit of overhead to the system both in terms of serialization and in parsing. I personally don't think that serialization is too big of a deal. The code writing a map to string will be very similar to the code I use to write the map to the screen in my pre-existing terminal rendering code. As for parsing, I would anticipate providing a few basic starter AI's which already include parsing. I will only commit to Python for the 7DRL, but hopefully reading a simple text-based protocol into a more meaningful data structure isn't too hard of a challenge.

I have participated in a few AI contest in the past which used plain text communication. The advantage is that the AI can be written in any language. Hopefully, this means you'll have a larger pool of people who might want to participate. Furthermore, the very first things you learn to do in a new language is to read and write from stdin and stdout and I like the idea of lowering the barrier to entry as much as possible.

The more important disadvantage to a text protocol is that the game must be very simple by roguelike standards. However, I think this is actually okay. If the game is too complex, then any AI techniques which come out of this project will likely be too specific to this game to be useful elsewhere. I am thinking of a combat system which relies on a very small number of integer stats, and is complete deterministic.

For the curious, here is what I am thinking in terms of design: https://github.com/jlund3/airl/wiki/Design. Suggestions are welcome.
« Last Edit: March 05, 2014, 07:21:52 PM by jlund3 »

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Re: 7DRL Idea - Plugin AI
« Reply #6 on: March 05, 2014, 08:32:17 PM »
Thinking about it again, I think you are right, parsing the protocol won't be very complicated. You can count on me making an AI module for the game.

I've also taken part in a few AI competitions and they were always great fun. I think it would be great to organize a roguelike AI competition in the future. There are many cool variations that could be done, like having agents play against each other in a death match or a cooperative monster AI that hunts the hero.
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

jlund3

  • Newcomer
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: 7DRL Idea - Plugin AI
« Reply #7 on: March 13, 2014, 03:41:36 PM »
So the day after I made the post committing to do this 7DRL, my landlord decided that the law doesn't apply to him and he can enter our apartment at any time during the day with or without notice. One of the four times he showed up demanding immediate entry my wife was in the shower, and he still doesn't see any problem with his behavior. So we're moving. We found a new place in record time and have been moving stuff over. This means that it is already Thursday and I have spent a little less than an hour working on this project. I am preemptively calling this one a failure. That said, I'm gonna commit to finishing this project sometime after moving since I think it is a cool idea.

guest509

  • Guest
Re: 7DRL Idea - Plugin AI
« Reply #8 on: March 13, 2014, 04:05:17 PM »
As an attorney I deal with landlords pulling this nonsense quite a bit.

It's probably an obvious violation of the rental/lease agreement. Probably trespassing as well, both a tort and crime (lawsuit and cops). Let him scream about any rent he thinks you owe him once you move out, and if he tries to keep your deposit wait 60 days (sometimes 20, 30, 45) and then sue him for double in small claims (sometimes triple depending on state law).

Ask for moving costs as well. Keep receipts of moving van, time off work, etc...you might not get it, but hey you are in court anyway. And small claims is easy/fun.

Or just move and go write some codes to calm down.  ;)

jlund3

  • Newcomer
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: 7DRL Idea - Plugin AI
« Reply #9 on: March 13, 2014, 07:01:07 PM »
My wife was freaked out enough by the yelling and pounding on the door that once dressed she allowed him to entry so I don't think there was technically any trespassing - just violations of peace and privacy. Furthermore, our state law says that while owners are required to give 24 hours notice prior to entry, failure to comply with these requirements cannot give rise to cause of action. However, we are out of the contract and he owes us prepaid rent and deposits. By our state law he has 30 days, but by our contract actually modifies this to be two weeks. I suspect he will try to keep at least part of our deposit and he doesn't seem to think he needs to prorate the refund on prepaid rent (he does), so I guess I can look forward to small claims court. He'll also be receiving a visit from the city soon since we've now learned that his accessory apartment violates local zoning ordinance. On a happier note, our new place is way nicer, actually meets all zoning and code requirements, and is owned by a local real estate agent who comes with glowing reviews from the community.

guest509

  • Guest
Re: 7DRL Idea - Plugin AI
« Reply #10 on: March 14, 2014, 02:49:26 AM »
No cause of action? Interesting law. Still could be trespassing and of course violates the quiet enjoyment which can end the requirement for a 30 day notice to end rent liability.

Small claims is fun, it does what courts are supposed to do. Settle disputes with little fuss in a timely manner.