Can technologies buff terrain (not improvement) yields?

JohnnyW

Gave up on this game
Joined
Oct 8, 2010
Messages
658
Location
USA
So I haven't been able to figure if I can directly buff tile yields on a tech discovery. I can see how to buff improvement yields (as there are examples), but I don't see anything that would allow me to buff terrain yields from a tech directly.

For example, let's say I wanted to improve Coast food yield with the tech Fishing, how would I do that (if it is possilbe)?

edit: same question for building yields actually. Would love to see some interaction there as well. Is it possible?
 
So am I just that stupid or is it not possible? :(

edit: I tried including a new table, which didn't work the way I have it:
Spoiler :
<GameData>
<Table name="Terrain_TechYieldChanges">
<Column name="TerrainType" type="text" reference="Terrain(Type)" />
<Column name="TechType" type="text" reference="Technologies(Type)" />
<Column name="YieldType" type="text" reference="Yields(Type)" />
<Column name="Yield" type="integer" />
</Table>
<Terrain_TechYieldChanges>
<Row>
<TerrainType>TERRAIN_GRASS</TerrainType>
<TechType>TECH_POTTERY</TechType>
<YieldType>YIELD_FOOD</YieldType>
<Yield>1</Yield>
</Row>
</Terrain_TechYieldChanges>
</GameData>
 
It's not possible I think. Just adding tables without adding the code to handle them is meaningless.

You could create a somewhat complicated lua script to do this, but don't ask me how because I don't know exactly.
 
I tried including a new table, which didn't work the way I have it:

You can't just arbitrarily add a new XML table. The engine would have no idea what to do with it. You CAN make Lua code that reads new XML tables, but you'll have to do all the work on that yourself. But for a pure XML mod, adding new tables (or new rows within existing tables) does absolutely nothing.

Most things are possible through Lua, although the amount of work it'd take to get some of these sorts of things working would be extensive. For instance, if you wanted to add yield to all Grassland tiles, you'd have to loop over the players, check to see if they had the tech, loop over their cities, find all hexes nearby, check each hex to see if it's a Grassland, and then change the yield of the hex. (And I'm not even sure on that last part; there might not be a Lua function for that.)
 
Very, very disappointing to hear. :(

Thank you for the information though.
 
Okay, so I came up with a potential workaround for this....though I'm not sure if it's possible.

On map creation every tile of a particular type begins with an invisible improvement on it that grants 0 yield in every category. When a tech is researched it improves the yield of the invisible improvement thereby improving the output of every tile of that terrain!

Compatability with other improvements would need to be considered, but would this be possible? :religion:
 
AFAIK you can only have one improvement on a tile. The idea might have merit, though: you could maybe do something like this by copying all the terrain types for each tech you want to change them and then switching out the terrain type via Lua
 
AFAIK you can only have one improvement on a tile. The idea might have merit, though: you could maybe do something like this by copying all the terrain types for each tech you want to change them and then switching out the terrain type via Lua

Okay, I'm still working on learning XML intricacies so working with Lua will have to wait. ;)

But what I was thinking of with my new idea would be easier to explain with an example:

1) Coast generates 0F/0H/1G at game start with a "Coast" improvement modifying +0/+0/+0.
2) After you research "Fishing" the "Coast" improvement yields +1/+0/+0 giving the Coast terrain 1/0/1
3) Any Fish resources would grant 2/0/1 and then 3/0/1 after learning "Fishing"
4) You learn Sailing and want to put a Work Boat on the Fish. Work Boats give +2/+0/+0 on Fish resources, which should give you a 5/0/1 tile.
5) In order to give the Fish the proper +2/+0/+0 that it would normally give, we alter the improvement "Work Boat" to grant +3/+0/+0 so that when it removes the hidden "Coast" improvement the net gain is the same and we have a +5/0/1 tile as we expect! :)

I would have to do this for every improvement of every resource, but it could be doable if it's possible to preload improvements on every terrain tile.

If your way is possible with Lua that would apparently seem easier though. I just wouldn't know how to do it. :eek2:
 
Okay, I'm still working on learning XML intricacies so working with Lua will have to wait. ;)

But what I was thinking of with my new idea would be easier to explain with an example:

1) Coast generates 0F/0H/1G at game start with a "Coast" improvement modifying +0/+0/+0.
2) After you research "Fishing" the "Coast" improvement yields +1/+0/+0 giving the Coast terrain 1/0/1
3) Any Fish resources would grant 2/0/1 and then 3/0/1 after learning "Fishing"
4) You learn Sailing and want to put a Work Boat on the Fish. Work Boats give +2/+0/+0 on Fish resources, which should give you a 5/0/1 tile.
5) In order to give the Fish the proper +2/+0/+0 that it would normally give, we alter the improvement "Work Boat" to grant +3/+0/+0 so that when it removes the hidden "Coast" improvement the net gain is the same and we have a +5/0/1 tile as we expect! :)

I would have to do this for every improvement of every resource, but it could be doable if it's possible to preload improvements on every terrain tile.

If your way is possible with Lua that would apparently seem easier though. I just wouldn't know how to do it. :eek2:

Ah I see, yes, that would probably work. Not sure which version is easier but yours should be faster because you only have to loop through tiles once, rather than multiple times. I don't think you can start the game with improvements but you can write a lua script for it.
 
I have an addendum to this. There is a function called Game.SetPlotExtraYield(x, y, YieldType, amount) that seems to work. The x and y arguments are grid coordinates for the plot. This seems to add yield to the tile so calling it multiple times will add multiple times.
 
Top Bottom