Kromtec / LegendsViewer

Recreates Dwarf Fortress' Legends Mode from exported files.
GNU General Public License v3.0
62 stars 19 forks source link

Duplicate Site Government Names Potentially Messing With Site Ownership #37

Closed zackman0010 closed 6 years ago

zackman0010 commented 6 years ago

I have a save in which there are two entirely separate human civilizations on opposite ends of the map. However, these two civilizations both have a site government with the same name. For some reason, this has caused some problems with the site ownership of the cities owned by that site government. Legends Viewer says that both cities are owned by both civilizations at once. This leads to some visual errors on the world map. I have a much better bug report prepared along with the save file and the export data (exported with DFHack), but I'm in a place with bad Internet at the moment. I will upload that and share a link here when I have better Internet. Until then, I made a much more basic report in Paint: https://imgur.com/a/OuUqiwH Disclaimer: Yes, I am using Masterwork, and yes, I know that it's buggy. However, I do not believe this problem is related to Masterwork. I explored through the legends.xml file myself, and I found no link between the site government of the second civ and the city.

Kromtec commented 6 years ago

Current site ownership is not based on the xml but on the information from the regionx-xxxxx-xx-xx-world_sites_and_pops.txt file. The owner is unfortunately only mentioned by name and not by ID in this file, which can lead to such (rare) cases. This file is sadly the single source where I can get this information, because the xml only includes information about some events when sites are founded, destroyed and so on but nothing reliable about the current owner.

zackman0010 commented 6 years ago

Ah, I understand. I assume that at some point you’re reading all the legends.xml information. Would it be possible to do some form of manual linking using the information contained in the legends file? For example: detect when there’s two site governments with the same name, keep track of their IDs, then use the Site Created/Reclaimed/etc events to both link a specific civilization to that site government (as those list the Civ ID as well) and keep track of the actual owner of the site. This is just an off the top of my head thought. I haven’t looked at the code so correct me if my assumption is wrong.

Kromtec commented 6 years ago

Can you provide the exported files? I will try to improve this part of the code. _regionx-xxxxx-xx-xx-legends.xml regionx-xxxxx-xx-xx-legends_plus.xml regionx-xxxxx-xx-xx-world_history.txt regionx-xxxxx-xx-xx-world_map.bmp regionx-xxxxx-xx-xx-world_sites_andpops.txt

zackman0010 commented 6 years ago

Had to upload the files on MediaFire. Couldn't upload a RAR here, but archiving as a ZIP would've made it too big to upload on this internet. http://www.mediafire.com/file/8x93xsd1zmi2bau/PerfectWorld.rar World was named PerfectWorld because I created it with the Perfect World program. The archive also contains a Line Numbers.txt file, which I made while manually searching the legends.xml file myself. It shows the line numbers of the relevant entries: the civilizations, the site governments, and the town.

Kromtec commented 6 years ago

Thanks and special thanks for even including the line numbers! :+1:

Kromtec commented 6 years ago

improvements made in v1.19.09