The farm crash bug

I noticed no mention of it with the notes too, but then wondered if they considered it worth mentioning, fixing etc

i don't think they'll fix it since its a mod thing.

I guess in the meantime the solution is to make farm graphics that don't use the farm system but use the basic landmark system.

But I wonder if that means the wheat resource needs to be replaced too since building something on that resource makes it use the farm system. I guess we sould replace it with a resource that would use the plantation logic? IIRC having a plantation build on he wheat resource keeps the basic wheat resource underneath the new improvement is that right?
 
I guess in the meantime the solution is to make farm graphics that don't use the farm system but use the basic landmark system.
See post #64 in this thread - that's what this mod does - http://www.picknmixmods.com/mods/18d7c770-a13a-4563-9e52-cb81b7d75537/mod.html - using the Barley, Mango and Tobacco resource graphics from the CCTP project

But I wonder if that means the wheat resource needs to be replaced too since building something on that resource makes it use the farm system. I guess we sould replace it with a resource that would use the plantation logic? IIRC having a plantation build on he wheat resource keeps the basic wheat resource underneath the new improvement is that right?

You don't need to replace the Wheat resource, you just need to change the graphic of the farm on the Wheat resource, which the above mod also already does (using the Corn graphic from the CCTP project)

If you don't want to use the CCTP graphics you don't even need to add any new artwork, you can just change the FARM layout handler to SNAPSHOT or RANDOM in the database and the bug is fixed, but then there is no variation in the farms and their fields and when you get more than 4 or 5 farms in a block it looks very boring
 
Ah, thanks makes more sense now.

I can make a farm graphic that uses the tiled layout but then edit the skin of the farm to change the layout different so it looks more random then have 3 to 5 different farm gr2s so they are varied? But is it possible for the game to pick more than 1 farm graphic to randomize how things look without using the farm system?
 
It is possible - use the RANDOM layout handler. But then you can't use different models for different eras (which shouldn't be a problem in this case).
 
The fundamental issue is that the FARM layout handler is doing many things all at the same time
  1. Randomising the orientation of the farm buildings within the tile
  2. Changing the appearance of the farm buildings by era
  3. Changing the appearance of the fields by continent
  4. Randomising the orientation of the fields within the tile
  5. Step animating the fields so they appear to grow
  6. Automatically handling the half-built and pillaged states for non-wheat farms

Item 1 can be replicated by the RANDOM layout handler, item 2 by the SNAPSHOT handler, but that's all those two do.

You can have random farms that don't change in the industrial era or you can have a single farm that does change at the industrial era. Workers don't currently upgrade improvements, so without some major Lua/C++ changes I don't see how that will help.
 
So... I know I'm pretty much a newcomer into this issue and thus don't understand it fully, but...

Couldn't we use the RANDOM layout, but then have lua replace the Farm improvement with a Fake-farm Improvement (same attributes) with modern graphics upon X player enters Industrial Age?

I suppose you'd need to know where the player built each farm, but I also suppose that there could be a way of recording each plot and then use the Save utils some people use on their mods...

Or that wouldn't work?
 
I agree. As much as I like the fix whoward69 did, it should be corrected by Firaxis. If whoward69 can do it, so should they ;).
Seconded ;)
 
So, is it possible to isolate where the issue itself arises from? From Whoward's above list, 1 and 2 are accounted for already. I presume it would be possible to link 4 to 1, while 5 doesn't really matter (has anyone actually seen this?) So we're left with 3 and 6. 6 could probably be handled in the same manner as the other tile improvements, so if we were to get rid of #3 (Changing the appearance of the fields by continent) and move the other ones to the respective systems elsewhere would the issue be fixed?
 
I'm pretty sure the issue is in 5. At a guess, the animation code is still running when the new improvement wipes out the data-structures that that code expects to find.
 
So would there be a way to either remove that and see if the crash still exists or to add it to another improvement and see if that improvement causes the bug too?

The bug is in the "FARM handler" - the handlers are the bits of code that manage the visual display of the improvements in their various states. We don't have the source code for those, as they are in the graphics/map/ui dll(s)
 
rules out making a replacement improvement with the same graphics?

I did try that, but the files are in a different format/layout to the plantation/mine/etc (as the fields are in different files to the buildings IIRC) - so I failed

However, that's not to say that someone with any 3D graphics skills couldn't get something to work ;)
 
Back
Top Bottom