A wxPython console

An in-engine console is an indispensable asset when developing games. It can display a log of engine messages, allow simple querying of engine values and even provide a full programming environment for the engine. I had initially thought of implementing a console like Quake: toggled with ~ and rendered in-game at the top of the screen. I quickly decided against this route and chose to create a console using wxPython.

A wxPython console can provide a native OS interface with scrollbars, selectable text, copy and paste, etc all for free. These were features I’d never have time to implement in a Quake style console. Besides, I wanted to integrate wxPython into c2 anyway so I would have a way to create simple tools for the engine.

The console I ended up with is a simple dialog box that provides an interactive python prompt. It doesn’t have to interact with the engine directly, it just runs commands in a python environment which happens to have the engine interface imported. So the console can be used in any wxPython application. You can download it here. The only requirement is that you have wxPython.

Leave a Reply