Opened 8 years ago

Closed 7 years ago

#4240 closed enhancement (fixed)

[PATCH] No fish on random map Gear

Reported by: elexis Owned by: Ágoston Sipos
Priority: Nice to Have Milestone: Alpha 22
Component: Maps Keywords:
Cc: agoston.sipos.95@… Patch:

Description (last modified by Imarok)

The map "Gear" has a lot of water, but no fish in it. Since there are these streams between players, adding fish would add some tension between players and incentivize attacks form the water. File to update: gear.js. Placing fish can be copied from maps like cycladic_archipelago.js. But ensure fish won't be placed on land like #3746.

Attachments (5)

change4240.patch (1.9 KB ) - added by Ágoston Sipos 7 years ago.
First proposal of change
screenshot_fishes.png (688.6 KB ) - added by Ágoston Sipos 7 years ago.
Screenshot
change4240.2.patch (1.9 KB ) - added by Ágoston Sipos 7 years ago.
screenshot_fishes.2.png (123.6 KB ) - added by Ágoston Sipos 7 years ago.
There is a proposed fix for #4294 . I tried my code with it and the result is on the screenshot. I think it's still an OK number of fish. (Can't be more because there is not enough space.)
change4240.3.patch (1.9 KB ) - added by Ágoston Sipos 7 years ago.
This is the code change with let group = .... Though I would say that - as this file uses let at no other place - it might be confusing to use it only at this line.

Download all attachments as: .zip

Change History (15)

comment:1 by Ágoston Sipos, 7 years ago

Cc: agoston.sipos.95@… added
Description: modified (diff)
Owner: set to Ágoston Sipos

by Ágoston Sipos, 7 years ago

Attachment: change4240.patch added

First proposal of change

by Ágoston Sipos, 7 years ago

Attachment: screenshot_fishes.png added

Screenshot

comment:2 by Ágoston Sipos, 7 years ago

Keywords: rfc added
Milestone: BacklogWork In Progress

I created a first version to generate fish. You can see the minimap on the screenshot: the red squares in the water are the fishes (the ones on ground are animals, I checked it). Is it an appropriate number of fish, or should I change?

comment:3 by elexis, 7 years ago

Keywords: review added; rfc removed
Type: defectenhancement

Looks good to me, only the warn (and unused variable a) should be removed. Notice the huge scaleByMapSize(400,2000) numbers are due to #4294.

comment:4 by Ágoston Sipos, 7 years ago

Thanks, I didn't know it is a known bug, just increased the number of fish, until it really got placed (now it's said to be 934...). I will attach the cleaned code ASAP.

by Ágoston Sipos, 7 years ago

Attachment: change4240.2.patch added

comment:5 by fatherbushido, 7 years ago

So perhaps one should fix #4294 before?

Last edited 7 years ago by fatherbushido (previous) (diff)

by Ágoston Sipos, 7 years ago

Attachment: screenshot_fishes.2.png added

There is a proposed fix for #4294 . I tried my code with it and the result is on the screenshot. I think it's still an OK number of fish. (Can't be more because there is not enough space.)

comment:6 by elexis, 7 years ago

The cleaned patch looks good. The distance between the fish spots should be increased a bit probably though, since fish should be a nice addition, not a replacement (didn't actually test the patch but judging from the screenshot).

The patch attached to #4294 does not fix the maps, only the library and whenever we change an interface, we also have to check how the users of it will be affected.

When applying the fix to the rm library of #4294, every second number in every js file in maps/random/ will have to be changed, otherwise all maps will look completely different. In order to compare the results, everytime when writing the patch, polishing it, rebasing it (#4326), doing the first review, doing the second review, every map will have to be generated multiple times comparing the patched with the unpatched versions (5 devsteps * 5 tests/devstep * 73 maps/test * (patched + unpatched code) = 3650 map generations? Did only about 150 tests when doing the rms cleanup in FF), implying some indefinite suspension time of this ticket. Not my decision anyway since I can't commit this ticket because I already moved it to the review queue xP

comment:7 by Vladislav Belov, 7 years ago

Summary: No fish on random map Gear[PATCH] No fish on random map Gear

It looks like the var (or more prefered let) is missed here: group = new SimpleGroup([new SimpleObject(oFish, 1,1, 0,3)], true, clFood);. No warnings, because there is var group; in a loop (which isn't the same scope), but var makes it globally described, so if we will replace var to let in future then we will get an error at this line.

by Ágoston Sipos, 7 years ago

Attachment: change4240.3.patch added

This is the code change with let group = .... Though I would say that - as this file uses let at no other place - it might be confusing to use it only at this line.

comment:8 by Imarok, 7 years ago

Description: modified (diff)

comment:9 by elexis, 7 years ago

Keywords: simple review removed
Milestone: Work In ProgressAlpha 22
  • 8 -> 12, so that there's slightly less fish than proposed
  • That unPaintClass call is needed indeed, since that paragraph paints the outer part of the inner central mountain
  • no space in empty lines
  • space after comma
  • Thanks for the patch

comment:10 by elexis, 7 years ago

Resolution: fixed
Status: newclosed

In 19677:

Add fish to the map Gear.

Fixes #4240
Patch By: odoaker

Note: See TracTickets for help on using tickets.