Engine for text-based game