Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4295 closed defect (fixed)

[PATCH] Berries on impassable mountains on ardennes forests

Reported by: elexis Owned by: Ágoston Sipos
Priority: Nice to Have Milestone: Alpha 22
Component: Maps Keywords: patch
Cc: Patch:

Description (last modified by elexis)

Sometimes berries can be placed onto impassable mountains on the map ardennes forest. The women trying to pick them will not detect this.

The bug can be easily reproduced by increasing the number of berries by a factor of 100.

The placing of berries on that map does not consider explorableArea like other calls. However adding that alone doesn't fix it, presumably because it only checks the x/y coordinate while neglecting the spatial size of the group.

It seems bad practice to use an array with points for explorableArea. Instead it should probably just call addToClass for those tiles, so that berries can do avoidClasses with a bigger radius.

Bug reported by fatherbushido.

Attachments (5)

lotsofberries.jpg (1.1 MB ) - added by Ágoston Sipos 7 years ago.
This is spamming the map with cc. 6000 berries (distanced 4 from clHill, removed the min. distance between berries.) Increased 3 to 4 because some berries were partly on impassable so only few people could gather them at a time.
lotsofmetal.jpg (1.1 MB ) - added by Ágoston Sipos 7 years ago.
These are the metal mines on clHill. No other territory than the impassable are having that class.
ardennes_forest.js.patch (1.3 KB ) - added by Ágoston Sipos 7 years ago.
I believe that this number changes solve the problem. (Animals can also get onto impassable if not modified.)
map1.jpg (1.2 MB ) - added by Ágoston Sipos 7 years ago.
This is how the map normally looks like (not much change)
map2.jpg (1.0 MB ) - added by Ágoston Sipos 7 years ago.
These are the berries at a critical place, but they're still far away from impassable territory enough to be gathered from.

Change History (16)

comment:1 by elexis, 7 years ago

Component: UI & SimulationMaps
Keywords: simple added
Priority: Should HaveNice to Have

comment:2 by Ágoston Sipos, 7 years ago

Seems to me that the impassable territory is using the clHill tileclass properly, so just by increasing the avoiding distance from it to 3, no berry gets placed there or even too close to be picked. (Btw. it wasn't easy to reproduce the bug, it required multiple attempts. Maybe this problem is already fixed, just the solution wasn't attached to this ticket?)

comment:3 by elexis, 7 years ago

Original report by fatherbushido in irc one day before the ticket creation (a20 replay link offline unfortunately).

I'm not aware of any RMS change that would change the berry placement on that map. Since you could reproduce the bug, there is no reason to believe that it was fixed. You should find a way to reproduce it everytime (placing 10000 berries?) to prove the validity of the patch in practice. By placing thousands of mines in the clHill territory you can visualize where that is painted.

Increasing some min-distance might be right as that is an error that exists all over the place in maps/random/. Thus analyzing the other resources in ardennes forest for min-distance issues lies in the scope of this ticket too.

by Ágoston Sipos, 7 years ago

Attachment: lotsofberries.jpg added

This is spamming the map with cc. 6000 berries (distanced 4 from clHill, removed the min. distance between berries.) Increased 3 to 4 because some berries were partly on impassable so only few people could gather them at a time.

by Ágoston Sipos, 7 years ago

Attachment: lotsofmetal.jpg added

These are the metal mines on clHill. No other territory than the impassable are having that class.

by Ágoston Sipos, 7 years ago

Attachment: ardennes_forest.js.patch added

I believe that this number changes solve the problem. (Animals can also get onto impassable if not modified.)

comment:4 by Ágoston Sipos, 7 years ago

Keywords: rfc added
Milestone: BacklogWork In Progress
Owner: set to Ágoston Sipos
Status: newassigned

comment:5 by Vladislav Belov, 7 years ago

Keywords: patch added
Summary: Berries on impassable mountains on ardennes forests[PATCH] Berries on impassable mountains on ardennes forests

Could you attach an image with the current state?

in reply to:  5 ; comment:6 by Ágoston Sipos, 7 years ago

Replying to vladislavbelov:

Could you attach an image with the current state?

With normal parameters? (I mean no bigger number of berry/animal spawns)

in reply to:  6 comment:7 by Vladislav Belov, 7 years ago

Replying to odoaker:

Replying to vladislavbelov:

Could you attach an image with the current state?

With normal parameters? (I mean no bigger number of berry/animal spawns)

Yep, an image of the patched version to compare with the previous one.

comment:8 by elexis, 7 years ago

The proposed change is likely correct. I'm suspecting though that this problem can occur with other maps as well (in case someone is up for writing a megapatch and either rebasing this one or other RMS megapatches like #4326 in case this one is committed before (which shouldn't be too hard as the change is simple, just many occurances)). Notice decorative actors don't have a collision box.

by Ágoston Sipos, 7 years ago

Attachment: map1.jpg added

This is how the map normally looks like (not much change)

by Ágoston Sipos, 7 years ago

Attachment: map2.jpg added

These are the berries at a critical place, but they're still far away from impassable territory enough to be gathered from.

comment:9 by Vladislav Belov, 7 years ago

Thank you for your patch and screenshots, I suggest in future to crop screenshots (to have smaller size than 512 KiB, or you could resize, the main thing is visible changes) and insert here in comments [[Image(url to attached image)]] to prevent downloads of images and look at them right here.

comment:10 by elexis, 7 years ago

Resolution: fixed
Status: assignedclosed

In 19676:

Fix impassable berries on Ardennes Forest.

Fixes #4295
Patch By: odoaker

comment:11 by elexis, 7 years ago

Description: modified (diff)
Keywords: simple rfc removed
Milestone: Work In ProgressAlpha 22

Thanks for the patch, sorry that we ignored it for so long!

Note: See TracTickets for help on using tickets.