Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old January 11, 2012, 21:21   #1
Tobias
Adept
 
Tobias's Avatar
 
Join Date: Dec 2009
Posts: 172
Tobias is on a distinguished road
Notes (: command) getting truncated in dump

I tried to use the : command to document the progress through my first v4 game.
But I noticed that the notes get truncated after a certain length.
While I am writing them there is a different cutoff, which allows around 10 characters more than end up in the dump.

So probably the cutoff while writing should be reduced to the cutoff used while dumping.

Here is the diary itself:
http://angband.oook.cz/ladder-show.php?id=12250
__________________
My Angband videos : http://www.youtube.com/view_play_lis...385E85F31166B2
Tobias is offline   Reply With Quote
Old January 12, 2012, 12:40   #2
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by Tobias View Post
I tried to use the : command to document the progress through my first v4 game.
But I noticed that the notes get truncated after a certain length.
While I am writing them there is a different cutoff, which allows around 10 characters more than end up in the dump.

So probably the cutoff while writing should be reduced to the cutoff used while dumping.
This is harder than it sounds, because one includes the character's name, and the other doesn't. Since the code doesn't know the length of the character's name, it's impossible to get an exact match. But now I come to think of it, I don't really see why the name is in there at all. I'm not overly familiar with this piece of code and therefore reluctant to change it, but wonder if any other devs (or anyone else familiar with it, such as variant writers) think it could be dispensed with. Then we could use the same size limit for both buffers.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old January 14, 2012, 02:34   #3
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 38
Posts: 1,516
d_m is on a distinguished road
I think this relates to a cute feature I added awhile back.

I will try to fix it or revert.
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old January 15, 2012, 08:41   #4
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by d_m View Post
I think this relates to a cute feature I added awhile back.

I will try to fix it or revert.
Thanks d_m - opened as #1615.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old February 7, 2012, 02:26   #5
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 38
Posts: 1,516
d_m is on a distinguished road
So looking at this it is a lot more complicated than I anticipated.

Basically, here is the pipeline:

1. Get the note from the user
2. Do some cute processing on note to expand /me and /say
3. Write note to log
4. Save note to history
5. Display history when writing character dump

Each of these steps actually uses it's own buffer/buffer size. I can remove step #2 but that isn't actually the problem in this case (in fact I doubt many people even knew about it).

The real issue is that #4 saves the first 80 characters of the note (i.e. all of it), but the way #5 works it ends up truncating the note (due to the way it formats those lines) to (I think) the first 63 characters. I think the original note is limited to 70 characters of input + 3 characters of prepended text.

I guess what I am saying is that there isn't a lot of consistency in the way these things are handled and that I am not promising to come up with a "nice" fix for the problem.
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old February 7, 2012, 11:05   #6
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by d_m View Post
So looking at this it is a lot more complicated than I anticipated.

Basically, here is the pipeline:

1. Get the note from the user
2. Do some cute processing on note to expand /me and /say
3. Write note to log
4. Save note to history
5. Display history when writing character dump

Each of these steps actually uses it's own buffer/buffer size. I can remove step #2 but that isn't actually the problem in this case (in fact I doubt many people even knew about it).

The real issue is that #4 saves the first 80 characters of the note (i.e. all of it), but the way #5 works it ends up truncating the note (due to the way it formats those lines) to (I think) the first 63 characters. I think the original note is limited to 70 characters of input + 3 characters of prepended text.

I guess what I am saying is that there isn't a lot of consistency in the way these things are handled and that I am not promising to come up with a "nice" fix for the problem.
IMO the problem is at step 5. The history display is quite lazy, and assumes that every history item must fit onto one line. If history_display were re-written to spread history entries over two lines where necessary, this problem would go away without compromising the cuteness of the notes functionality ;-)
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old February 7, 2012, 11:21   #7
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,650
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by Magnate View Post
IMO the problem is at step 5. The history display is quite lazy, and assumes that every history item must fit onto one line. If history_display were re-written to spread history entries over two lines where necessary, this problem would go away without compromising the cuteness of the notes functionality ;-)
...which ISTR NPP notes used to (and possibly still) do.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old February 7, 2012, 12:01   #8
nppangband
NPPAngband Maintainer
 
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
nppangband is on a distinguished road
Quote:
Originally Posted by Nick View Post
...which ISTR NPP notes used to (and possibly still) do.
Correct, NPP splits the note into multiple lines if necessary. The code that does this starts at line 3721 in cmd.4 inside the do_cmd_note function.
__________________
NPPAngband current home page: http://nppangband.bitshepherd.net/
Source code repository:
https://github.com/nppangband/NPPAngband_QT
Downloads:
https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57
nppangband is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse Suppotr Notes Blue Baron Development 3 December 11, 2011 07:51
Notes/History StephenR Vanilla 0 February 22, 2009 11:47
Code: Notes live where? camlost Vanilla 4 February 20, 2009 21:11
Comp #61 notes Donald Jonker Competition 37 November 29, 2008 18:45
Notes Patch Narvius Vanilla 12 August 8, 2008 20:50


All times are GMT +1. The time now is 12:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.