Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#4012 closed defect (fixed)

[PATCH] Phoenician levant has unreachable trees

Reported by: sanderd17 Owned by: FeXoR
Priority: Should Have Milestone: Alpha 21
Component: Maps Keywords: patch
Cc: FeXoR Patch:

Description (last modified by elexis)

Pheonician levant (or was it Phoenician) has a lot of unreachable trees on the map boundary.

It's easy to find them via the obstruction overlay.

This is because on square maps, there's a border of 3 tiles wide that's unpassable and allows the terrain to fade to black.

The following patch should fix it (apparently map size is expressed in tiles instead of meters?).

Attachments (7)

Phönicia.diff (799 bytes ) - added by sanderd17 8 years ago.
Phönicia.2.diff (490 bytes ) - added by sanderd17 8 years ago.
First patch messes up mountains on the edge, second patch doesn't
fix_trees_in_map_border2016-6-3.patch (523 bytes ) - added by FeXoR 8 years ago.
Just uses the distance parameter instead of a hardcoded 3
map.js2016-6-11.patch (878 bytes ) - added by FeXoR 8 years ago.
Fixes the unhandled case if distance is not given
map.js2016-6-11rename.patch (33.6 KB ) - added by FeXoR 8 years ago.
ALTERNATIVE patch also renaming (mv) phoenician_levant.js/json to fix the typo
vokoscreen-2016-06-27_11-34-30.mkv.7z (803.5 KB ) - added by fatherbushido 8 years ago.
It looks like i have still the same bug but at bottom of the map now
placer_fix2016-6-28.diff (3.8 KB ) - added by FeXoR 8 years ago.
Fixes SimpleObject.place() placing entities outside playable map and add const MAP_BORDER_WIDTH

Download all attachments as: .zip

Change History (21)

by sanderd17, 8 years ago

Attachment: Phönicia.diff added

by sanderd17, 8 years ago

Attachment: Phönicia.2.diff added

First patch messes up mountains on the edge, second patch doesn't

comment:1 by FeXoR, 8 years ago

I guess adding a constant mapBorderShadowWidth, making it the default parameter for the distance parameter in Map.validT and use that for both, round and rectangular maps would be better. That also will require thorough testing especially on round maps of different sizes and the edges of rectangular maps to ensure we didn't overlook some behavoir of the engine we didn't expect.

by FeXoR, 8 years ago

Just uses the distance parameter instead of a hardcoded 3

comment:2 by FeXoR, 8 years ago

That last patch fixes an issue not taking into account the distanceparameter on rectangular maps. AFAIK that fixes the issue. Thanks sanderd17 for notifying me about this issue, the ticket and the patch.

comment:3 by FeXoR, 8 years ago

Owner: set to FeXoR
Resolution: fixed
Status: newclosed

In 18312:

Fixes a bug for random maps where Map.validT didn't apply the distance parameter properly on rectangular maps. Fixes #4012

comment:4 by FeXoR, 8 years ago

Keywords: review removed

comment:5 by sanderd17, 8 years ago

Resolution: fixed
Status: closedreopened

Apparently the patch is broken, the majority of resources don't appear on the map after this patch. Only a few bushes appear on the map.

comment:6 by FeXoR, 8 years ago

Component: UI & SimulationMaps

by FeXoR, 8 years ago

Attachment: map.js2016-6-11.patch added

Fixes the unhandled case if distance is not given

comment:7 by FeXoR, 8 years ago

Summary: [PATCH] Pheonician levant has unreachable trees[PATCH] Phoenician levant has unreachable trees

by FeXoR, 8 years ago

Attachment: map.js2016-6-11rename.patch added

ALTERNATIVE patch also renaming (mv) phoenician_levant.js/json to fix the typo

comment:8 by FeXoR, 8 years ago

Resolution: fixed
Status: reopenedclosed

In 18360:

Fixes a bug introduced in r18312 that prevents entity placement on some rectangular maps e.g. Phoenician Levant and Corsica vs Sardinia. Also fixes a typo in the Phoenician Levant .js and .json files. Fixes #4012

by fatherbushido, 8 years ago

It looks like i have still the same bug but at bottom of the map now

comment:9 by fatherbushido, 8 years ago

Resolution: fixed
Status: closedreopened

comment:10 by sanderd17, 8 years ago

@fatherbushido: it's not exactly the same bug. In the old bug, the trees never became visible as they were beyond the SoD edge.

It looks that in your case, the trees are placed exactly on the map boundary, creating little space for the units to gather the trees, and causing the units to block each other from movements.

It should be perfectly possible to gather the tree with a single unit in your case, so I'm not convinced this issue should be solved in the map. It should rather be solved in the UnitAI, UnitMotion and/or pathfinder.

by FeXoR, 8 years ago

Attachment: placer_fix2016-6-28.diff added

Fixes SimpleObject.place() placing entities outside playable map and add const MAP_BORDER_WIDTH

comment:11 by FeXoR, 8 years ago

Resolution: fixed
Status: reopenedclosed

comment:12 by FeXoR, 8 years ago

Fixed in changeset r18450

comment:13 by elexis, 6 years ago

Description: modified (diff)

refs r20283, #4814

comment:14 by elexis, 6 years ago

In 20439:

Tidy up rmgen point location randomization and retry loops.

Remove retryPlacing args helperobject by making use of the hoisting effect.
Remove the deprecation warning in retryPlacing and equally and the unused behaveDeprecated argument from createAreas and createAreasInAreas, refs #4294, rP19929, D249.

Rename randomizePlacerCoordinates to randomizeCoordinates and placer to group in the four createObjectGroups functions following rP17728,
because Groups aren't Placers (as established in rP20355), just share the randomizable x/z properties.

Fix randomizeCoordinates on square maps offering entity locations outside of the passable map area that are only rejected later in the codeflow, missed first in rP14183, but also rP18450 and rP20283, refs #4012, #4814.
Clarify randomizeCoordinates by passing a boolean stating whether to include the impassable map border instead of a varying halfMapSize.
Remove the unused halfMapSize argument from the randomizePlacerCoordinatesFromAreas call in createAreasInAreas.

Note: See TracTickets for help on using tickets.