Page MenuHomeWildfire Games

Schwarzwald tiny map - tile is undefined
ClosedPublic

Authored by FeXoR on Jan 31 2017, 12:11 AM.

Details

Summary

Random map Schwarzwald with mapsize set to tiny raises an error and doesn't start the match at all.

Test Plan

Execute Atlas, set random map to generate to Schwarzwald, optionally change seed and number of players (2 are advisable) to your liking, generate

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

There are a very large number of changes, so older changes are hidden. Show Older Changes
FeXoR added a comment.Jan 31 2017, 1:16 PM

And another one
Changed SVN-diff to use slash instead of backslash...

FeXoR updated this revision to Diff 409.Jan 31 2017, 1:18 PM

Reverted changes
Commented out svn-diff again...

FeXoR updated this revision to Diff 410.Jan 31 2017, 1:26 PM

Aaand another attempt
Test if svn-diff is linked correctly... sorry...

FeXoR updated this revision to Diff 411.Jan 31 2017, 1:28 PM

And another one...
Yea, I know...

FeXoR updated this revision to Diff 412.Jan 31 2017, 1:34 PM

yet another
Jepeee

FeXoR updated this revision to Diff 413.Jan 31 2017, 1:35 PM

Out of ideas
Well, no context available for now...

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

Stan added inline comments.Jan 31 2017, 2:33 PM
binaries/data/mods/public/maps/random/heightmap/heightmap.js
156 ↗(On Diff #413)

Dont you log it twice ?

122 ↗(On Diff #403)

Perhaps we could write a IsBetween (lowerBound, higherBound);
function put it in the global scripts. An simply call !IsBetween here

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

FeXoR updated this revision to Diff 415.Jan 31 2017, 5:09 PM

Another try
svn diff now definitely gives full context. Let's see if this works out...

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

FeXoR updated this revision to Diff 416.Jan 31 2017, 5:40 PM

And another try
Maybe a Windows cache update problem?

FeXoR updated this revision to Diff 417.Jan 31 2017, 5:54 PM

Another try
"svn diff" definitely shows full context ;/

FeXoR updated this revision to Diff 418.Jan 31 2017, 5:57 PM

Resetting to best chice I found
So no context for now...

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running debug tests...
Running cxxtest tests (302 tests)..............................................................................................................................................................................................................................................................................................................OK!

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

Build has FAILED

Link to build: http://jw:8080/job/phabricator/296/
See console output for more information: http://jw:8080/job/phabricator/296/console

FeXoR added inline comments.Feb 7 2017, 5:48 PM
binaries/data/mods/public/maps/random/heightmap/heightmap.js
156 ↗(On Diff #413)

Yes. The fist will be logged if there is no valid point on the map any placement is possible. The second will occur if there are points where placement could happen but still nothing has been placed. The second should never happen, it's just there to be sure if it happens it's logged. They will never occur both ar the same call (for the function returns if the first one triggers).

elexis edited edge metadata.Feb 23 2017, 6:23 PM

Despite the fact that the last change was in october 2016 (rP18840), the patch doesn't apply somehow.
The one on the ticket still works: http://trac.wildfiregames.com/attachment/ticket/4152/heightmapFix2016-12-6.patch

FeXoR added inline comments.Feb 23 2017, 8:10 PM
binaries/data/mods/public/maps/random/heightmap/heightmap.js
122 ↗(On Diff #403)

That indeed might be a good idea. Thanks!

FeXoR updated this revision to Diff 586.Feb 23 2017, 8:23 PM

Try another time since the last diff didn't apply for some reason

elexis edited the summary of this revision. (Show Details)Feb 23 2017, 9:24 PM
elexis removed reviewers: niektb, mimo.

Build has FAILED

Link to build: http://jw:8080/job/phabricator/395/
See console output for more information: http://jw:8080/job/phabricator/395/console

elexis requested changes to this revision.Feb 28 2017, 4:16 PM

Patch works as it now doesn't assume that we always find a valid tile to place the mines and instead prints a logmessage and goes on with the mapgen.
Few code style improvements proposed.

binaries/data/mods/public/maps/random/heightmap/heightmap.js
156 ↗(On Diff #413)

Two spaces

113 ↗(On Diff #586)

Add a newline somewhere in the argument list.
The ref to g_Gaia should be avoided, the argument should become mandatory and the 2 users of that function should pass it instead.

118 ↗(On Diff #586)

dont add that pair of braces, not needed nor useful IMO

123 ↗(On Diff #586)

Okay (mentioned the destructuring assignment in irc few days ago, i.e. let [cX, cY] = [x + 0.5, y + 0.5], but I didn't see you push the checkpoint, so it's all good)

125 ↗(On Diff #586)

newline after the continue statements
(I suggested to merge those if statements in irc few days ago, but it seems more readable in the current state, so you can keep it the way it is)

126 ↗(On Diff #586)

Avoid "Avoid avoidPoints", rephrase

128 ↗(On Diff #586)

It bugged here:

ERROR: JavaScript error: maps/random/heightmap/heightmap.js line 128
TypeError: tile is undefined
  distributeEntitiesByHeight@maps/random/heightmap/heightmap.js:128:1
  @maps/random/schwarzwald.js:266:1

as it assumed that we can find a valid tile.

135 ↗(On Diff #586)

Two spaces.
Also doesn't show any arguments, only the callstack. The callstack is useful as other maps might use this function in many places.
I'd add uneval(entityList) and an "\n" before the callstack.
Perhaps you can use print instead of log, so that it not only ends up in the logfile but also in the terminal output.

146 ↗(On Diff #586)

Use the new pickRandom function here

This revision now requires changes to proceed.Feb 28 2017, 4:16 PM
FeXoR updated this revision to Diff 668.Mar 1 2017, 11:02 PM
FeXoR edited edge metadata.

Adjusted to comments of elexis, thanks!

elexis accepted this revision.Mar 1 2017, 11:32 PM

still dont like those braces :p
no space before the \n in the string
integer does not exist in JS (doc), only number

Thanks for the fix!

This revision is now accepted and ready to land.Mar 1 2017, 11:32 PM

Build has FAILED

Link to build: http://jw:8080/job/phabricator/445/
See console output for more information: http://jw:8080/job/phabricator/445/console

FeXoR updated this revision to Diff 759.Mar 11 2017, 1:51 PM

Removed spaces
Changed "integer" to "number" for js doc for the changed function
Thanks elexis!

The "build failed" message does seem to be unrelated to this patch:

  • Raw diff applied cleanly
  • Nothing needed to be build

Build has FAILED

Link to build: http://jw:8080/job/phabricator/497/
See console output for more information: http://jw:8080/job/phabricator/497/console

FeXoR added inline comments.Mar 11 2017, 2:16 PM
binaries/data/mods/public/maps/random/heightmap/heightmap.js
123 ↗(On Diff #586)

That "checkpoint" is actually needed and pushed to the list of valid points at the end in this format.
I agree that the chosen format is not optimal - we have different kinds of "point" formats in use throughout rmgen only. That's indeed bad.

FeXoR requested review of this revision.Mar 11 2017, 2:57 PM
FeXoR edited edge metadata.
elexis accepted this revision.Mar 11 2017, 3:06 PM

Ok but replace the two spaces with one space in the two log() calls

This revision is now accepted and ready to land.Mar 11 2017, 3:06 PM
FeXoR updated this revision to Diff 763.Mar 11 2017, 3:27 PM

Removed the "two spaces".

Build has FAILED

Link to build: http://jw:8080/job/phabricator/499/
See console output for more information: http://jw:8080/job/phabricator/499/console

FeXoR requested review of this revision.Mar 11 2017, 3:28 PM
FeXoR edited edge metadata.
elexis accepted this revision.Mar 11 2017, 3:31 PM

And thats's where the diff of the diff function comes in handy

This revision is now accepted and ready to land.Mar 11 2017, 3:31 PM
This revision was automatically updated to reflect the committed changes.