Based on the open source DarkQuest project.