Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'invalid overmap special id "FakeSpecial_s_bike_shop_1"' on save load and while moving around #51856

Closed
ProfoundDarkness opened this issue Sep 24, 2021 · 4 comments · Fixed by #53702
Labels
<Bug> This needs to be fixed (P2 - High) High priority (for ex. important bugfixes) (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@ProfoundDarkness
Copy link
Contributor

ProfoundDarkness commented Sep 24, 2021

Describe the bug

Updated master this morning and compiled.
On save load got a few of this log snippet:
ERROR : src/generic_factory.h:445 [const T& generic_factory::obj(const string_id&) const [with T = overmap_special]] invalid overmap special id "FakeSpecial_s_bike_shop_1"

Also periodically while moving about.

Steps To Reproduce

  1. Have a save from a day or so ago. 8ba81b4 or older. Needs the overmap special mentioned above.
  2. Load the save on c5b0b84 or newer.
  3. Observe error message, assuming the overmap special had been generated for you in previous save.

Expected behavior

Not getting that error message...

Screenshots

No response

Versions and configuration

  • OS: Ubuntu 20.04
  • Tiles version
  • Version: Cataclysm DDA version 0.F-2777-gc5b0b8431c or newer
  • Basic mods (dda, no_npc_food, reduced fungal growth)

Additional context

The error is persistent, if I save and then load... guessing something missing related to migration?

To put some bounds on this...
Current Head: 75de031
My previous head (maybe): 8c55e1b

I didn't think it would take very long but had a lot of interruptions, anyway this was the result of the bisect:

c5b0b84 is the first bad commit

I've generated a save (involved overmap editing) on commit 8ba81b4 then moved to commit c5b0b84, loaded save, got the error.
DBG_BikeShop.zip

Was kind of hoping I might understand what was wrong but nope... Hopefully I've provided enough to make some sense of this and thus a fix (or maybe a save edit to purge the errors).

The error popping up while moving around/fighting is... a nuisance. I'm not fond of ignore further as I'm more likely to miss other errors.

@Termineitor244
Copy link
Contributor

This was introduced after #51729, the ID of the building was changed, so a migration was needed for the old ID in maps from before this change, it happens to me too (Confirmed).

@BrettDong BrettDong added (S2 - Confirmed) Bug that's been confirmed to exist <Bug> This needs to be fixed labels Sep 25, 2021
@ProfoundDarkness
Copy link
Contributor Author

ProfoundDarkness commented Sep 25, 2021

Thinking I might explore how a migration could work... I generated a new world on the current master and force generated both bike shop overmap specials (one with _1, one without that). As expected, no error on loading save (after saving and quitting). Inspecting the save however shows a complete lack of "fakespecial_.*?bike" in the map files. On the other hand there IS now specials simply called "s_bike_shop_1" so the whole FakeSpecial_ bit is gone.

As a test I decided to modify my old save. I used grepwin text search and replace all "special":"FakeSpecial_s_bike_shop_1" with "special":"s_bike_shop_1". No errors on my old save load. I then located a bike shop, I hadn't visited one yet so that might matter. Visiting via debug - long range teleport... it looks proper, from exploring the ones in my test world/save. As a bonus I finally figured out how to read more of the map data in json form.

How to turn this into a migration though... ? Item migration seems well documented with plenty of examples, this would be an overmap special migration so . I suppose those who know how can do the migration by hand as I did, I'd advise when doing anything like that to have a backup, as I did.

Still technically a bug due to missing migration but at least for myself personally it's apparently fixed, assuming I did that correctly.

@atealein
Copy link
Contributor

atealein commented Oct 9, 2021

This is a bit late, but might be useful to others. I used @ProfoundDarkness explanation to fix my save files and made a small script to use in future. The script is in bash (so it requires terminal) but something similar that searches for a string and then loops over the files and does search&replace in each one for windows will work as well.

#!/bin/bash -ex
save_dir="." ### write your save directory path without the trailing / 
old_string="FakeSpecial_s_bike_shop_1" ### string that gives error 
new_string="s_bike_shop_1" ### string to be replaced with

errored_files=`grep -rl ${old_string} ${save_dir}/*`

for each in ${errored_files}; do
    sed -i "s/${old_string}/${new_string}/g" ${each}
done

It won't help -all- migration issues, but ones where an ID was changed to something else will be easily fixed by this, I think. Of course, back up your save before trying it out every time, just in case something even worse breaks.

@wapcaplet wapcaplet added the (P2 - High) High priority (for ex. important bugfixes) label Nov 5, 2021
@wapcaplet wapcaplet self-assigned this Nov 5, 2021
@wapcaplet wapcaplet removed their assignment Nov 14, 2021
@wapcaplet
Copy link
Contributor

Here is another saved game created in 0.F-3 that reproduces this error along with the Military Outpost, Military Bunker, and several others.

MilitaryOutpost0F3.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed (P2 - High) High priority (for ex. important bugfixes) (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants