A real in-game console(s)

I also didn’t know there was a console in H3. But I’m not very used with consoles in general (I rarely play MP).

As for integration in VCMI, let me know if you want me to re-edit all the resolutions above x900, to make a box for it in the right panel (if you believe it’s a good idea to put it there), same as I did for 1280x1024: bugs.vcmi.eu/file_download.php?f … 2&type=bug

The console is a different object. It appears/disappear with a key combination and get the keyboard focus. The game is still playable though.

Yes. I actually knew that much, as I remember using such consoles in a couple of 3D Shooters many years ago (must be already 5-6 years). But because of my very little experience with them, I don’t really know if integrating them in the game interface would be a good idea or not (and if it’s ever done at all).

But if it’s not for the console, then I wouldn’t know for what else exactly we could use that space. If this were an RTS, it may have been the perfect place for updates (“your workers have completed…”, “player X has declared war on Y” etc). But for a TBS, I don’t know what else could it be used for… Quest Log maybe? But that’s not a core element in Heroes to justify a permanent box in the main interface… Maybe have all (/most) logs integrated in there, with the possibility of cycling between them (Quest log, Chat log, Console log etc…)?

Yes, there is. Press the tab button, enter any text and press enter - it works in both H3 and VCMI. I think you should take a look at CInGameConsole class in VCMI if you didn’t know about it.

I think we should ask Tow before any serious effort is put into making this console work.

I see. So that’s actually a chat box, not a console.
And since there is a chat box, that functionality in the existing console can go away.
So in the end we will have a chat box and a drop-down console for debugging/cheating/…

I think we could merge both consoles, in the end no one’s going to use separate window for debugging and testing. There’s no need to multiplicate beeings. Keep in mind that at some stage we’re going to get rid of endless logs once they’re not nessessary.

Using the chat bar for console might be best. Commands could be prepended with a slash.
It could be something like UT, where Tab lets you enter a single line of console input which is more or less what’s already done for the chatting and the key above that flips up a console above it with a nice scrollable history and unlimited input until you hit the console key again.

I’ve finally cleaned up the code a bit. diff file attached if anyone wants to give it a try. Activation/hidding can be done anytime with ctrl+1.
console3.zip (95 KB)

I’d be curious to give it a try, but I don’t know how to enable it in the first place. It seems to be not just a matter of placing the .diff file in a certain folder, but really compiling, right?

Yes, you need to compile it, which I can’t do for you because I don’t use windows.

the *.diff file contains changes in code - so it need be merged with existing code and THEN compiled. if ubuntux updated also project file/makefile it would be easy to compile

That’s fine. I’m gonna wait for the next dev release. :wink:

@majaczek: everything is there. you just need to re-run configure to generate the makefile.

@Zamolxis: since the code is not integrated (and may never be), it won’t be in the next release. Now, Tow could very well generate a second binary with the patch applied for testing purposes.

hey ubuntux - one thing - act fast because changes in code are deep and fast and some time it may become unmergable before it would be merged

There are two files missing in your package: ConsoleFont.bmp and DT_drawtext.h. Fortunately it was easy to find them on the net and I’ve built the win binaries.
It is SVN revision 1363 with applied the console patch.

Download link: download.vcmi.eu_with_console.7z
The new console, as Ubuntux wrote, can be opened in game by pressing ctrl+1.

I’ve only built the package, I’ll review the whole patch within a day or two (sorry, I have a lot of work with sutdies).
Is it meant as a replacement for system console or the internal game console?

As I said earlier, I’m not familiar with consoles, so I didn’t know what to test. But just out of curiosity:

  • I typed in it “test”, and I got a message saying “Player 0 sends a message: test”
  • I typed in it “save”, and VCMI crashed.

DT_drawtext.h is not needed. I folded it into CConsole.h.

That console is both a system and game console. ie. where you can type debug command or issue cheats. So the existing in game console is for chat only. I believe both are two different concepts and as such should be split. The old console is only there to spit out debug messages, doesn’t get keyboard input anymore and eventually should go away.

Zamolxis, “save” takes a file name. The current code to process commands doesn’t check anything :slight_smile:

btw there are 3 consoles counting chat 1 hidden from players in game console probably for erm though i dunno if it is. it jumped out few times only with newest patch script for wog i wonder what was that heh o;
2nd from wog cheat console pretty cool thing ;o
just wondering if it will be merged somehow (well 1st console is hidden so it shouldn’t matter :P)

Can we consider it as “official” 0.74b dev.release and test/report based on it, or do you prefer that we continue testing on 0.74?

EDIT: After running into some major issues (AI doesn’t move creature in battle + crashes whenever we try to cast a spell), I think I’m gonna answer the question myself: better stick with 0.74 until Tow checks the patches, and perhaps even announce the dev.release more formally on the forum [be that an improved 0.74b or simply 0.74c]. :wink:

Use 0.74 if possible, especially for crashbugs. This 0.74b was a quick build to allow testing the console, I haven’t stored debug symbols for this build, so dumps from it would be worthless. However it can be used to check if issues said to be fixed are really fixed. If you notice by the way any new regressions, please also report them.

I’m still going to make “real” dev release, with more fixes and changelog but I’m now unable to say when it’ll be ready. (Time, time, time… and there are still a lot of things I want to do).

In CMT.cpp still remains include for DT_drawtext.h. In should be removed then.
I’ve also a found a little typo - bool DT_Font::loadFont returns -1 on error (should return false).
Btw what about using TTF/original H3 fonts instead of that DT_fonts? Do we need special font type for console?

I would definitely keep the old system console available for input. It has proven for me to be useful in debugging. It still remains available (sometimes even for input!) when the main or GUI threads are blocked or crashed. It’s way more useful feature for debugging then alpha blending or command completion. (Though for in-game debugging that would be also useful)
I’d keep both consoles, and rather would integrate the new one with internal game chat if I had to remove one.