Page MenuHomeWildfire Games

Chose the biome in the gamesetup
ClosedPublic

Authored by elexis on Aug 30 2017, 11:16 PM.

Details

Summary

About 25 random maps use the random biome system. It would be nice if players could chose the biome in the gamesetup.
The proposed patch is remotly based on a patch Grugnas had sent me.
The descriptions come from @Hannibal_Barca.

Test Plan

do a barrel roll

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Aug 30 2017, 11:16 PM
elexis updated this revision to Diff 3401.Aug 30 2017, 11:18 PM

Fix whitespace in island_stronghold.json

Vulcan added a subscriber: Vulcan.Aug 31 2017, 12:12 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jenkins-master:8080/job/phabricator/1940/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1660| »   while·(g_IsNetworked)
|    | [NORMAL] ESLintBear (no-unmodified-loop-condition):
|    | 'g_IsNetworked' is not modified in this loop.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1485| »   »   »   »   if·(g_Settings.Biomes.every(bio·=>·bio.Id·!=·biome))
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1486| »   »   »   »   »   warn("Map·'"·+·g_GameAttributes.map·+·"'·contains·unknown·biome·'"·+·biome·+·"'")
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1642| »   if·(g_LoadingState·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1694| »   »   if·(playerData.some((pData,·j)·=>·i·!=·j·&&·sameColor(playerData[i].Color,·pData.Color)))
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1695| »   »   »   playerData[i].Color·=·g_PlayerColorPickerList.find(color·=>·playerData.every(pData·=>·!sameColor(color,·pData.Color)));
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1876| »   »   »   chosenCiv·=·pickRandom(Object.keys(g_CivData).filter(civ·=>·g_CivData[civ].Culture·==·culture));
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1890| »   »   let·usedName·=·g_GameAttributes.settings.PlayerData.filter(pData·=>·pData.Name·&&·pData.Name.indexOf(chosenName)·!==·-1).length;
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/maps/random/rmgen/randombiome.js
| 466| »   »   var·random_trees·=·randIntInclusive(1,·3);
|    | [NORMAL] JSHintBear:
|    | 'random_trees' is already defined.

binaries/data/mods/public/gui/common/settings.js
| 356| »   let·mapSize·=·g_Settings.MapSizes.find(mapSize·=>·mapSize.Tiles·==·+tiles);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'mapSize' is already declared in the upper scope.

binaries/data/mods/public/gui/common/settings.js
| 380| »   let·vc·=·g_Settings.VictoryConditions.find(vc·=>·vc.Name·==·gameType);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'vc' is already declared in the upper scope.

binaries/data/mods/public/gui/common/settings.js
| 174| »   »   "Title":·timeout·==·0·?·translateWithContext("ceasefire",·"No·ceasefire")·:
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/common/settings.js
| 225| »   if·(victoryConditions.some(vc·=>·vc·==·undefined))
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with 'undefined'.
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"gaia/fauna_lion"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/ngorongoro.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/ngorongoro.js
| 261| 261| RMS.SetProgress(60);
| 262| 262| 
| 263| 263| g_Gaia.mainHuntableAnimal = "gaia/fauna_lioness";
| 264|    |-g_Gaia.secondaryHuntableAnimal =  "gaia/fauna_lion";
|    | 264|+g_Gaia.secondaryHuntableAnimal = "gaia/fauna_lion";
| 265| 265| g_Terrains.mainTerrain = "savanna_grass_a_wetseason";
| 266| 266| g_Terrains.forestFloor1 = "savanna_grass_a";
| 267| 267| g_Terrains.forestFloor2 = "savanna_grass_b";
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"gaia/fauna_elephant_african_bush"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/ngorongoro.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/m

http://jenkins-master:8080/job/phabricator_lint/458/ for more details.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jenkins-master:8080/job/phabricator/1941/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/maps/random/flood.js
| 120| »   let·fx·=·fractionToTiles(playerX[i]);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'fx' is already declared in the upper scope.

binaries/data/mods/public/maps/random/flood.js
| 121| »   let·fz·=·fractionToTiles(playerZ[i]);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'fz' is already declared in the upper scope.

binaries/data/mods/public/maps/random/flood.js
| 122| »   let·ix·=·round(fx);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ix' is already declared in the upper scope.

binaries/data/mods/public/maps/random/flood.js
| 123| »   let·iz·=·round(fz);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'iz' is already declared in the upper scope.

binaries/data/mods/public/maps/random/flood.js
| 128| »   let·placer·=·new·ClumpPlacer(hillSize,·0.80,·0.1,·10,·ix,·iz);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'placer' is already declared in the upper scope.

binaries/data/mods/public/maps/random/flood.js
| 129| »   let·terrainPainter·=·new·LayeredPainter(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'terrainPainter' is already declared in the upper scope.

binaries/data/mods/public/maps/random/flood.js
| 133| »   let·elevationPainter·=·new·SmoothElevationPainter(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'elevationPainter' is already declared in the upper scope.

binaries/data/mods/public/maps/random/flood.js
| 229| »   let·placer·=·new·ChainPlacer(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'placer' is already declared in the upper scope.

binaries/data/mods/public/maps/random/flood.js
| 240| »   let·terrainPainter·=·new·LayeredPainter(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'terrainPainter' is already declared in the upper scope.

binaries/data/mods/public/maps/random/flood.js
| 244| »   let·elevationPainter·=·new·SmoothElevationPainter(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'elevationPainter' is already declared in the upper scope.

binaries/data/mods/public/maps/random/flood.js
| 254| »   let·placer·=·new·ChainPlacer(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'placer' is already declared in the upper scope.

binaries/data/mods/public/maps/random/flood.js
| 265| »   let·terrainPainter·=·new·LayeredPainter(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'terrainPainter' is already declared in the upper scope.

binaries/data/mods/public/maps/random/flood.js
| 269| »   let·elevationPainter·=·new·SmoothElevationPainter(
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'elevationPainter' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"gaia/fauna_lion"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/ngorongoro.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/ngorongoro.js
| 261| 261| RMS.SetProgress(60);
| 262| 262| 
| 263| 263| g_Gaia.mainHuntableAnimal = "gaia/fauna_lioness";
| 264|    |-g_Gaia.secondaryHuntableAnimal =  "gaia/fauna_lion";
|    | 264|+g_Gaia.secondaryHuntableAnimal = "gaia/fauna_lion";
| 265| 265| g_Terrains.mainTerrain = "savanna_grass_a_wetseason";
| 266| 266| g_Terrains.forestFloor1 = "savanna_grass_a";
| 267| 267| g_Terrains.forestFloor2 = "savanna_grass_b";
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"gaia/fauna_elephant_african_bush"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/ngorongoro.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/ngorongoro.js
| 388| 388| RMS.SetProgress(70);
| 389| 389| 
| 390| 390| g_Gaia.mainHuntableAnimal = "gaia/fauna_rhino";
| 391|    |-g_Gaia.secondaryHuntableAnimal =  "gaia/fauna_elephant_african_bush";
|    | 391|+g_Gaia.secondaryHuntableAnimal = "gaia/fauna_elephant_african_bush";
| 392| 392| initBiome();
| 393| 393| 
| 394| 394| log("Render eden...");

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1660| »   while·(g_IsNetworked)
|    | [NORMAL] ESLintBear (no-unmodified-loop-condition):
|    | 'g_IsNetworked' is not modified in this loop.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1485| »   »   »   »   if·(g_Settings.Biomes.every(bio·=>·bio.Id·!=·biome))
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1486| »   »   »   »   »   warn("Map·'"·+·g_GameAttributes.map·+·"'·contains·unknown·biome·'"·+·biome·+·"'")
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1642| »   if·(g_LoadingState·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1694| »   »   if·(playerData.some((pData,·j)·=>·i·!=·j·&&·sameColor(playerData[i].Color,·pData.Color)))
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1695| »   »   »   playerData[i].Color·=·g_PlayerColorPickerList.find(color·=>·playerData.every(pData·=>·!sameColor(color,·pData.Color)));
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1876| »   »   »   chosenCiv·=·pickRandom(Object.keys(g_CivData).filter(civ·=>·g_CivData[civ].Culture·==·culture));
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
|1890| »   »   let·usedName·=·g_GameAttributes.settings.PlayerData.filter(pData·=>·pData.Name·&&·pData.Name.indexOf(chosenName)·!==·-1).length;
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/maps/random/rmgen/randombiome.js
| 466| »   »   var·random_trees·=·randIntInclusive(1,·3);
|    | [NORMAL] JSHintBear:
|    | 'random_trees' is already defined.

binaries/data/mods/public/gui/common/settings.js
| 356| »   let·mapSize·=·g_Settings.MapSizes.find(mapSize·=>·mapSize.Tiles·==·+tiles);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'mapSize' is already declared in the upper scope.

binaries/data/mods/public/gui/common/settings.js
| 380| »   let·vc·=·g_Settings.VictoryConditions.find(vc·=>·vc.Name·==·gameType);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'vc' is already declared in the upper scope.

binaries/data/mods/public/gui/common/settings.js
| 174| »   »   "Title":·timeout·==·0·?·translateWithContext("ceasefire",·"No·ceasefire")·:
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/common/settings.js
| 225| »   if·(victoryConditions.some(vc·=>·vc·==·undefined))
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with 'undefined'.
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"gaia/fauna_hawk"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/pompeii.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/pompeii.js
|  48|  48| g_Terrains.roadWild = "road1";
|  49|  49| g_Terrains.road = "road1";
|  50|  50| g_Gaia.mainHuntableAnimal = "gaia/fauna_goat";
|  51|    |-g_Gaia.secondaryHuntableAnimal =  "gaia/fauna_hawk";
|    |  51|+g_Gaia.secondaryHuntableAnimal = "gaia/fauna_hawk";
|  52|  52| g_Gaia.fruitBush = "gaia/fauna_chicken";
|  53|  53| g_Gaia.fish = "gaia/fauna_fish";
|  54|  54| g_Gaia.tree1 = "gaia/flora_tree_dead";
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before '"gaia/fauna_gazelle"'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/bahrain.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/r

http://jenkins-master:8080/job/phabricator_lint/459/ for more details.

the patch works and looks quite good.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
206 ↗(On Diff #3401)

the variable contains biomes supported by the map

364 ↗(On Diff #3401)

Indeed dispalying the biomes dropdown in the more options dialog makes me think that this is the place also for other settings relative to the map generation like the approximative amount ( e.g. amount: sparse / average / abundant) for each type of resources (wood, food, mines). I wonder if players should also know about the current biome directly the settings as long the preview image doesn't change.

Grugnas accepted this revision.Aug 31 2017, 9:23 PM
This revision is now accepted and ready to land.Aug 31 2017, 9:23 PM
Hannibal_Barca requested changes to this revision.EditedSep 2 2017, 2:38 PM
Hannibal_Barca added a reviewer: Hannibal_Barca.

"Description": "This biome is a variant of the Temperate biome and features a warm, inviting and colourful environment. Fallen leaves carpet the ground and make this a truly amazing place to play at."

I'm still uncertain whether the phrase "place to play at" is suitable in this context.
I did not suggest it and I certainly don't commend it while in doubt.

This revision now requires changes to proceed.Sep 2 2017, 2:40 PM
Hannibal_Barca accepted this revision.Sep 2 2017, 8:34 PM

Anyway as its otherwise good and working, I accept this as long as the mentioned problem is addressed.

This revision is now accepted and ready to land.Sep 2 2017, 8:34 PM

thank you Grugnas!

Lionkanzen added a subscriber: Lionkanzen.
This revision was automatically updated to reflect the committed changes.
elexis added a comment.Sep 5 2017, 3:21 PM

Committing this without the strings. Please enhance them.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
364 ↗(On Diff #3401)

Agree, it should be added to gamedescriptions! Prefer to do it separately.

1490 ↗(On Diff #3401)

Adding deepfreeze here... oh wait, it's already in prepareForDropdown :-)

binaries/data/mods/public/simulation/data/settings/biomes.json
1 ↗(On Diff #3401)

Not fond of starting every sentence in the same pattern "Foo biome ..."

8 ↗(On Diff #3401)

The
typically
No mentioning of the Poplar trees (or at least broadleaf trees) that make up the majority of forests?
No mentioning of the occasional apple trees?
No mentioning of the lush grasslands?
"filled with animals" seems like false advertizements. The amount depends on the map and most of them don't spam animals.

13 ↗(On Diff #3401)

According to wikipedia,

A biome is a community of plants and animals that have common characteristics for the environment they exist in.

So it would be great to at least avoid the word "Snowy biome" in the desription.

as its name implies

Doesn't add value to the description. If something is redundant, mentioning that we have redundancy just adds to the redundancy instead of avoiding it.

"conifers" is good

Such fauna as may be found here

needlessly complicated sentence structure

18 ↗(On Diff #3401)

sporting?
Other than that ok.