Feature - Implemented Matching location names between KoL and KoLmafia

lostcalpolydude

Developer
Staff member
There are plenty of locations that use shortened names in KoLmafia. With the Florist Friar, there is a reason to make location names match. My plan is to get a list that covers at least the majority of those that need changing so they can be changed all at once. I also want to make a list of locations where KoL uses identical names to have as a reference.


Places that need changing
Goatlet => The Goatlet
Ninja Snowmen => Lair of the Ninja Snowmen
Fantasy Airship => The Penultimate Fantasy Airship
Giant's Castle (Basement) = > Castle in the Clouds in the Sky (Basement)
Giant's Castle (Ground Floor) = > Castle in the Clouds in the Sky (Ground Floor)
Giant's Castle (Top Floor) = > Castle in the Clouds in the Sky (Top Floor)
Greater-Than Sign = > Enormous Greater-Than Sign
Haunted Pantry => The Haunted Pantry
Haunted Kitchen => The Haunted Kitchen
Haunted Conservatory => The Haunted Conservatory
Haunted Library => The Haunted Library
Haunted Billiards Room => The Haunted Billiards Room
Haunted Gallery => The Haunted Gallery
Haunted Bathroom => The Haunted Bathroom
Haunted Bedroom => The Haunted Bedroom
Haunted Ballroom => The Haunted Ballroom
Haunted Wine Cellar (automatic) => The Haunted Wine Cellar (automatic) not required, but good for consistency
Haunted Wine Cellar (Northwest) => The Haunted Wine Cellar (Northwest)
Haunted Wine Cellar (Northeast) => The Haunted Wine Cellar (Northeast)
Haunted Wine Cellar (Southwest) => The Haunted Wine Cellar (Southwest)
Haunted Wine Cellar (Southeast) => The Haunted Wine Cellar (Southeast)
Spooky Forest => The Spooky Forest
Hidden Temple => The Hidden Temple
Pirate Cove => The Obligatory Pirate's Cove
Battlefield (Frat Uniform) => The Battlefield (Frat Uniform)
Battlefield (Hippy Uniform) => The Battlefield (Hippy Uniform)
The Domed City of Ronaldus => Domed City of Ronaldus
The Domed City of Grimacia => Domed City of Grimacia
Outskirts of The Knob => The Outskirts of Cobb's Knob
Bat Hole Entryway => The Bat Hole Entrance
Defiled Alcove => The Defiled Alcove
Defiled Nook => The Defiled Nook
Defiled Cranny => The Defiled Cranny
Defiled Niche => The Defiled Niche
Barn => McMillicancuddy's Barn
Pond => McMillicancuddy's Pond
Back 40 => McMillicancuddy's Back 40
Other Back 40 => McMillicancuddy's Other Back 40
Granary => McMillicancuddy's Granary
Bog => McMillicancuddy's Bog
Family Plot => McMillicancuddy's Family Plot
Shady Thicket => McMillicancuddy's Shady Thicket


Places where KoL uses the same name for multiple locations
The Arid, Extra-Dry Desert
The Misspelled Cemetary
The Orcish Frat House


Places where KoL needs to use a better name
[DungeonFAQ - Level 1] (and probably 2 and 3)
 
Last edited:
Defiled Alcove => The Defiled Alcove
Defiled Nook => The Defiled Nook
Defiled Cranny => The Defiled Cranny
Defiled Niche => The Defiled Niche

(Full disclosure: I've only actually checked the Alcove.)
 
A side effect: it will wipe out the adventure queue info for those zones. Not that i think anyone was using it for mission critical stuff, but heads up.

There's a function to automatically add new zones to the serialized queue, but we don't check for removal... Should probably do that or that's a few bytes permanently orphaned in the hashmap. Not an enormous deal but good to be on top of it.
 
Oh right, breaking the queue tracking, that was a thing I thought about but forgot to mention. Another important reason to change all of these at once rather than over time.
 
So, these changes (esp giant's castle -> castle in the clouds) are going to break a lot of scripts. Can we do something like deprecate the old names? Or just the subset of them that changed by more than an article? Print a warning at interpret-time or somesuch that the script should migrate to the new name and the old name will eventually be removed.

I know it's (a lot) more work to do that but it really might be worth it.
 
Make the official names be, for example, "Castle in the Clouds in the Sky (Top Floor)".

to_location( "Castle in the Clouds in the Sky (Top Floor)") -> $location[Castle in the Clouds in the Sky (Top Floor)]

to_location( "Giant's Castle (Top Floor)" ) ->$location[Castle in the Clouds in the Sky (Top Floor)]
$location[ Giant's Castle (Top Floor)] ->$location[Castle in the Clouds in the Sky (Top Floor)]

If we want to "deprecate" the old names, those last two would print a warning.

All the work would be in DataTypes.parseLocationValue().

I think that would make old scripts just work, unless they do something like this:

loc x = $location[ "Giant's Castle (Top Floor)" ]
if ( to_string( x) == "Giant's Castle (Top Floor)" )

rather than

loc x = $location[ "Giant's Castle (Top Floor)" ]
if ( x == $location[ "Giant's Castle (Top Floor)" ] )

In other words, doing comparisons on the string value - the name - of locations, rather than against location contents. Considering that we allow abbreviated names already:

> ash to_string( $location[ briny deeps ] )
Returned: The Briny Deeps

... such programs are already suspect.
 
That sounds exactly like what I was thinking. Great.

The only "gotcha" is that we have to make sure that the old names don't interfere with substring matching of the new names. Like "haunted bathroom" should just match "the haunted bathroom" and not the old name. So we first match against the new names, only if we find zero matches do we then match against the deprecated names.
 
AdventureArray.find() in AdventureDatabase looks like the right place to put that check. An additional array or map or something should be made for checking when matchingNames.size() == 0, meaning nothing was found in nameArray.

I've been editing locations as I find them (and that others post) directly into the first post.
 
Veracity had the starting point down, I just followed it to find specifically what part of that function call was a good place to modify (the function I listed is indirectly called by the one Veracity listed).
 
Edge of the Swamp -> The Edge of the Swamp
Dark and Spooky Swamp -> The Dark and Spooky Swamp
Corpse Bog -> The Corpse Bog
Ruined Wizard Tower -> The Ruined Wizard Tower
Wildlife Sanctuarrrrrgh -> The Wildlife Sanctuarrrrrgh
Weird Swamp Village -> The Weird Swamp Village
 
I find it interesting that KoL thinks that the article is part of the name for locations but the opposite for monsters...
 
I find it interesting that KoL thinks that the article is part of the name for locations but the opposite for monsters...

It's inconsistent in both cases, actually. For a few locations, mafia needs to remove an article that has been there for a long time.
 
This patch is what I have so far, with a few debugging lines left in. I thought this should be working, but old location names aren't recognized like I would expect. Of note is that "marker 1" is reached, but getMatchingNames() is returning 0 matches (so "marker 2" isn't reached), when I'm testing with $location[Giant's Castle (Basement)] and I have a debugging line specifically to show that value being in the array that's checked.

I'm not too sure how well that patch will work. NetBeans is pretty bad at making patches (or I just don't know how to do it), so I ended up patching together individual diffs and hopefully got the headers right. I wanted to use TortoiseSVN, but it wants SVN repositories at 1.8 (I think) and NetBeans doesn't seem to handle those too well yet.
 

Attachments

I'm not too sure how well that patch will work. NetBeans is pretty bad at making patches (or I just don't know how to do it), so I ended up patching together individual diffs and hopefully got the headers right. I wanted to use TortoiseSVN, but it wants SVN repositories at 1.8 (I think) and NetBeans doesn't seem to handle those too well yet.

I have not figured out how to make Netbeans happy with SVN 1.6. Tortoise will update everything to 1.8 if you let it. I am juggling two computers and SVN installations that are at 1.6, 1.7 and 1.8 because of work and non-work projects. I have found that if I only issue SVN commands fror KoLmafia within Netbeans things work.

I seem to recall having success making a patch from within Netbeans in the sense that the patch worked for other people. The key thing was that Netbeans needed to be at the src directory (or perhaps one level higher) when the patch started. I can confirm if you need me to.
 
Adding in toLowerCase() in the right place fixed things. The current usage looks like:

> ash $location[giant castle (basement)]

The string "giant castle (basement)" no longer matches a location name; use "Castle in the Clouds in the Sky (Basement)" instead
Returned: Castle in the Clouds in the Sky (Basement)
Does that look good? I'll wait another day before committing this in case something else occurs to me to improve the code.
 
Dark Neck of the Woods => The Dark Neck of the Woods

I assume the Heart and Elbow need the same changes, but I've finished the Friar quest so I can't check.
 
Back
Top