Driftwood2D / Driftwood

Driftwood 2D Tiling Game Engine and Development Suite
http://tileengine.org/
MIT License
24 stars 1 forks source link

In-game developer console #89

Closed seisatsu closed 7 years ago

seisatsu commented 7 years ago

If enabled in the configuration or command line, pressing tilda will open a console at the top of the window where arbitrary python commands may be executed.

Alternative idea: The engine creates a bi-directional named pipe or other ipc bridge which can be accessed with a tool to send python commands and receive responses.

Investigate multiprocessing module's Clients and Listeners.

seisatsu commented 7 years ago

I could also use plain old sockets. It's seems it's also possible to run an interactive Python console over a socket, which might be the cleanest way to pull this off. See http://stackoverflow.com/questions/16155480/no-newlines-for-python-interactive-console-over-socket

pmer commented 7 years ago

Ooh I just had a crazy thought where we have an ncurses CLI. The bottom line of your terminal screen is a command prompt and the top lines are a message window where all normal log messages are sent.

seisatsu commented 7 years ago

I like that, though we'll have to make it support Windows as well. It's a straightforward solution. We should also support logging to file then since piping stdout becomes impossible.

pmer commented 7 years ago

We can add colors & bold to log messages.

seisatsu commented 7 years ago

A simple two-pane approach should be easy to code for both ncurses and windows console to support both.