#nuvie@irc.freenode.net logs for 6 Aug 2007 (GMT)

Archive Today Yesterday Tomorrow
Nuvie homepage


[00:07:55] <luteijn> ah, io.stderr:write() fixes that.
[00:11:55] <luteijn> Screen.cpp is using C++ style cout<<
[00:12:30] <SB-X> are you changing everything to use stderr?
[00:13:33] <luteijn> yes, to check if it is feasable.. I doubt if it would be smart to commit it...
[00:15:31] <SB-X> well, I don't mind... since I also thought everything should go to stderr
[00:15:49] <SB-X> I suppose if you change *everything* then there shouldn't be a problem. :)
[00:16:14] <SB-X> it means nobody else has to
[00:16:27] <luteijn> so far there's no mayor issues, just a lot of changes in about half the files.
[00:17:13] <SB-X> another big change needed sometime is to remove all MsgScroll::display_prompt calls
[00:17:28] <luteijn> maybe Eric has a good reason to prefer stdout?
[00:17:33] <SB-X> yeah that's possible
[00:18:06] <SB-X> which is probably why i havnt bothered to change any output to stderr
[00:26:43] <luteijn> what's wrong with the display_prompt calls? duplicated functionality?
[00:28:52] <SB-X> it turns out that the prompt should only be displayed automagically when it's the player's turn, not manually after every message
[00:31:23] <SB-X> so I guess it should be done in ActorManager::stopActors, although it would make sense to go in Player too (but there's currently no Player::your_turn function)
[00:32:24] <SB-X> or even Game::unpause_user
[00:32:55] <SB-X> not sure really
[00:33:50] <SB-X> also now that I think of it, MsgScroll would need some kind of flag to tell whether any text has been output since the last prompt, and not print double prompts
[00:33:55] <luteijn> looks like most of the display_prompt() calls are in Event.cpp anyway.
[00:34:25] <SB-X> Event just has an overabundance of them :)
[00:35:06] <SB-X> a better intermediate is to change MsgScroll::display_prompt to set a "want_prompt" flag instead of displaying the prompt
[00:35:29] <SB-X> intermediate change*
[00:36:38] <SB-X> and something else could pick that up and display the prompt when ready, then later we can delete display_prompt when the new method is working properly
[00:48:31] <luteijn> dumping the message scroll to stdout looks quite nice, even in the crude form of a cout<<msg_text->s in display_string
[00:49:06] <SB-X> cool
[00:49:23] <SB-X> without timestamps though it can be hard to synchronize stderr and stdout
[00:51:42] <luteijn> You mean when debuggind scroll output?
[00:53:46] <SB-X> Yes, conversations specifically. Unless there is something verbose in the error message, I can see an error from ConverseInterpret, but not know what conversation in stdout resulted in it.
[00:54:58] <SB-X> but right now there are no conversations in stdout to link it to, so having some output there is much better than how it works now :)
[00:55:31] <luteijn> Hmm yes, stderr now has the 'Begin conversation with "Iolo" (npc 4)', but the actual conversation is going on over in stdout. I could dump it to cerr instead/too
[00:56:05] <SB-X> don't do that, then stderr get's too cluttered and it defeats the purpose of directing to stdout
[00:56:37] <luteijn> hmm the conversation only has one half, the player input is not written to the scroll in the same way.
[00:56:51] <SB-X> unless/until we have timestamps it will be sufficient to add some information to the error message about where in the script the error occured
[00:57:16] <SB-X> suggest you also put input to stdout (local echo) :)
[00:57:36] <luteijn> just have to figure out how input works ;)
[00:59:21] --> servus_ has joined #nuvie
[01:02:42] <-- servus has left IRC (Nick collision from services.)
[01:02:44] --- servus_ is now known as servus
[01:14:37] --> servus_ has joined #nuvie
[01:14:43] <-- servus has left IRC (Nick collision from services.)
[01:14:51] --- servus_ is now known as servus
[01:16:50] --> servus_ has joined #nuvie
[01:16:58] <-- servus has left IRC (Nick collision from services.)
[01:17:00] --- servus_ is now known as servus
[01:41:37] --> Kirben has joined #nuvie
[01:45:16] <luteijn> Ok, a cout<<s in MsgScroll::get_input() seems to work for getting the other side of conversations in.
[04:27:59] --> servus_ has joined #nuvie
[04:28:32] <-- servus has left IRC (Nick collision from services.)
[04:28:43] --- servus_ is now known as servus
[05:41:58] <SB-X> time to go
[05:42:01] <SB-X> cya
[05:42:14] <-- SB-X has left IRC ("*casts gate travel*")
[06:37:10] --> servus_ has joined #nuvie
[06:55:07] <-- servus has left IRC (Read error: 110 (Connection timed out))
[07:07:56] --- servus_ is now known as servus
[07:39:01] <-- Kirben has left IRC ()
[08:04:53] --> Kirben has joined #nuvie
[08:37:42] --> Yuv422 has joined #nuvie
[10:09:26] <luteijn> Hi Yuv422; did you have a special reason for using stdout for debugging messages? Do you mind if it gets changed to stderr instead?
[10:37:27] <Yuv422> hey luteijn
[10:37:39] <Yuv422> I'm not fussed either way
[10:37:58] <Yuv422> but I guess I would like a standardised approach
[10:38:21] <Yuv422> I was thinking of having something that could be disabled at compiler level
[10:38:53] <Yuv422> a macro that generates no code if debugging isn't sellected
[10:40:48] <luteijn> at the moment I have a macro. Eventually it could propably be extended into something with a debug-level and a cut-off value, or debug-bitvector.
[10:43:53] <Yuv422> sounds good
[10:44:38] <Yuv422> do you think we should output all messages together with a message type
[10:44:42] <Yuv422> eg
[10:45:05] <Yuv422> DEBUG: obj->obj_n = 88
[10:45:14] <Yuv422> MSG: Loaded Map
[10:45:33] <Yuv422> WARN: invalid map coord
[10:45:42] <Yuv422> ERROR: failed to load objlist!
[10:45:58] <Yuv422> then could see everything in the one contex
[10:46:00] <Yuv422> +t
[10:47:07] <luteijn> probably something like PERR(level,x...) where level would be DEBUG/MSG/etc. and x the printf-format and arguments. the PERR could (optionally timestamp it and print it to the log.
[10:47:59] <Yuv422> cool
[10:48:18] <Yuv422> I guess we really just need the option to show all or nothing at the moment
[10:49:20] <luteijn> my current change will sort of do that (change the macro to something harmless at compile time, or use 2> to redirect stderr to /dev/null)
[10:50:06] <luteijn> there is a few cases where cerr<< (was cout<<) is used for output instead.
[10:51:21] <Yuv422> I think the first step is to standardise the current debug messages
[10:52:39] <luteijn> yes, they all need a level/severity/type or whatever you want to call it assigned to them, and maybe some need to be rephrased.
[10:55:28] <luteijn> ok, committed. Hopefully it doesn't break things on other platforms.
[11:00:42] <Kirben> Most of the output goes to stderr.txt, instead of stdout.txt now, is that mean to happen?
[11:04:20] <luteijn> yes, that was the main change. stdout should have the message-scroll text (and anywhere I missed current debug messages)
[11:05:08] <luteijn> if you get any debug output (so non-message scroll text) in stdout, it is something I'd want to know ;)
[11:06:36] <Kirben> I still get 'Magic init' and 'Init Magic:...' in stdout.txt
[11:07:49] <luteijn> Hmm did the scripts get updated?
[11:09:34] <Kirben> That was it, I only copied over the new executable.
[11:10:02] <Yuv422> Kirben: are you still getting your crash on startup?
[11:10:55] <luteijn> Oh, and there is a question about building on win32 in the forum.
[11:13:04] <Kirben> Yuv422: No, the crash on startup is gone, but still get the crash on quiting.
[11:13:12] <Kirben> I noticed, but I compile with mingw, and not Microsoft Visual Studio.
[11:13:57] <Yuv422> I'll have a look
[11:14:04] <Yuv422> at the crash that is
[11:14:16] <Yuv422> I don't have visual studio
[11:15:34] <luteijn> actually Kirben's crashes triggered the changing of the diagnostic output, as SB-X mentioned wanting more debug messages..
[11:18:33] <Yuv422> :)
[11:39:46] <Yuv422> I wonder if I can compile it with cygwin and still get a crash
[11:57:51] <Kirben> Just use the '-mno-cygwin' option for mingw compile, under Cygwin.
[11:58:20] <Yuv422> righto
[12:36:27] --> servus_ has joined #nuvie
[12:50:50] <-- servus has left IRC (Read error: 110 (Connection timed out))
[13:21:39] <Yuv422> hehe I could have made nuvie crash the same way on my PPC
[13:21:42] <Yuv422> oh well
[13:21:57] <Yuv422> it was setting show_eggs to no
[13:21:57] <Yuv422> that caused the crash
[13:22:00] <Yuv422> double free
[13:22:07] <Yuv422> on the egg objects
[13:22:59] <Yuv422> it could also cause a crash on a new game with the removable gargoyle egg
[13:24:39] <wjp> ah, I see
[13:26:17] <Yuv422> I think we used to remove eggs from the map when show eggs was false
[13:26:32] <Yuv422> we now use the invisible flag
[13:26:48] <Yuv422> and chuck them on the map with everything else
[13:49:41] <Yuv422> ok my Obj changes and crash fix are in cvs now
[13:54:51] <luteijn> Good thing at least someone doesn't run with the show_eggs on all the time...
[13:59:47] <Yuv422> :)
[13:59:54] <Yuv422> ok I
[14:00:00] <Yuv422> I'm off to bed now
[14:00:03] <Yuv422> cya
[14:00:39] <-- Yuv422 has left IRC ()
[14:21:01] --> laxdragon has joined #nuvie
[14:59:33] --> servus has joined #nuvie
[15:15:40] <-- servus_ has left IRC (Read error: 110 (Connection timed out))
[15:20:25] <-- Kirben has left IRC (Read error: 110 (Connection timed out))
[17:49:09] --> SB-X has joined #nuvie
[21:36:25] --> Yuv422 has joined #nuvie
[22:03:37] <-- Yuv422 has left IRC ()
[22:25:44] <SB-X> alt-215 shows the time twice in the console :)
[22:42:05] --> servus_ has joined #nuvie
[23:00:03] <-- servus has left IRC (Read error: 110 (Connection timed out))
[23:11:55] --> servus has joined #nuvie
[23:29:23] <-- servus_ has left IRC (Read error: 110 (Connection timed out))