Truth or reason maintenance systems can be used to handle inferred information about facts and derived facts.
Work continues with tiny rule engine and I have encountered rather interesting design decision relating to unification, namely uniqueness of values.
Recently I wrote about some simple AI stuff that involved different kinds of search routines. There was breadth first, depth first, best first and a* search. All of them share some common features that allowed me to write just a single routine and then tune it according to specifc search strategy I wanted to use. This blog post will show how that was done. While pretty basic concept, I found it interesting how different kinds of search strategies actually shared quite a bit between each other.
Building Problem Solvers by Kenneth D. Forbus and Johan de Kleer inspired me to tinkering a bit with AI stuff again. This time, instead of writing routines for solving specific problems, I wanted to tackle writing more generic code that could be adapted to solve various kinds of problems. The result: stilpo, simple AI library that doesn’t do much yet (but hopefully will be doing bunch of stuff in the future).
Currently it supports solving problems where problem space is neatly defined and not overly large. User needs to specify how state of problem is represented, how to transition it to different states and how to recognize both identical states and goal state. After that they just choose a suitable search strategy (depth first and breadth first only currently) and hope for the best.
I have been reading Gödel, Escher, Bach: An Eternal Golden Braid, which among many things, talks about how symbols and simple rules create emergent system and eventually consciousness. One of the reasons I got in the process of writing Herculeum was that I wanted to tinker with various AI routines, so this section of the book is really interesting. Reading of course got me interested on trying to think how to code such a system.
Yesterday I released Herculeum 0.9. Release log is short:
- curses interface
- bug: Effects with None as duration or frequency cause crash when triggered
- switch to Python 3
Most of the changes are under the hood. The game is now available at PyPi, which makes installing as easy as:
pip install decorator pip install hy pip install herculeum
AI routines of rats and fire beetles have been rewritten. They now choose an area to patrol and walk around there, pausing to wait a bit now and then. Rats prefer to stay close to walls of the room, while fire beetles stay in the middle of the room. A large room with couple of rats and a fire beetle or two is now much more interesting to sneak through.
AI routines have been written with Hy, hence the dependency to it. The plan is to use Hy for all of the AI routines in the future, which means a rewrite for skeleton warriors and the old Crimson Jaw.
Curses interface is up and working (it’s actually the interface I’m mostly using when developing the game nowdays). PyQt interface will continue to be supported though, it is not going anywhere.
Magic didn’t make into this release, although part of it is already working. I’m trying to finish it for the next release, which hopefully won’t take as long as the previous one to make.
Here’s a screenshot of curses interface showing rats and beetles patrolling the room at top right.