The farm crash bug

Thanks for taking this seriously Thal. Aren't there a couple of Firaxis guys in these Forums? Surely this must be a general problem that should be worrying Firaxis itself.
 
Last time I checked, the CCTP mod used the Polder graphics for Farm, I don't know any better workaround.
 
That's interesting. I've played over 1600 hours, have had that situation occur on numerous occasions and do not recall ever having a problem with it.
 
Never experienced this bug either. I always play DX9, dunno if that can have any importance.
 
it's the reload landmark system that cause the bug IIRC. you won't have it if you're not using mods that use the reload property.
 
This is the one thing that breaks Improvement Upgrades, but I don't think using alternatives already in the game helped.
 
There must be a DLL/Lua solution to this.

I have a farm where horses have just been revealed. Sending a worker there to build a pasture causes the crash, but if I use FireTuner to remove the farm first the workers can then start building the pasture.
 
IIRC it crashed for me when removing a Farm using the FireTuner too (but perhaps not every time). And also when founding a city on a tile with a Farm.
 
IIRC it crashed for me when removing a Farm using the FireTuner too (but perhaps not every time). And also when founding a city on a tile with a Farm.

Ah! That'll be a bit more of a bugger then ;)
 
Yes, but what happens when the AI does it? There's an unexplainable CTD?
 
After some further investigation (which is slow and boring as you have to keep restarting Civ!), the CTD **seems** to be a UI sequencing error. The FARM animatator still seems to be trying to do something as the farm graphic is removed, and consequently doesn't like it!

This also seems to fit with the perception that this has only started happening since 674 (the first Workshop build) as I'm fairly sure the sequencing of UI events changed then (as several of my mods that relied on specific sequences of events suddenly broke as the events were no longer coming in the expected/predicted order)

The farm has it's own animator and has a fairly unique set of entries in the ArtDefine_Landmarks table.

If you apply the following SQL (which basically only leaves the checker-board fields), it seems to solve the CTDs, but it also makes farms on Wheat almost invisible (as the checker-board is under the "fluffy wheat" graphic) - more experimetation is needed.

Code:
DELETE FROM "ArtDefine_Landmarks" WHERE ImprovementType='ART_DEF_IMPROVEMENT_FARM' AND ResourceType='ART_DEF_RESOURCE_NONE';
DELETE FROM "ArtDefine_Landmarks" WHERE ImprovementType='ART_DEF_IMPROVEMENT_FARM' AND LayoutHandler='SNAPSHOT';
UPDATE "ArtDefine_Landmarks" SET ResourceType='ART_DEF_RESOURCE_ALL' WHERE ImprovementType='ART_DEF_IMPROVEMENT_FARM' AND ResourceType='ART_DEF_RESOURCE_WHEAT';
 
Yes, but what happens when the AI does it? There's an unexplainable CTD?

If my hunches are correct, if the active player can see the farm that is being removed, then yes, the AI will crash the game as well.
 
Wow, this is great!

...but it also makes farms on Wheat almost invisible (as the checker-board is under the "fluffy wheat" graphic)
There's a simple solution of lowering the scale of the wheat after it is farmed.
 
Not sure if this helps or is already known, but my own experience with this bug a while back narrowed it down to the "Reload Landmark System" option. As in, I get the bug when using any mod with Reload Landmark System on, even on an utterly empty mod made for the purpose of testing that. I've personally never noticed it happening without such a mod.
 
Been thinking about this a bit more and it will only be non-wheat farms that are the issue - wheat is a resource and you only ever get one resource type per tile, so you'll never get the problem of horses/iron/etc appearing where you've built a wheat farm.

So got to prodding it a bit, and if you change the Landmarks table such that farms use the TP graphics I've not been able to generate any crashes (not saying they won't happen, just whereas I could get it to crash before it doesn't seem so happen) - probably because the TPs are SNAPSHOT types.

So, my next steps are to try and make non-wheat farms a static image.
 
Well, now that whoward is working on the issue instead of Firaxis, we can expect it to be fixed in the near future. ;)
 
Well, now that whoward is working on the issue instead of Firaxis, we can expect it to be fixed in the near future. ;)

So no pressure then :D

For anyone wanting to play along (and who knows what they're doing, as I'm not going to support this!), add the following to an SQL file in a mod that sets Reload Landmark System to true (there's bound to be one in such a mod)

Code:
UPDATE ArtDefine_Landmarks
  SET LayoutHandler='SNAPSHOT'
  WHERE ImprovementType='ART_DEF_IMPROVEMENT_FARM'
  AND ResourceType='ART_DEF_RESOURCE_NONE';

and see if it fixes the problem
 
Success! An empty mod with Reload Landmark System still gives me the bug (tested that first just to be sure). Adding that SQL code to that mod fixes it for me.
Test mods attached for any other takers.
 

Attachments

  • Farm bug Tester (v 1).civ5mod
    628 bytes · Views: 140
  • Farm bug fix Tester (v 1).civ5mod
    899 bytes · Views: 210
Top Bottom