REPEAT BUG (Nystul) Linux #132: Missing a tavern in dialogue directions [RESOLVED]

User avatar
Interkarma
Posts: 3495
Joined: Sun Mar 22, 2015 1:51 am

Re: REPEAT BUG (Nystul) Linux #132: Missing a tavern in dialogue directions

Post by Interkarma » Wed Oct 17, 2018 5:24 am

This is actually a bit of an epic change. Updating the key itself is the easy part. It's also necessary to migrate all deserialized data to the new key generation for things like quests, discovery, NPCs, and state. Missing even a single building key on restore will break something the player probably doesn't want broken.

Still, I've got this. But I'm going to need some help testing once the changes are on git. The more eyes on it the better.

User avatar
Hazelnut
Posts: 856
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: REPEAT BUG (Nystul) Linux #132: Missing a tavern in dialogue directions

Post by Hazelnut » Wed Oct 17, 2018 7:00 am

Seems a lot of work and risk of bugs, are you sure it's worth it? Simple zero translation would be a lot less work, and wouldn't need any migration really. I know you have a lot on.

User avatar
Interkarma
Posts: 3495
Joined: Sun Mar 22, 2015 1:51 am

Re: REPEAT BUG (Nystul) Linux #132: Missing a tavern in dialogue directions

Post by Interkarma » Wed Oct 17, 2018 7:30 am

No matter which way you slice it, changing the key generated at runtime will descync player from their saves unless that save data is also migrated on deserialization. And I can't just ignore or hack away 0, because 0 still means something. It's the first building index at block coordinates 0,0. There's nothing to distinguish key=0 (no building) from key=0 (first building in city layout). That the core of my error here, I somehow overlooked that rather obvious design flaw.

I'm fairly confident I can fix it right first time. My new keys are migratable between generations and FullSerializer has some nice support for making these kinds of changes between serialized versions. I just need to make sure I don't overlook any structures holding a building key and we're golden.

User avatar
Hazelnut
Posts: 856
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: REPEAT BUG (Nystul) Linux #132: Missing a tavern in dialogue directions

Post by Hazelnut » Wed Oct 17, 2018 7:40 am

Okay, let me know if I can help. And good luck! :D

User avatar
Interkarma
Posts: 3495
Joined: Sun Mar 22, 2015 1:51 am

Re: REPEAT BUG (Nystul) Linux #132: Missing a tavern in dialogue directions

Post by Interkarma » Wed Oct 17, 2018 7:44 am

Thank you mate. :)

I have a mostly working fix already, I'm just to sit on this until early next week when I have more time to think straight. New work just keeps piling in lately. I'll still be around though!

User avatar
Interkarma
Posts: 3495
Joined: Sun Mar 22, 2015 1:51 am

Re: REPEAT BUG (Nystul) Linux #132: Missing a tavern in dialogue directions

Post by Interkarma » Wed Oct 17, 2018 11:17 am

Hazelnut, now that I've worked through the problem both ways, I have to concede your solution is the better one overall.

My solution to migrate keys is technically valid to remove issue fully for all saves past and future, but it introduced far too much complexity, which means potential for more problems that are even harder to fix later. Even after I had this working across my saves, I still didn't feel confident in it.

At least with your solution, the only building that's desynced is anything in save games with a building key of 0 that's supposed to be a valid building. This may impact the occasional quest if user is very unlucky, but it's limited to that. Every other system just keeps on trucking with the keys they have now, and nothing else is broken.

I can admit when someone else's suggestion is the better one. Cheers mate. :)

User avatar
Hazelnut
Posts: 856
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [RESOLVED] REPEAT BUG (Nystul) Linux #132: Missing a tavern in dialogue directions

Post by Hazelnut » Wed Oct 17, 2018 12:03 pm

Cool, sometimes you need to start work on something to really grasp whether it's the right path or not. I've a fair amount of experience coding myself into corners over the years so I get a codie-sense sometimes. :lol:

I think this is the correct choice considering ROI and the minimal impact for 0 value keys in saves.

User avatar
Nystul
Posts: 1151
Joined: Mon Mar 23, 2015 8:31 am

Re: [RESOLVED] REPEAT BUG (Nystul) Linux #132: Missing a tavern in dialogue directions

Post by Nystul » Wed Oct 17, 2018 1:35 pm

thanks for tracking it down and fixing guys. I am currently still very busy with RL stuff and it would have taken me much more time to find this and fix it anyway ;)

User avatar
Hazelnut
Posts: 856
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [RESOLVED] REPEAT BUG (Nystul) Linux #132: Missing a tavern in dialogue directions

Post by Hazelnut » Wed Oct 17, 2018 8:04 pm

You're most welcome.

Post Reply