The farm crash bug

Hmm, IIRC I tried this solution and it didn't work... Will check again tonight.
 
Just for interest at present, is there an [ArtDefine_Landmarks] XML file anywhere in CiV that is made available to us or is it one the "big secrets" that are sand-boxed?
 
No secret. It's perfectly accessible in the DB. Use SQLite Manager to view. I don't know if it is added by XML or SQL or by some hidden code somewhere (doesn't really matter since we can view it and modify it).
 
But that's actually my point of interest, it was you who found the workaround of going into the DB directly for Art Files that were not equipped with XML Folders/Files as a sand-box "arms length wish from the devs. and exclaimed "we're still modding Civ4 not seeing the Civ5 direct possibilities, no?
 
This is a common misconception about Civ5 modding - people keep asking where an XML file that does this or that is located, which is not important at all, as everything you can change is in the database. It happens probably because Civ4 and Civ5 modding seem similar (both have XML files), but actually they are quite different. When modding Civ5 you should think in database terms, not in XML file terms.

Btw I don't think it was Pazyryk who invented checking the database, this possibility is mentioned in Kael's modding guide.

(I'm testing the workarounds to the farm crash posted by whoward69 in this thread, I'll post the results soon.)
 
Just for interest at present, is there an [ArtDefine_Landmarks] XML file anywhere in CiV that is made available to us or is it one the "big secrets" that are sand-boxed?

It's no secret, the XML files are in the .fpk files (along with all the .dds files) BUT they are not in standard <GameData> format. Hence, the need for SQL to update the database.
 
OK, I've been investigating/playing some more

If this problem is not restricted to the FARM layout manager, why don't we see it late game when replacing Lumber Mills and TPs with Mines (for Aluminium and Uranium) or Plantations with Moai?

If it is restricted to the FARM manager, then the one line SQL above should fix it, and so far I've had no further crashes in my games replacing Farms with just about anything (TPs, Mines, Moai, Forts)
 
Here are the results of my tests:

Both fragments of SQL code (from posts #13 and #19) don't work for me - the Farm looks the same as before, and removing it still crashes the game :(

(Yes, I checked if these changes are in the database.)

Edit: I think the problem IS restricted to the FARM layout manager, but changing it in the database to another layout manager doesn't seem to work - I suppose the Reload Landmark System option doesn't really reload everything properly.
 
Here are the results of my tests:

Both fragments of SQL code (from posts #13 and #19) don't work for me - the Farm looks the same as before, and removing it still crashes the game :(

Which is very weird :crazyeye:
 
Here are the results of my tests:

Both fragments of SQL code (from posts #13 and #19) don't work for me - the Farm looks the same as before, and removing it still crashes the game :(

(Yes, I checked if these changes are in the database.)

DX-9 or DX-10/11 ?
 
DX 10/11, will try DX9 now

Edit: Perhaps it's important that I place and remove the Farms using FireTuner, I will try to use Workers this time...
 
Nope. No matter what I try, I still get the crash. So either I'm doing something wrong, or due to a different system or game configuration it refuses to work for me.
 
I'll try and package up a map and mod so others can test it
 
Thanks for the answers guys, the DB thinking is slow to come I presume as one has to think one step further than what we did in Civ4, slowly we'll get there I presume.

And then of course learn the Lua syntax and the SQL with which I've had no experience, but ehh...
it's slow "Rome wasn't ..." :D
 
I made an experiment, which shows that (at least for me) something is hardcoded or not updated properly when the database content changes: I renamed the Farm art define using the following SQL code:
Code:
UPDATE ArtDefine_LandmarkTypes
  SET Type='ART_DEF_IMPROVEMENT_FARM1'
  WHERE Type='ART_DEF_IMPROVEMENT_FARM';

UPDATE ArtDefine_Landmarks
  SET ImprovementType='ART_DEF_IMPROVEMENT_FARM1'
  WHERE ImprovementType='ART_DEF_IMPROVEMENT_FARM';

UPDATE ArtDefine_StrategicView
  SET StrategicViewType='ART_DEF_IMPROVEMENT_FARM1'
  WHERE StrategicViewType='ART_DEF_IMPROVEMENT_FARM';

UPDATE Improvements
  SET ArtDefineTag='ART_DEF_IMPROVEMENT_FARM1'
  WHERE ArtDefineTag='ART_DEF_IMPROVEMENT_FARM';

This results in the Farm improvement being completely invisible for me, while it should be exactly the same as the original Farm (as only the name has changed).

When I changed the LayoutHandler to Snapshot by adding the following to the code above:

Code:
UPDATE ArtDefine_Landmarks
  SET LayoutHandler='SNAPSHOT'
  WHERE LayoutHandler='FARM';

The result is quite interesting - I got only the small huts, without the fields.

@whoward69: Can you check how it works for you?
 
@whoward69: Can you check how it works for you?

Code:
-- The following 4 stmts cause all farm graphics to vanish, which implies that the FARM layout handler is hard-coded
-- UPDATE ArtDefine_LandmarkTypes SET Type='ART_DEF_IMPROVEMENT_FARM1' WHERE Type='ART_DEF_IMPROVEMENT_FARM';
-- UPDATE ArtDefine_Landmarks SET ImprovementType='ART_DEF_IMPROVEMENT_FARM1' WHERE ImprovementType='ART_DEF_IMPROVEMENT_FARM';
-- UPDATE ArtDefine_StrategicView SET StrategicViewType='ART_DEF_IMPROVEMENT_FARM1' WHERE StrategicViewType='ART_DEF_IMPROVEMENT_FARM';
-- UPDATE Improvements SET ArtDefineTag='ART_DEF_IMPROVEMENT_FARM1' WHERE ArtDefineTag='ART_DEF_IMPROVEMENT_FARM';

-- I'm expecting farms to now appear as Trading Posts
-- INSERT INTO ArtDefine_Landmarks(Era, State, Scale, ImprovementType, LayoutHandler, ResourceType, Model, TerrainContour)
-- SELECT Era, State, Scale, 'ART_DEF_IMPROVEMENT_FARM', LayoutHandler, ResourceType, Model, TerrainContour FROM ArtDefine_Landmarks WHERE ImprovementType='ART_DEF_IMPROVEMENT_TRADING_POST1';
-- except they don't - so it's not that bit that's hard coded

-- I'm expecting this to re-instate the buildings, but not the fields
-- UPDATE ArtDefine_Landmarks SET LayoutHandler='SNAPSHOT' WHERE ImprovementType='ART_DEF_IMPROVEMENT_FARM1';
-- which it does, but weirdly it also removes the "raw wheat" graphic

-- I would also expect this to re-instate the buildings (it reverses two of the updates above), as the SNAPSHOT handler seems to look for XYZ1, XYZ2, XYZ3 etc given just XYZ
-- UPDATE ArtDefine_Landmarks SET LayoutHandler='SNAPSHOT' WHERE ImprovementType='ART_DEF_IMPROVEMENT_FARM1';
-- UPDATE ArtDefine_StrategicView SET StrategicViewType='ART_DEF_IMPROVEMENT_FARM' WHERE StrategicViewType='ART_DEF_IMPROVEMENT_FARM1';
-- UPDATE Improvements SET ArtDefineTag='ART_DEF_IMPROVEMENT_FARM' WHERE ArtDefineTag='ART_DEF_IMPROVEMENT_FARM1';
-- but it doesn't, but the "raw wheat" does come back!

-- I'm expecting this to re-instate the buildings and the fields, as it seems the firelds are always taken from the Wheat resource, which we leave as the FARM handler
-- UPDATE ArtDefine_Landmarks SET LayoutHandler='SNAPSHOT' WHERE ImprovementType='ART_DEF_IMPROVEMENT_FARM1' AND ResourceType='ART_DEF_RESOURCE_NONE';
-- but it only re-instates the buildings for non-wheat (and no fields at all)

-- So comment out the first 4 stmts and just go with the following one line, which should keep the buildings and the fields
UPDATE ArtDefine_Landmarks SET LayoutHandler='SNAPSHOT' WHERE ImprovementType='ART_DEF_IMPROVEMENT_FARM' AND ResourceType='ART_DEF_RESOURCE_NONE';
-- which it does
 
Is my machine/screen just slow or does anyone else notice that when you start builiding something else on top of a farm, the buildings vanish immediately, but the fields remain for a little while (which in some cases may be several turns)?
 
There is definately something else happening in the FARM layout handler - chek out the farm_types.xml file in "C:\Program Files (x86)\Steam\SteamApps\common\sid meier's civilization v\resource\Common" - that seems to be controlling the fields.

Perhaps the solution is to make a new (set of) static farm graphics and completely replace the current farm graphics/handler.

I can successfully build an airfield on top of wheat (without the wheat poking through the runway) so who knows.
 
I have a very fast machine and I have symptoms something like that. But I'm not sure if it's the same thing. My problems mostly occur when I reload a saved game after playing awhile. Things like mines and farms don't always appear right away. Usually (but not always) they eventually appear after a few turns. I'm using DX11.
 
Top Bottom