Bring back terrain affinity
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
High
|
Unassigned |
Bug Description
The one_world branch removed terrain affinity. The problem was that for each terrain/tree combination a number (probability) was needed. This were already a lot of numbers for 16 terrains, but for the ~60 terrains that we now support it is just too much to maintain or even understand. The former model was already too complicated as proven by nodoby ever implementing terrain affinity for crops or other plants.
Without terrain affinity there are a number of issues that diminish the fun while playing though:
1) The interesting concept of where to plant foresters is gone - all trees grow everywhere equally well.
2) With all trees now in the one world, foresters have no idea of where to plan former blackland trees compared to former greenland trees - for now, all foresters plant greenland trees everywhere - looks funny on black and desert maps.
3) Crops/wine and other plants can still grow everywhere equally well. It would be more interesting if farms and vineyards needed to be placed strategically too.
This bug collects ideas of a simpler model that can group immovables into sets (i.e. "all former greenland trees") for foresters to choose from while also defining terrain affinity for these immovable groups.
Related branches
- Tino: Approve
-
Diff: 6867 lines (+3007/-2410)128 files modifiedCMakeLists.txt (+4/-3)
src/logic/CMakeLists.txt (+2/-0)
src/logic/description_maintainer.h (+9/-0)
src/logic/game.cc (+5/-0)
src/logic/game.h (+3/-0)
src/logic/immovable.cc (+51/-36)
src/logic/immovable.h (+12/-5)
src/logic/terrain_affinity.cc (+129/-0)
src/logic/terrain_affinity.h (+73/-0)
src/logic/worker.cc (+66/-61)
src/logic/world/editor_category.cc (+5/-0)
src/logic/world/terrain_description.cc (+27/-3)
src/logic/world/terrain_description.h (+13/-0)
tribes/atlanteans/forester/conf (+1/-1)
tribes/barbarians/ranger/conf (+1/-1)
tribes/empire/forester/conf (+1/-1)
world/immovables/trees/alder/init.lua (+115/-0)
world/immovables/trees/alder_summer_mature/init.lua (+0/-23)
world/immovables/trees/alder_summer_old/init.lua (+0/-30)
world/immovables/trees/alder_summer_pole/init.lua (+0/-23)
world/immovables/trees/alder_summer_sapling/init.lua (+0/-23)
world/immovables/trees/aspen/init.lua (+116/-0)
world/immovables/trees/aspen_summer_mature/init.lua (+0/-26)
world/immovables/trees/aspen_summer_old/init.lua (+0/-36)
world/immovables/trees/aspen_summer_pole/init.lua (+0/-23)
world/immovables/trees/aspen_summer_sapling/init.lua (+0/-23)
world/immovables/trees/beech/init.lua (+107/-0)
world/immovables/trees/beech_summer_mature/init.lua (+0/-23)
world/immovables/trees/beech_summer_old/init.lua (+0/-30)
world/immovables/trees/beech_summer_pole/init.lua (+0/-23)
world/immovables/trees/beech_summer_sapling/init.lua (+0/-23)
world/immovables/trees/birch/init.lua (+110/-0)
world/immovables/trees/birch_summer_mature/init.lua (+0/-26)
world/immovables/trees/birch_summer_old/init.lua (+0/-30)
world/immovables/trees/birch_summer_pole/init.lua (+0/-23)
world/immovables/trees/birch_summer_sapling/init.lua (+0/-23)
world/immovables/trees/cirrus/init.lua (+103/-0)
world/immovables/trees/cirrus_wasteland_mature/init.lua (+0/-23)
world/immovables/trees/cirrus_wasteland_old/init.lua (+0/-26)
world/immovables/trees/cirrus_wasteland_pole/init.lua (+0/-23)
world/immovables/trees/cirrus_wasteland_sapling/init.lua (+0/-23)
world/immovables/trees/larch/init.lua (+107/-0)
world/immovables/trees/larch_summer_mature/init.lua (+0/-23)
world/immovables/trees/larch_summer_old/init.lua (+0/-30)
world/immovables/trees/larch_summer_pole/init.lua (+0/-23)
world/immovables/trees/larch_summer_sapling/init.lua (+0/-23)
world/immovables/trees/liana/init.lua (+106/-0)
world/immovables/trees/liana_wasteland_mature/init.lua (+0/-26)
world/immovables/trees/liana_wasteland_old/init.lua (+0/-26)
world/immovables/trees/liana_wasteland_pole/init.lua (+0/-23)
world/immovables/trees/liana_wasteland_sapling/init.lua (+0/-23)
world/immovables/trees/maple/init.lua (+107/-0)
world/immovables/trees/maple_winter_mature/init.lua (+0/-23)
world/immovables/trees/maple_winter_old/init.lua (+0/-30)
world/immovables/trees/maple_winter_pole/init.lua (+0/-23)
world/immovables/trees/maple_winter_sapling/init.lua (+0/-23)
world/immovables/trees/mushroom_dark/init.lua (+103/-0)
world/immovables/trees/mushroom_dark_wasteland_mature/init.lua (+0/-23)
world/immovables/trees/mushroom_dark_wasteland_old/init.lua (+0/-26)
world/immovables/trees/mushroom_dark_wasteland_pole/init.lua (+0/-23)
world/immovables/trees/mushroom_dark_wasteland_sapling/init.lua (+0/-23)
world/immovables/trees/mushroom_green/init.lua (+103/-0)
world/immovables/trees/mushroom_green_wasteland_mature/init.lua (+0/-23)
world/immovables/trees/mushroom_green_wasteland_old/init.lua (+0/-26)
world/immovables/trees/mushroom_green_wasteland_pole/init.lua (+0/-23)
world/immovables/trees/mushroom_green_wasteland_sapling/init.lua (+0/-23)
world/immovables/trees/mushroom_red/init.lua (+106/-0)
world/immovables/trees/mushroom_red_wasteland_mature/init.lua (+0/-26)
world/immovables/trees/mushroom_red_wasteland_old/init.lua (+0/-26)
world/immovables/trees/mushroom_red_wasteland_pole/init.lua (+0/-23)
world/immovables/trees/mushroom_red_wasteland_sapling/init.lua (+0/-23)
world/immovables/trees/oak/init.lua (+113/-0)
world/immovables/trees/oak_summer_mature/init.lua (+0/-23)
world/immovables/trees/oak_summer_old/init.lua (+0/-36)
world/immovables/trees/oak_summer_pole/init.lua (+0/-23)
world/immovables/trees/oak_summer_sapling/init.lua (+0/-23)
world/immovables/trees/palm_borassus/init.lua (+107/-0)
world/immovables/trees/palm_borassus_desert_mature/init.lua (+0/-23)
world/immovables/trees/palm_borassus_desert_old/init.lua (+0/-30)
world/immovables/trees/palm_borassus_desert_pole/init.lua (+0/-23)
world/immovables/trees/palm_borassus_desert_sapling/init.lua (+0/-23)
world/immovables/trees/palm_coconut/init.lua (+107/-0)
world/immovables/trees/palm_coconut_desert_mature/init.lua (+0/-23)
world/immovables/trees/palm_coconut_desert_old/init.lua (+0/-30)
world/immovables/trees/palm_coconut_desert_pole/init.lua (+0/-23)
world/immovables/trees/palm_coconut_desert_sapling/init.lua (+0/-23)
world/immovables/trees/palm_date/init.lua (+110/-0)
world/immovables/trees/palm_date_desert_mature/init.lua (+0/-26)
world/immovables/trees/palm_date_desert_old/init.lua (+0/-30)
world/immovables/trees/palm_date_desert_pole/init.lua (+0/-23)
world/immovables/trees/palm_date_desert_sapling/init.lua (+0/-23)
world/immovables/trees/palm_oil/init.lua (+111/-0)
world/immovables/trees/palm_oil_desert_mature/init.lua (+0/-27)
world/immovables/trees/palm_oil_desert_old/init.lua (+0/-30)
world/immovables/trees/palm_oil_desert_pole/init.lua (+0/-23)
world/immovables/trees/palm_oil_desert_sapling/init.lua (+0/-23)
world/immovables/trees/palm_roystonea/init.lua (+107/-0)
world/immovables/trees/palm_roystonea_desert_mature/init.lua (+0/-23)
world/immovables/trees/palm_roystonea_desert_old/init.lua (+0/-30)
world/immovables/trees/palm_roystonea_desert_pole/init.lua (+0/-23)
world/immovables/trees/palm_roystonea_desert_sapling/init.lua (+0/-23)
world/immovables/trees/rowan/init.lua (+110/-0)
world/immovables/trees/rowan_summer_mature/init.lua (+0/-26)
world/immovables/trees/rowan_summer_old/init.lua (+0/-30)
world/immovables/trees/rowan_summer_pole/init.lua (+0/-23)
world/immovables/trees/rowan_summer_sapling/init.lua (+0/-23)
world/immovables/trees/spruce/init.lua (+107/-0)
world/immovables/trees/spruce_summer_mature/init.lua (+0/-23)
world/immovables/trees/spruce_summer_old/init.lua (+0/-30)
world/immovables/trees/spruce_summer_pole/init.lua (+0/-23)
world/immovables/trees/spruce_summer_sapling/init.lua (+0/-23)
world/immovables/trees/twine/init.lua (+103/-0)
world/immovables/trees/twine_wasteland_mature/init.lua (+0/-23)
world/immovables/trees/twine_wasteland_old/init.lua (+0/-26)
world/immovables/trees/twine_wasteland_pole/init.lua (+0/-23)
world/immovables/trees/twine_wasteland_sapling/init.lua (+0/-23)
world/immovables/trees/umbrella_green/init.lua (+103/-0)
world/immovables/trees/umbrella_green_wasteland_mature/init.lua (+0/-23)
world/immovables/trees/umbrella_green_wasteland_old/init.lua (+0/-26)
world/immovables/trees/umbrella_green_wasteland_pole/init.lua (+0/-23)
world/immovables/trees/umbrella_green_wasteland_sapling/init.lua (+0/-23)
world/immovables/trees/umbrella_red/init.lua (+106/-0)
world/immovables/trees/umbrella_red_wasteland_mature/init.lua (+0/-26)
world/immovables/trees/umbrella_red_wasteland_old/init.lua (+0/-26)
world/immovables/trees/umbrella_red_wasteland_pole/init.lua (+0/-23)
world/immovables/trees/umbrella_red_wasteland_sapling/init.lua (+0/-23)
world/init.lua (+26/-116)
world/terrains/init.lua (+212/-0)
information type: | Public → Public Security |
information type: | Public Security → Public |
tags: |
added: world removed: oneworld terrainaffinity |
Changed in widelands: | |
status: | Fix Committed → Fix Released |
I go first, but I need more input from others too. I thought about defining humidity and temperature and then use a simple function to turn this into the growth probably we had before. This is handwavy - I need help with coming up with such a function.
This does not solve the issue of how to group immovables for forresters though. One idea I have here is to sample the surrounding terrain, generate a list of the top 6 most suited trees for the terrains and randomly plant one of them.