www.ClassicTW.com
https://mail.black-squirrel.com/

Swath displays totally buggared
https://mail.black-squirrel.com/viewtopic.php?f=52&t=31752
Page 1 of 2

Author:  Cruncher [ Fri Jun 24, 2011 7:38 am ]
Post subject:  Swath displays totally buggared

Don't know what happened this morning, it it's Swath or a change in the beta that Swath does not like. Game was totally unplayable in Swath, but switching to Zoc it was just fine.

Sending screen cap to JP & Stein via e-mail. Won't translate well here.

Author:  -=orion=- [ Fri Jun 24, 2011 11:02 am ]
Post subject:  Re: Swath displays totally buggared

It looks like it jumps your cursor up on the screen and writes over top of all the previous screens...

Author:  Crosby [ Fri Jun 24, 2011 4:41 pm ]
Post subject:  Re: Swath displays totally buggared

Agreed, Swath isn't ready for the BETA.

Author:  HiTechRedneck [ Fri Jun 24, 2011 9:17 pm ]
Post subject:  Re: Swath displays totally buggared

I'm running Swath through TWX and have no issues with either one working with the beta...

Author:  rem0te [ Fri Jun 24, 2011 9:47 pm ]
Post subject:  Re: Swath displays totally buggared

I too today have seen strange display issue in Swath today. For some reason it keep scrolling back to the top >_>

Never happened before.

Its one day from expiring anyway so I don't really care, but I just wanted to let you know you were not the only one to observe strange swath behavior.

Author:  Cruncher [ Fri Jun 24, 2011 9:52 pm ]
Post subject:  Re: Swath displays totally buggared

I sent my debug file to Stien this evening.

I haven't heard from JP yet, so don't know if this is only on the beta server or not. It seems so.

But I have no idea what's changed since yesterday.

Author:  Cruncher [ Fri Jun 24, 2011 10:18 pm ]
Post subject:  Re: Swath displays totally buggared

OK, it was working fine for the most part this evening, hitting # to see who's online messed it up again.

Like Orion said, it jumps to the top of the scroll back then seem to lay current display over scroll-back display.

Pulling the scroll bar back down, and the display is locked at the beginning of pulling Who's Playing.

I disconnected Swath from TWX and reconnected - works again. I can pull who's online again and it does not get hung-up this time.

Author:  John Pritchett [ Sat Jun 25, 2011 2:48 am ]
Post subject:  Re: Swath displays totally buggared

Ok, I know what's going on here. I was using Putty for some tests and I noticed that whenever an ANSI clear screen command is issued, Putty doesn't move the cursor to the top-left. I did some research and found out that DOS ANSI.SYS moves the cursor to the upper left with a clear-screen command (#27[J), but the standard behavior does not do this. To guarantee that any terminal homes the cursor and clears the screen, you need to send a home command (#27[H), followed by a clear command (#27[2J) which clears from cursor to end of screen. I thought I'd try that and see if it causes any problems. Obviously it does in at least this one case.

I'm not quite sure how this caused a problem, but it seems obvious that it's the cause of what you're seeing. I'm curious how it worked before with just the clear-screen command. There are many places in the game where the screen is cleared and the cursor moves to the upper-left corner of the screen. Does Swath ever home the cursor and clear the screen? This would be inconsistent with the intended output, but far less disruptive than homing the cursor without clearing the screen, which is what it appears to be doing in response to the HOME-CLRSCR sequence.

I wonder if there's any way to provide this fix for those clients that will work properly with it (Putty for one) without jacking up Swath. I'll see if there's any way to detect the client and send the HOME when appropriate and skip it when not.

Author:  Micro [ Sat Jun 25, 2011 3:27 am ]
Post subject:  Re: Swath displays totally buggared

I would recommend sending the clear command (#27[2J) first, followed by the cursor position command (#27[1;1H). I would also include the row 1, column 1. I know they are supposed to be optional, but swath may not be handling them correctly when omitted.

Author:  -=orion=- [ Sat Jun 25, 2011 10:28 am ]
Post subject:  Re: Swath displays totally buggared

Is this going to be fixed soon...tough to play...easy to get #SD# without even knowing what happened...Nice job Farley...lol

Author:  John Pritchett [ Sat Jun 25, 2011 1:12 pm ]
Post subject:  Re: Swath displays totally buggared

The clear screen command clears from cursor to end of screen, so on properly implemented clients, the TW clear screen command really doesn't do anything, which is why it has gone unnoticed. It's not a major issue if the screen isn't homed and the screen cleared. It's not aesthetically what the output should be, but it continues without becoming garbled.

Actually, reversing the commands and clearing, then moving to home would just guarantee that all clients work as poorly as Swath does, moving the cursor to home and then overwriting existing output.

I guess the right approach here is to recognize that if a client emulates the DOS ANSI clear screen, then the cursor will move to top left and the screen will clear. You'll see this behavior in Windows Telnet as well as the TWGS Spy and Shell windows, and I'm sure many other ANSI-emulated terminals. But if this behavior is not implemented, either the screen will clear and the text will continue to write to the bottom of the screen (Putty) or the screen will not clear and text will continue to write to the bottom of the screen (I think this is what Swath is doing), but in either case, the output will still be perfectly legible.

So chalk this up to a bug that not important enough to fix because the fix creates its own set of problems.

Author:  Micro [ Sat Jun 25, 2011 3:39 pm ]
Post subject:  Re: Swath displays totally buggared

http://en.wikipedia.org/wiki/ANSI_escape_code
"Clears part of the screen. If n is zero (or missing), clear from cursor to end of screen. If n is one, clear from cursor to beginning of the screen. If n is two, clear entire screen (and moves cursor to upper left on MS-DOS ANSI.SYS)."

Author:  Micro [ Sat Jun 25, 2011 3:46 pm ]
Post subject:  Re: Swath displays totally buggared

TWHELLO.ANS uses:

#27[40m #27[2J #27[3;2H #27[0;34m

Author:  John Pritchett [ Sat Jun 25, 2011 3:52 pm ]
Post subject:  Re: Swath displays totally buggared

Right. And I'm using 2J, so it should clear the entire screen. The issue with swath seems to be that it doesn't clear the screen at all, not that it isn't moving the cursor. If I send the H command, it does move the cursor, but then it overwrites the existing screen without clearing. So the problem is that Swatch doesn't seem to implement screen clearing at all. I'm just guessing based on screen shots sent to me. I don't have it at the moment.

I wonder if Swath supports #27[J but not #27[2J. If that's the case, then I could home the cursor, then issue #27[J and it would work. Seems more likely they'd support the J but not 2J since they seem to properly support #27[H. Might be worth a quick try.

Interestingly, when I was researching this issue for Putty, I came across a request for Putty to support DOS ANSI behavior (at least as a setting), and the reason was given that it would better support TradeWars ;) It would be nice to work better with Putty if Putty can't be made to work better with TW. I know it's a popular client.

You mention the sequence used by TWHELLO.ANS. Does that display properly on Swath? From what I've seen, Swath should jump up to cursor position 3,2 and start drawing over whatever is currently on the screen. But since it floods the screen pretty quickly, I don't think it would be noticed as a problem.

Author:  John Pritchett [ Sat Jun 25, 2011 4:01 pm ]
Post subject:  Re: Swath displays totally buggared

You know what, this isn't so cut and dried. That's the only thing I changed that could have had this kind of effect, but I just installed Swath to see for myself and it's behavior is pretty much normal so far. Clearing the screen and homing the cursor just fine. So something else is at work here. I'll see if I can repro this and get back to you. Any clarification on how to consistently get this behavior to show up would be helpful.

Page 1 of 2 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/