Angband.oook.cz
Angband.oook.cz
AboutDownloadVariantsLadderForumCompetitionSpoilersComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old June 17, 2010, 23:21   #1
half
Knight
 
half's Avatar
 
Join Date: Jan 2009
Posts: 872
half is on a distinguished road
Truncation of monster names

In my proto-variant, I have had a longstanding bug with monsters' names being truncated. For example, at one point

White worm mass

appeared as:

Wh

and now the white worm masses were fine but

Metallic green centipede

appears as

Me

I'm pretty sure it has also happened with more than two characters in the string before getting cut off.

Has anyone had this happen to them before? It strikes me that somehow a NULL character is getting written into the text descriptions or something like that. It mainly happens on my Windows build (the same creature getting mangled for each playtester in a given development version), but I have had the problem once on my Mac build.

Any ideas?
half is offline   Reply With Quote
Old June 18, 2010, 01:25   #2
zaimoni
Knight
 
zaimoni's Avatar
 
Join Date: Apr 2007
Posts: 590
zaimoni is on a distinguished road
Yes, there's a fairly awful hack in data loading dating back to the initial conversion to data files: all of the strings for monster names are stuffed into a single long C array containing the NUL-terminated representation of the strings in sequence. There's a few other instances. Look for ?_name and ?_text global variables for the large arrays, and name and text fields within *_type structs for offsets into these arrays.

It sounds like the construction and/or offsets into these arrays isn't going perfectly.
__________________
Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011
zaimoni is offline   Reply With Quote
Old June 18, 2010, 04:01   #3
Twilight
Apprentice
 
Twilight's Avatar
 
Join Date: Jan 2009
Location: Sweden
Posts: 57
Twilight is on a distinguished road
Quote:
Originally Posted by half View Post
In my proto-variant, I have had a longstanding bug with monsters' names being truncated. For example, at one point

White worm mass

appeared as:

Wh

and now the white worm masses were fine but

Metallic green centipede

appears as

Me

I'm pretty sure it has also happened with more than two characters in the string before getting cut off.

Has anyone had this happen to them before? It strikes me that somehow a NULL character is getting written into the text descriptions or something like that. It mainly happens on my Windows build (the same creature getting mangled for each playtester in a given development version), but I have had the problem once on my Mac build.

Any ideas?
This seems like it might be the old "Blu" bug. The thread:
http://forum.nppangband.org/viewtopic.php?id=151
gives a fix - at least for NPP. Hopefully it's the same bug and this helps.
Twilight is offline   Reply With Quote
Old June 18, 2010, 09:15   #4
half
Knight
 
half's Avatar
 
Join Date: Jan 2009
Posts: 872
half is on a distinguished road
Quote:
Originally Posted by Twilight View Post
This seems like it might be the old "Blu" bug. The thread:
http://forum.nppangband.org/viewtopic.php?id=151
gives a fix - at least for NPP. Hopefully it's the same bug and this helps.
Thanks Twilight. You have saved me a lot of array out of bounds debugging. That is almost certainly the same bug. It looks like my code forked off from NPP between the fix to load.c and the fix to birth.c. I've now removed the troublesome line, and all should be fine (I can't check without a windows box, but will do so in a week or so).
half is offline   Reply With Quote
Old June 19, 2010, 01:08   #5
Twilight
Apprentice
 
Twilight's Avatar
 
Join Date: Jan 2009
Location: Sweden
Posts: 57
Twilight is on a distinguished road
Quote:
Originally Posted by half View Post
Thanks Twilight. You have saved me a lot of array out of bounds debugging. That is almost certainly the same bug. It looks like my code forked off from NPP between the fix to load.c and the fix to birth.c. I've now removed the troublesome line, and all should be fine (I can't check without a windows box, but will do so in a week or so).
Luckily I just started playing *bands again and checking the angband forums/r.g.r.a etc after years away in time to recognize this one. Glad to have been of help.
Twilight 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
monster speed PowerDiver Vanilla 2 September 10, 2009 17:42
Least Favorite Monster ehertlein Vanilla 51 May 23, 2009 20:29
Interesting scroll names. Whelk Vanilla 5 May 14, 2008 10:51
Monster AI Malak Darkhunter Vanilla 3 December 9, 2007 07:05
Item names Kiyoshi Aman Vanilla 3 May 5, 2007 23:01


All times are GMT +1. The time now is 19:22.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.