Opened 9 years ago

Last modified 17 months ago

#1318 new enhancement

New Farmland Paradigm

Reported by: michael Owned by:
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords: design
Cc: turkchess123@… Patch:

Description (last modified by Freagarach)

The current situation with the farm fields should be remedied. There have been suggestions for a farming queue or something like that, but after much internal discussion, we've come to somewhat of a consensus. 1 or more of the following may need their own tickets.

  • Farm fields are infinite, no matter where they are placed.
  • Gatherers have a "diminishing returns" feature, in that for each additional gatherer after 1 drives down the gather rate of all of them, to the point that it is more efficient to build a 2nd farm field by the time the gatherers get to 5.

Update: Both of these were committed in r13616. Farmlands There should be a set of terrain textures on the terrain that give a big gather boost if farm fields are built there. Anywhere from +50% to +100% gathering rate, depending on playtesting. These "farmland" areas then become areas of contention for players to fight over. The player can choose to seed farms anywhere they wish, but they will be considerably more efficient if placed on farmland. Efficiency Overlay There can also be an overlay for the farm field when the player is choosing where to place it. This will explicitly tell the player whether they're placing the farm field on efficient farmland or non-efficient land. Green - When the farm field is being hovered within the farmland terrain adequately (and will receive the efficiency bonus when built there). Yellow - When the farm is being placed on non-farmland (and will get no efficiency boost). Red - When obstructed. Farmland terrain textures in Atlas A similar technique should be used for farmlands as is already being used for 'city tile' or 'road' textures. Each biome will have its own farmland texture. It'll get placed in a new "Farmland" tab in the terrain panel by an XML file (exactly like what is done with city/road textures). If you don't know what I'm talking about with the city/road textures, then please look in mods/public/art/textures/terrain/types/biome-mediterannean/medit_city_pavement.xml for an example. That file gives the medit_city_pavement terrain its properties and places it in the "city" tab in Atlas.

Attachments (3)

farmland.jpg (299.4 KB ) - added by michael 9 years ago.
A gathering boost is giving for any farm field built on this terrain texture.
infinite-farms.patch (6.5 KB ) - added by alpha123 8 years ago.
infinite-farms.2.patch (6.6 KB ) - added by alpha123 8 years ago.
Add tech modifier; changes outdated comment

Download all attachments as: .zip

Change History (27)

by michael, 9 years ago

Attachment: farmland.jpg added

A gathering boost is giving for any farm field built on this terrain texture.

comment:1 by michael, 9 years ago

Description: modified (diff)

comment:2 by michael, 9 years ago

Description: modified (diff)

comment:3 by michael, 9 years ago

Type: defectenhancement

in reply to:  description comment:4 by Philip Taylor, 9 years ago

Replying to michael:

Efficiency Overlay

For normal (non-farm) buildings, I think it might be nice to colour the terrain green where they can be built and red where they can't, so that players can easily see and avoid areas that are overly steep or blocked by trees or outside their territory or too far from shoreline etc, rather than forcing them to wave their mouse all over the screen to find a viable spot. Then we could intuitively extend that for farms by having red for blocked, yellow for low-yield, green for high-yield. (This would be in addition to floating tooltips saying "terrain too steep" or "50% yield - not on fertile ground" or whatever.)

comment:5 by Kieran P, 9 years ago

Milestone: Alpha 11Backlog

comment:6 by michael, 9 years ago

Disagree with Philip's idea. Nothing would look uglier than to color the entire terrain with green and red overlays every time someone goes to build a structure.

Last edited 9 years ago by michael (previous) (diff)

comment:7 by michael, 9 years ago

Description: modified (diff)

in reply to:  6 comment:8 by Erik Johansson, 9 years ago

Replying to michael:

Disagree with Philip's idea. Nothing would look uglier than to color the entire terrain with green and red overlays every time someone goes to build a structure.

Are you saying you wouldn't want the overlay to show up for all players when one player is about to construct a structure? I agree that doesn't sound like a good idea. I would assume what Philip means is to have it only show up for the player about to construct the building. Probably you are talking about that too, it's just a bit hard to know which you're talking about :)

I'm not sure it's all that bad personally, after all, it's just while placing the structure and then we need (and already have) some kind of indication of where it's possible to construct it. Having overlays over the entire terrain might be uglier than coloring the building, but it sounds likely to make it quicker to determine where to build which should make the relative ugliness lesser =)

Either way I think something like that for farmlands would work wonders.

comment:9 by michael, 9 years ago

I'm saying coloring the entire terrain when the player goes to build a building would look insanely ugly. I think the current method of shading the building preview red when obstructed is good enough.

comment:10 by michael, 9 years ago

Description: modified (diff)

comment:11 by alpha123, 8 years ago

I implemented infinite farms with diminishing returns (thanks to quantumstate for help with the diminishing returns formula). It does not deal with terrain textures yet, because the last consensus I know of is that we don't want those to affect farming anyway.

Basically this patch allows Infinity to be used as a value for <Amount> in the templates, and adds an optional element called <DiminishingReturns>, so theoretically any resource could have diminishing returns, although I don't think we want that for anything except farms. The numbers for <DiminishingReturns> require a bit of experimentation to get the curve you want, and you should probably ask quantumstate about that anyway. The current curve for women looks like this (replace 0.65 with 0.25 for citizen soldiers).

Also, would someone please add the infinity symbol to the in-game font?

by alpha123, 8 years ago

Attachment: infinite-farms.patch added

comment:12 by alpha123, 8 years ago

Cc: turkchess123@… added
Keywords: patch review added

comment:13 by michael, 8 years ago

Cool patch. I am wondering why the "consensus" was to not have farmland?

in reply to:  13 comment:14 by alpha123, 8 years ago

Replying to michael:

Cool patch. I am wondering why the "consensus" was to not have farmland?

I don't remember. It's in the IRC logs somewhere.

I'm personally opposed to farmland, but if the consensus changes I'll implement it.

comment:15 by alpha123, 8 years ago

I added a tech modifier (ResourceSupply/DiminishingReturns) to control the diminishing returns. I could see some techs that make the farming rate faster but increase diminishing returns (thus requiring more farms and more space) or the opposite.

by alpha123, 8 years ago

Attachment: infinite-farms.2.patch added

Add tech modifier; changes outdated comment

comment:16 by Kieran P, 8 years ago

Keywords: farms farming farmland removed
Milestone: BacklogAlpha 14
Summary: New Farmland Paradigm[PATCH] New Farmland Paradigm

comment:17 by alpha123, 8 years ago

Owner: set to alpha123

comment:18 by sanderd17, 8 years ago

Why would GetMaxAmount() return 9 if it's infinity? Doesn't returning the JS value Infinity work?

Last edited 8 years ago by sanderd17 (previous) (diff)

in reply to:  18 comment:19 by historic_bruno, 8 years ago

Replying to sanderd17:

Why would GetMaxAmount() return 9 if it's infinity? Doesn't returning the JS value Infinity work?

One thing to be careful about: if Infinity is in the simulation state, JSON representation will show it as "null", which is indistinguishable from other null values like NaN, that's relevant for the debug serializer (OOS dumps) and possibly the JS debugger? This patch only shows its use in the UI, but I believe the AIs also use this stat.

I agree that an arbitrary integer is no good. So the best solutions IMO are: 1. don't use Infinity but make sure all relevant code checks IsInfinite() before getting the max amount (maybe it could return undefined to make errors more obvious?), 2. use Infinity and ignore the above issues - that's easiest.

Last edited 8 years ago by historic_bruno (previous) (diff)

comment:20 by sanderd17, 8 years ago

I think the use of "Infinity" could get some more discussion. There are multiple things that could be infinite

  • Infinite health -> for undestroyable Atlas-created entities
  • Infinite armour -> there will be no damage done in one armour category, pure stone buildings should have infinite pierce armour

Those things would probably require a similar way of working, so a similar, clear interface.

If you can't differentiate Infitity and other "null" values, I'd go for returning undefined (as there is no max). This should make errors visible instead of hiding them and wondering why something happens.

comment:21 by peter, 8 years ago

In 13616:

Infinite farms with diminishing returns (but no farmland). Refs #1318.

comment:22 by alpha123, 8 years ago

Description: modified (diff)
Keywords: design added; patch review removed
Milestone: Alpha 14Backlog
Summary: [PATCH] New Farmland ParadigmNew Farmland Paradigm

comment:23 by historic_bruno, 7 years ago

Owner: alpha123 removed

comment:24 by Freagarach, 17 months ago

Description: modified (diff)

(See also Phab:D227, #5415.)

Note: See TracTickets for help on using tickets.