Seed rot breaks saves? Re: Wilderness Overhaul Mod

Unfortunately , it seems that having some seeds rot causes save corruption
-21:52:43.956 MAP : src/map.cpp:4917: a seed item has vanished at 64,84
21:52:43.957 MAP : src/map.cpp:4917: a seed item has vanished at 65,84

[quote=“Frostwood, post:1, topic:9004”]Unfortunately , it seems that having some seeds rot causes save corruption
-21:52:43.956 MAP : src/map.cpp:4917: a seed item has vanished at 64,84
21:52:43.957 MAP : src/map.cpp:4917: a seed item has vanished at 65,84[/quote]

Little better breakdown of what happens, version/OS, etc? I’d rather not have a save-corrupting bug go into a stable version.

I was in version 2754, and was nearby my Mansion base. I was burning some trees to make a path for a vehicle, and then the game crashed. I have autosaves on, so I assumed that I would go back and see if I could recreate the bug, but upon trying to load the game, the game crashes to desktop, making it really hard to find the source of the bug.

I’m on a ASUS laptop, Windows 8.

Save is here
https://www.dropbox.com/s/209ua285kyakuk3/save.rar?dl=0

This bug has nothing to do with the mod - it exists on a clean vanilla 0.C

I’ve got my first free night in a while, and finally have the time to try to reproduce this. I think I found it! Well, it or a very similar save corrupting bug.

First, how to reproduce:

[ol][li]Plant any seed[/li]
[li]Set the seed on fire (dropping 2000 gasoline right next to it lets it burn through drizzle)[/li]
[li]Fertilize the seed[/li]
[li]Save/quit[/li][/ol]

I get similar errors: “src/map.cpp:5007: a seed item has vanished at 44,60”.

What appears to be causing it is that the seed furniture is a generic container of whatever seed item you planted. Plant a seed, map edit the seed furniture away, and the seed you planted drops on the ground. Do the same thing, but set the planted seed on fire (and let it burn out) before you map edit the seed furniture away and nothing drops. You get similar results with throwing an acid bomb at a planted seed and then fertilizing it. What’s probably happening is that f_plant_seed doesn’t constantly check on that seed other than on save/load, so it lets you do things like fertilize it which is probably resulting in some garbage pointers to a seed that no longer exists.

A quick fix would probably be to make f_plant_seed easily destructible (“FLAMMABLE” flag, whatever needs to happen to let it be destroyed by acid), but that’s more a bandaid.

And I set a seed to rot extremely quickly and it doesn’t seem to impact anything. Even if you plant a rotten seed, the check to remove it from the world doesn’t occur if it’s in the container (or in your inventory), so it just stays rotten in the plant.

Wow, that is quite impressive reverse engineering (-:

The seed does not actually drop. It stays there from the planting till you harvest. The item is used to track the age and type of the plant. The terrain itself is simply a sealed container (exactly like the crate or a closed safe).

What's probably happening is that f_plant_seed doesn't constantly check on that seed other than on save/load

Yes. Because performance! It’s only checked when the place comes into the reality bubble. If the plant is old enough, it changes into it’s next stage.

so it lets you do things like fertilize it which is probably resulting in some garbage pointers to a seed that no longer exists.

Fertilizing creates another item there (the fertilizer token), its existence is used to prevent another fertilization. If at that point the seed is already gone, the fertilizer token is the only item remaining. The game thinks the first item on this kind of terrain must be a seed item and therefor has seed item properties (which the fertilizer token does not have) and so it accesses non-existing data.

And I set a seed to rot extremely quickly and it doesn't seem to impact anything. Even if you plant a rotten seed, the check to remove it from the world doesn't occur if it's in the container (or in your inventory), so it just stays rotten in the plant.

The unplanted seed will vanish like any other spoiling item (it is removed when the place is loaded into the reality bubble). Once it’s planted, the seed does not really exist anymore (it’s now a plant), so it must not rot. You aren’t supposed to get that seed back anyway, it’s just for storing plant information.

Through planting a rotten seed should probably not be allowed.

I don’t exactly know what is “cosmetic” field in submap struct supposed to do, but I think it could be used instead of the seed item. This would be a good hack to prevent this kind of behavior.
Fertilizer might also go there.

Alternatively, planted seeds/fertilizer could use a special kind of material that resists everything (mostly fire and acid).

I don't exactly know what is "cosmetic" field in submap struct supposed to do, but I think it could be used instead of the seed item. This would be a good hack to prevent this kind of behavior. Fertilizer might also go there.

It was originally introduced for signs (the f_sign furniture), but I agree it could be used (but needs to be renamed) for other things as well.

However, this also affects items inside any other sealed furniture / terrain (cloning vat, closed crate, closed/locked safe, …). Put some wood in a safe, close it and create fire nearby. It will jump to the safe and burn the contained items.

Similar the monster with the MF_ABSORBS flag will also absorb items inside sealed stuff.

From playing with it last night, it looks like this would require changing the material of the seed item as you find it out in the world. Fertilization seems to create a new instance of a generic fertilization token, but planting a seed seems to store the existing seed instance.

Yup, when I used ‘drop’ I meant when only when editing the f_plant item out of the game via debug menu. Plant a rotten seed, delete the f_plant_seed, and that same rotten seed ‘drops’ with all its remembered information. I couldn’t find any easier way to check the state of the seed inside f_plant_seed.

I couldn't find any easier way to check the state of the seed inside f_plant_seed.

Press [tt]i[/tt] in the map editor and you can access the items at that location, you can add or change items there as well. This ignores any restrictions that would apply to the player character and allows you to see and edit the seed item inside the f_plant_seed.