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

NPC data corruption #738

Open
ohrrpgce-bugbot opened this issue Jun 25, 2009 · 7 comments
Open

NPC data corruption #738

ohrrpgce-bugbot opened this issue Jun 25, 2009 · 7 comments
Labels
bug Yeah... that's broken maps rel: zenzizenzic Present in zenzizenzic 2011-05-06

Comments

@ohrrpgce-bugbot
Copy link

[bz#738]

As detailed here, http://castleparadox.com/ohr/viewtopic.php?t=6274 sometimes after resizing a map and then editing tileset data, NPC definitions become corrupted.

This bug has appeared both in the Xocolatl release and in nightly builds. It is difficult to reproduce.

From: @bob-the-hamster
Reported version: 20110506 Zenzizenzic
URL: http://castleparadox.com/ohr/viewtopic.php?t=6274
Blocker for: bz⁠#683, bz⁠#809

@ohrrpgce-bugbot
Copy link
Author

Comment author: @bob-the-hamster

Just to update this, the NPC editor has been hardened to prevent crashes in case of corrupted data, but the corruption still seems to happen.

See also this thread: http://castleparadox.com/ohr/viewtopic.php?t=6340

@ohrrpgce-bugbot
Copy link
Author

Comment author: @bob-the-hamster

Perhaps not related to map resizing after-all

@ohrrpgce-bugbot
Copy link
Author

Comment author: msw188

I've finally encountered something related to this. My game Tales II went a long time without being touched (as in, since the NPC definition limit was lifted to 99), but when I loaded it with the latest nightly there was a strange pattern:

  1. On a few maps, formerly 'undefined' npcs (picture, palette, type, etc all zero) had picture 1 and palette 7 chosen. There would only be one of these per map, and it only happened on like 4 out of 15 maps.

  2. On more maps than scenario 1, npc 35 was given picture 36, although the palette was still 0.

I did not resize any maps.

@ohrrpgce-bugbot
Copy link
Author

Comment author: msw188

One mistake in that previous comment. I've definitely used the 99th NPC, so it hasn't been THAT long since I opened this file. Also, I just double checked and the NPCs with new data did NOT have any non-default choices for things like move-type or pushability or anything like that.

@ohrrpgce-bugbot
Copy link
Author

Comment author: @rversteegen

I've finally encountered something related to this. My game Tales II went a
long time without being touched (as in, since the NPC definition limit was
lifted to 99), but when I loaded it with the latest nightly there was a strange
pattern:

  1. On a few maps, formerly 'undefined' npcs (picture, palette, type, etc all
    zero) had picture 1 and palette 7 chosen. There would only be one of these per
    map, and it only happened on like 4 out of 15 maps.

  2. On more maps than scenario 1, npc 35 was given picture 36, although the
    palette was still 0.

I did not resize any maps.

I tried downloading the version of Tale II on CP and SS (last modified Jan 2008) and looked at the NPCs. On one map (map 4) I found an NPC with picture 1 and palette 7. Was that not meant to be there?

Do you still have that corrupted file: do you think the corrupted happened as you browsed it, or was the NPC data corrupted sometime in the distant past? Could I see the game?

I just noticed something: NPC definitions are stored on the stack, and since 'st' is the first defined local, they are in fact at the very top of the mapmaker stack frame (recall that the stack grows downwards). Also, Dark Blubber reported "Sometimes when I do a lot of tilemap work and then push Enter to show the full tileset and pick a new tile, one random tile from the tileset is duplicated in the wrong place.". Sure enough, when I checked the source as it was at the time this was reported, the tile picker tile map was also allocated on the stack, immediately after the npc definitions and npc instances (which totalled about 18000 bytes). So I'd guess that NPC instance data is also being corrupted, but nobody has noticed yet because most fields of NPCInst are not saved, or silently corrected in Game, and are not visible unless the NPC exists anyway.

@ohrrpgce-bugbot
Copy link
Author

Comment author: msw188

Indeed, that NPC was never defined by me. Would you like an unpassworded copy of the game as it is now? I don't have a copy of it from back then, I don't think. But yeah, the one I have now is corrupted in this way, and I haven't changed any of these things back yet.

I don't know how to judge when the corruption occurred. Since none of these 'newly defined' NPCs had instances within the game, they could have been corrupted a long time ago and I would never have noticed while playtesting.

Should I attach an unpassworded copy here, or send it in an email to one of you guys? I don't think I have TMC's email address.

@ohrrpgce-bugbot
Copy link
Author

Comment author: @rversteegen

Yes, could you email it to me? My email address is right here on bugzilla: teeemcee@⁠gmail.com
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Yeah... that's broken maps rel: zenzizenzic Present in zenzizenzic 2011-05-06
Projects
None yet
Development

No branches or pull requests

1 participant