Author Topic: Console  (Read 1531 times)

daniel.santos

  • Guest
Console
« on: 22 October 2009, 19:33:59 »
I propose moving the Console to be owned by Game::Program rather than Game::Game.  There are multiple reasons for this:
  • I can do chat in the lobby screens.
  • It allows me to have it exist prior to Game existing.
  • I want to expand Console to behave more like the Quake console.

This last item I don't need to do right away, but this basically works by having a keystroke cause the user interface to toggle between normal mode and console mode.  In normal mode, console messages appear as they do now, at the bottom of the screen and they go away after x amount of time.  In console mode, all keystrokes are re-directed to the console (similar to when typing a chat message), and half or all of the screen gets the console overlaid.  In this view, you can see all history and scroll up and down with page up/down (or shift page up/down).  This provides a nice mechanism to enter debug commands should we decide to support such things in the future.

In Quake, the tilde key was used.  I guess I don't particularly care which key is used to toggle the console.

For now, I just want to have the console owned by the program and usable from any screen (so you can chat while in the lobby).

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Console
« Reply #1 on: 23 October 2009, 23:18:00 »
Sounds good, if you want to take care of the first two for your own purposes, I'd be happy to take care of number 3... at some point.  I've been thinking about just such a system for while (and by 'thinking', I mean 'thinking it would be nice' ;) ).  It could probably just be a Lua console in reality, to avoid duplicating effort... of course, we'll need to exert some effort on the Lua interface first :)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

daniel.santos

  • Guest
Re: Console
« Reply #2 on: 24 October 2009, 00:17:38 »
hehe, that's exactly what I was thinking.  Maybe the console has a normal chat mode where everything you type is just chat unless it starts with some character, and then it gets interpreted as Lua or some such.  But then there's a Lua mode where everything is Lua unless you start it with "/say" or "/team" or some such?  Either way, we could have the console display the output of Lua commands and it could be a nice debugging feature -- maybe even allow changing Game::Config values.

Finally, I'm thinking about also making a few other objects that are currently strictly singletons owned by the Game::ProgramBase (a new base class to the Game::Program class) object -- this will cause them to continue to behave much like singletons, but will allow us to have more than one for unit testing and such.  These are Config, Lang, Renderer, maybe loggers, (and NetworkManager is going away).

For the console on the dedicated server, I think I'm going to setup a separate derived class to ProgramBase that omits the sound, window and opengl overhead and just uses standard in and standard out for the console (at least that's what I'm thinking).  But still, I'm not going to implement that very soon from now, I'm just trying to get things organized into relatively sane concepts.  In the end, I think it'll take a lot more to be in place before a dedicated server can be implemented because we'll need the ability to vote in order to kick people out, change the map, etc.  Currently, whomever hosts the game has the control over all of those things.

daniel.santos

  • Guest
Re: Console
« Reply #3 on: 14 December 2009, 19:52:17 »
hmm, this looks like an interesting possible solution: http://oglconsole.sourceforge.net