Page MenuHomeWildfire Games

Wild Lake random map script
ClosedPublic

Authored by FeXoR on May 24 2017, 3:13 PM.

Details

Summary

FeXoR's random map proposal from https://wildfiregames.com/forum/index.php?/topic/17642-random-map-realistic-terrain-demo/&page=5#comment-330931
(FeXoR please commandeer this and edit the title / patch)

Test Plan

Besides checking for passability, resource collisions, not having endless lists of defaults in function headers,
start the map on the tiny size too.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

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!

http://jw:8080/job/phabricator/1339/ for more details.

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

binaries/data/mods/public/maps/random/wild_lake.js
| 504| let·initialHeightmap·=·[
|    | [MAJOR] ESLintBear:
|    | Parsing error: Identifier 'initialHeightmap' has already been declared

binaries/data/mods/public/maps/random/wild_lake.js
| 116| »   »   let·indexToAddTo·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'indexToAddTo' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 281| »   »   if·(placements.every(p·=>·getDistance(p.x,·p.y,·point.x,·point.y)·>·max(minDistance,·p.dist)))
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 376| »   »   if·(i·%·3·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 424| »   »   return·averageDistToCC·+·randFloat(-·dAverageDistToCC,·dAverageDistToCC)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 443| »   »   if·(i·%·2·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 475| randomizeBiome()
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 504| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 513| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 522| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 764| »   »   let·actor·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'actor' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 812| »   if·(choice·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/31/ 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!

http://jw:8080/job/phabricator/1340/ for more details.

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

binaries/data/mods/public/maps/random/wild_lake.js
| 504| let·initialHeightmap·=·[
|    | [MAJOR] ESLintBear:
|    | Parsing error: Identifier 'initialHeightmap' has already been declared

binaries/data/mods/public/maps/random/wild_lake.js
| 116| »   »   let·indexToAddTo·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'indexToAddTo' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 281| »   »   if·(placements.every(p·=>·getDistance(p.x,·p.y,·point.x,·point.y)·>·max(minDistance,·p.dist)))
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 376| »   »   if·(i·%·3·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 424| »   »   return·averageDistToCC·+·randFloat(-·dAverageDistToCC,·dAverageDistToCC)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 443| »   »   if·(i·%·2·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 475| randomizeBiome()
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 504| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 513| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 522| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 764| »   »   let·actor·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'actor' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 812| »   if·(choice·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/32/ 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!

http://jw:8080/job/phabricator/1341/ for more details.

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

binaries/data/mods/public/maps/random/wild_lake.js
| 504| let·initialHeightmap·=·[
|    | [MAJOR] ESLintBear:
|    | Parsing error: Identifier 'initialHeightmap' has already been declared

binaries/data/mods/public/maps/random/wild_lake.js
| 116| »   »   let·indexToAddTo·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'indexToAddTo' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 281| »   »   if·(placements.every(p·=>·getDistance(p.x,·p.y,·point.x,·point.y)·>·max(minDistance,·p.dist)))
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 376| »   »   if·(i·%·3·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 424| »   »   return·averageDistToCC·+·randFloat(-·dAverageDistToCC,·dAverageDistToCC)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 443| »   »   if·(i·%·2·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 475| randomizeBiome()
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 504| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 513| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 522| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 764| »   »   let·actor·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'actor' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 812| »   if·(choice·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/33/ for more details.

elexis added inline comments.May 26 2017, 4:04 AM
binaries/data/mods/public/maps/random/wild_lake.js
10

Just use Date.now() in these instances since we don't use the new Date object

FeXoR updated this revision to Diff 2284.May 28 2017, 7:03 PM
FeXoR edited edge metadata.
FeXoR marked 6 inline comments as done.

Fixes elexis remarks (but map specificarguments).
Changed the order so woods don't grow into bases.
Added settlements, not fully designed yet.
Added terrain flattening for settlements (flat) and raider camps (pits).
ToDo:

  • Biome specific settlements
  • Biome specific domestic animals and farm buildings
  • Biome specific raiders
  • Move some functions to libs
FeXoR planned changes to this revision.May 28 2017, 7:06 PM

Also needs a screenshot, but I guess better when it's finished ... which it is not ^^

FeXoR updated this revision to Diff 2287.May 28 2017, 8:18 PM

Settlements are ready now. Please check the guarding units.

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

binaries/data/mods/public/maps/random/wild_lake.js
| 504| let·initialHeightmap·=·[
|    | [MAJOR] ESLintBear:
|    | Parsing error: Identifier 'initialHeightmap' has already been declared

binaries/data/mods/public/maps/random/wild_lake.js
| 116| »   »   let·indexToAddTo·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'indexToAddTo' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 281| »   »   if·(placements.every(p·=>·getDistance(p.x,·p.y,·point.x,·point.y)·>·max(minDistance,·p.dist)))
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 351| »   »   if·(i·%·3·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 424| »   »   return·averageDistToCC·+·randFloat(-·dAverageDistToCC,·dAverageDistToCC)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 443| »   »   if·(i·%·2·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 475| randomizeBiome()
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 504| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 513| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 522| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 912| »   »   let·actor·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'actor' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 963| »   if·(choice·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/75/ for more details.

FeXoR updated this revision to Diff 2291.May 28 2017, 10:17 PM

Made farms biome specific

For tiny (and small) map sizes I have to use a different initial terrain and/or water level ;/

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://jw:8080/job/phabricator/1399/ for more details.

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

binaries/data/mods/public/maps/random/wild_lake.js
| 504| let·initialHeightmap·=·[
|    | [MAJOR] ESLintBear:
|    | Parsing error: Identifier 'initialHeightmap' has already been declared

binaries/data/mods/public/maps/random/wild_lake.js
| 116| »   »   let·indexToAddTo·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'indexToAddTo' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 281| »   »   if·(placements.every(p·=>·getDistance(p.x,·p.y,·point.x,·point.y)·>·max(minDistance,·p.dist)))
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 351| »   »   if·(i·%·3·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 424| »   »   return·averageDistToCC·+·randFloat(-·dAverageDistToCC,·dAverageDistToCC)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 443| »   »   if·(i·%·2·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 475| randomizeBiome()
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 504| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 513| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 522| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 912| »   »   let·actor·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'actor' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 963| »   if·(choice·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/76/ 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://jw:8080/job/phabricator/1400/ for more details.

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

binaries/data/mods/public/maps/random/wild_lake.js
| 716| let·initialHeightmap·=·[
|    | [MAJOR] ESLintBear:
|    | Parsing error: Identifier 'initialHeightmap' has already been declared

binaries/data/mods/public/maps/random/wild_lake.js
| 116| »   »   let·indexToAddTo·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'indexToAddTo' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 281| »   »   if·(placements.every(p·=>·getDistance(p.x,·p.y,·point.x,·point.y)·>·max(minDistance,·p.dist)))
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 309| randomizeBiome()
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 550| »   »   if·(i·%·3·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 641| »   »   return·averageDistToCC·+·randFloat(-·dAverageDistToCC,·dAverageDistToCC)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 660| »   »   if·(i·%·2·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 716| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 725| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 734| let·initialHeightmap·=·[
|    | [MAJOR] JSHintBear:
|    | 'initialHeightmap' has already been declared.

binaries/data/mods/public/maps/random/wild_lake.js
| 933| »   »   let·actor·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'actor' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 984| »   if·(choice·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/77/ 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://jw:8080/job/phabricator/1402/ for more details.

I tested this map, and I think it is nice from a gameplay perspective (didn't look at the code).

Some things I noticed (some already discussed):

  • The settlements could be placed with more gaia units.
  • The number of fish in the lake could possibly be decreased a bit.
  • Got these once:
ERROR: CCacheLoader failed to find archived or source file for: "simulation/templates/structures/mercenary_camp_egyptian.xml"
ERROR: Failed to load entity template 'structures/mercenary_camp_egyptian'
ERROR: Failed to load entity template 'structures/mercenary_camp_egyptian'

(I don't think that's the template name.)

  • Maybe too many generic animals placed (the actual animal type is different for every biome, of course), although it does come down to matter of preference at some point, of course:
  • Fences can get placed on very uneven terrain and get "split" (unavoidable perhaps):

But all in all, a very nice map! I'm looking forward to seeing this one come along.

FeXoR updated this revision to Diff 2343.EditedMay 31 2017, 11:02 PM

Fixed:

  • Player placement fails on Tiny and small maps: Smaller lake and slightly reduced player base smothing and no Iberian walls on those map sizes
  • Changed the one occurrence of mercenary_camp_egyptian to merc_camp_egyptian. Good catch! ;)
  • Halfed the number of animals at the lake
  • Smothened the terrain below farms
  • Slightly reduced the amount of fish

The mappreview is missing.
Would be nice if someone with full graphics enabled could provide some ;)

Imarok added a subscriber: Imarok.Jun 1 2017, 1:06 AM

?
Seems like disabling session GUI (Alt + G) doesn't work anymore :/

elexis added a comment.Jun 1 2017, 1:24 AM

On the large mapsize, got iber walls ending up inside the civic center of another player (seed 6738, default civs).
Mostly because the lake is way too big on the large size sometimes. (feels like 75% maparea + 10% forests).
CC's ending up inside each other is very frequent on tiny mapsizes. The same function as on caledonian maedows is used and that has the same issue. So that will have to be fixed in a separate patch anyway.
The lakesize should still be capped.

As proposed on the forums a while ago, placing empty military camps that can be captured by players will be really imablancing, give a huge advantage to the closest player (low effort, high reward).
It should be garrisoned by those starting units. I'll hand in a patch.

binaries/data/mods/public/maps/random/wild_lake.js
7

Nuke the pointless comment

55

space after { and before }

82

wat is?

98

let pointsToAdd = points.reverse() and removing the pointsToAdd.shift?

117

just let indexToAddTo; without the = undefined

145

Remove or use this unused function

170

Math.cos and Math.sin.
We want to remove all of these aliases some day

190

space after { and before }

More readable with \n:

vectorField[x].push({
     "x": scalarField[(x + 1) % max_x][y] - scalarField[x][y],
     "y": scalarField[x][(y + 1) % max_y] - scalarField[x][y]
});
243

{array} -> {object}
associative array -> object
"each containing a float" unneeded (every JS number is of floating point format)

244

whitespace in objects.

(Default args are formatted correctly: http://usejsdoc.org/tags-param.html#optional-parameters-and-default-values )

246

20 (the joys of mentioning the defaults in the comments)

271

The last 4 lines before the continue: -1 tab +4 spaces

274

Same for this one

275

1 space missing

541

Those huge lists of defaults hurt. Might be defined in a global.

tree5 on an own line

groveTileClass on a separate line too

604

(Could do something with concat and map. Probably won't look better.)

611

hurt

636

10 is ok. According to rP18816, 9 is the min distance for CCs. The trees are really close, but that works.

642

-dAverage...

671

These angles look like they prevent resource collisions.

688

// Time Check comment pointless

828

// Time Check comment unneeded

859

Remove or fix

884

Remove the else keyword

944

same

955

^

967

let getMapSize = getMapSize() at the top of the file and replace the getter calls.
Or use g_Map.size everywhere like you do 2 lines below.

Remove the boolean and "iberWall": mapSize > 192

976

(If it appeals to you, could become an if-elseif chain)

1005

pointless comment

1010

pointless comment

binaries/data/mods/public/maps/random/wild_lake.json
7

That description doesn' vacillate and comes to the point. That has it's own charm.

elexis added inline comments.Jun 1 2017, 1:39 AM
binaries/data/mods/public/maps/random/wild_lake.js
440

Template -> "Template"
Count -> "Count"

elexis added a comment.Jun 1 2017, 1:52 AM

(
Just for the afterworld:

After defining mercenaryCampGuards we could set them to defensive with

// Set units as defensive
mercenaryCampGuards = mercenaryCampGuards.map(biomeSet => biomeSet.map(group => ({
	"Template": "defensive|" + group.Template,
	"Count": group.Count
})));

and adding to binaries/data/mods/public/simulation/templates/special_filter/defensive.xml:

<?xml version="1.0" encoding="utf-8"?>
<Entity merge="">
  <UnitAI merge="">
    <DefaultStance>defensive</DefaultStance>
  </UnitAI>
</Entity>

But that breaks for the AI for the same reason as in D230. So, would have been nice
)

Vulcan added a comment.Jun 1 2017, 1:56 AM
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'indexToAddTo' to undefined.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/wild_lake.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/wild_lake.js
| 113| 113| 	let numPointsToAdd = pointsToAdd.length;
| 114| 114| 	for (let i = 0; i < numPointsToAdd; ++i)
| 115| 115| 	{
| 116|    |-		let indexToAddTo = undefined;
|    | 116|+		let indexToAddTo;
| 117| 117| 		let minEnlengthen = Infinity;
| 118| 118| 		let minDist1 = 0;
| 119| 119| 		let minDist2 = 0;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'actor' to undefined.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/wild_lake.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/wild_lake.js
| 918| 918| 	{
| 919| 919| 		let x = areas[h][t].x;
| 920| 920| 		let y = areas[h][t].y;
| 921|    |-		let actor = undefined;
|    | 921|+		let actor;
| 922| 922| 		let texture = pickRandom(wildLakeBiome[h].texture);
| 923| 923| 
| 924| 924| 		if (slopeMap[x][y] < 0.5 * (minSlope[h] + maxSlope[h]))

binaries/data/mods/public/maps/random/wild_lake.js
| 150| »   while·(true)
|    | [NORMAL] ESLintBear (no-constant-condition):
|    | Unexpected constant condition.

binaries/data/mods/public/maps/random/wild_lake.js
| 538| »   groveActors·=·[g_Decoratives.grass,·g_Decoratives.rockMedium,·g_Decoratives.bushMedium],·groveTileClass·=·undefined,
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'groveActors' is already declared in the upper scope.

binaries/data/mods/public/maps/random/wild_lake.js
| 116| »   »   let·indexToAddTo·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'indexToAddTo' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 281| »   »   if·(placements.every(p·=>·getDistance(p.x,·p.y,·point.x,·point.y)·>·max(minDistance,·p.dist)))
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 286| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 309| randomizeBiome()
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 550| »   »   if·(i·%·3·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 641| »   »   return·averageDistToCC·+·randFloat(-·dAverageDistToCC,·dAverageDistToCC)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 660| »   »   if·(i·%·2·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 921| »   »   let·actor·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'actor' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 975| »   if·(choice·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/91/ for more details.

FeXoR marked 3 inline comments as done.Jun 1 2017, 2:08 AM
FeXoR added inline comments.
binaries/data/mods/public/maps/random/wild_lake.js
636

They must be close to not collide with the Iberian walls

671

They do ^^

elexis added a comment.Jun 1 2017, 2:12 AM

screenshot by Imarok transformed

FeXoR marked 10 inline comments as done.Jun 1 2017, 2:24 AM
FeXoR added inline comments.
binaries/data/mods/public/maps/random/wild_lake.js
82

Traveling salesman problem solved for the case of a closed path.
Or what do you mean?

FeXoR updated this revision to Diff 2344.EditedJun 1 2017, 2:42 AM

Fixed most of elexis comments
Increases defenders of the mercenary camps
Larger map sizes also have smaller lakes (maybe that initial heightmap would work well for all map sizes)

Vulcan added a comment.Jun 1 2017, 2:43 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://jw:8080/job/phabricator/1425/ for more details.

Vulcan added a comment.Jun 1 2017, 2:45 AM
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'actor' to undefined.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/wild_lake.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/maps/random/wild_lake.js
| 890| 890| 	{
| 891| 891| 		let x = areas[h][t].x;
| 892| 892| 		let y = areas[h][t].y;
| 893|    |-		let actor = undefined;
|    | 893|+		let actor;
| 894| 894| 		let texture = pickRandom(wildLakeBiome[h].texture);
| 895| 895| 
| 896| 896| 		if (slopeMap[x][y] < 0.5 * (minSlope[h] + maxSlope[h]))

binaries/data/mods/public/maps/random/wild_lake.js
| 507| »   groveActors·=·[g_Decoratives.grass,·g_Decoratives.rockMedium,·g_Decoratives.bushMedium],·groveTileClass·=·undefined,
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'groveActors' is already declared in the upper scope.

binaries/data/mods/public/maps/random/wild_lake.js
| 250| »   »   if·(placements.every(p·=>·getDistance(p.x,·p.y,·point.x,·point.y)·>·max(minDistance,·p.dist)))
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/maps/random/wild_lake.js
| 255| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 255| »   »   if·(tries·!=·0·&&·tries·%·100·==·0)·//·Time·Check
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 278| randomizeBiome()
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 519| »   »   if·(i·%·3·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 610| »   »   return·averageDistToCC·+·randFloat(-dAverageDistToCC,·dAverageDistToCC)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/maps/random/wild_lake.js
| 629| »   »   if·(i·%·2·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/maps/random/wild_lake.js
| 893| »   »   let·actor·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'actor' to 'undefined'.

binaries/data/mods/public/maps/random/wild_lake.js
| 944| »   if·(choice·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/92/ for more details.

elexis accepted this revision.Jun 1 2017, 3:25 AM

Seed 8491, Normal Mapsize spawns a bit many muskox in the forests.
(Mark my words with the mercenary camps.)

binaries/data/mods/public/maps/random/wild_lake.js
708

Since its perfectly symmetrical, it looks like it could just be represented with a radius number

This revision is now accepted and ready to land.Jun 1 2017, 3:25 AM
Vulcan added a comment.Jun 1 2017, 3:31 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://jw:8080/job/phabricator/1426/ for more details.

FeXoR updated this revision to Diff 2348.Jun 1 2017, 10:42 AM

Added mappreview

This revision was automatically updated to reflect the committed changes.

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://jw:8080/job/phabricator/1429/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/94/ for more details.