Game developers are faced with the difficult task of creating non-player characters with convincing behavior. This commonly involves an exhaustive specification of their actions in every conceivable situation that might arise. The process is laborious and the results do not apply in new and unforeseen circumstances. We present an agent architecture where game characters have a basic understanding of their environment that enables them to figure out what to do by themselves. Knowledge about facts and actions is encoded in a formal logic where automated reasoning technology can apply the knowledge to answer novel questions in dialog and to plan actions in new situations. A number of examples serve to demonstrate how the technology meets the challenges of application in a simple computer game prototype. We envision this technology being used to create more flexible game characters with a deeper understanding of the world they inhabit.