Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#3836 closed defect (fixed)

[PATCH] Most maps can have inaccessible chickens

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

Description

In attached replay, there's a chicken in the CC, which causes annoying behaviour with the cav.

Attachments (4)

commands.txt (23.7 KB ) - added by sanderd17 8 years ago.
inaccessible_chicken_v1.patch (43.2 KB ) - added by elexis 7 years ago.
Unifies the chicken placement code and increases minimum distance from 7 to 9.
inaccessible_chicken_v2.patch (69.0 KB ) - added by elexis 7 years ago.
Passes fx and fz, removes unused chicken variable, patches some more maps that weren't exact dupes but some characters different.
inaccessible_chicken_v3.patch (74.3 KB ) - added by elexis 7 years ago.
Removes some more unused chicken variables, fixes wrong argument in corsica, reuse the function for ardennes forest, fix broken declaration in setup.js

Download all attachments as: .zip

Change History (13)

by sanderd17, 8 years ago

Attachment: commands.txt added

comment:1 by elexis, 8 years ago

Milestone: Alpha 20Backlog
Priority: Should HaveMust Have
Summary: Lion's Den map can have inaccessible chickensMost maps can have inaccessible chickens

This happens on most maps, for example

Map: Anatolian plateau
Seed: 3916
Size: Small
Default 8 atlas players

The bug occurs mostly with the roman CC, which has a footprint of 40x40 instead of 32x32. (See atlas with the settings above and different civs for player 1).

The minimum-distance of chickens need to be increased for all maps from 7 to 9. It should likely be a global constant, so it only needs to be changed in one place if the footprint changes.

After the increase, one might run into collisions with metal/stone mines (mines don't try to avoidClasses(clBaseResource,2) and can also sometimes collide with each other).

Notice when avoiding collisions, we need higher retry factors!


Unify chicken-placement code: Using the following command, one can see that almost all maps use oChicken when placing chickens (corsica.js and oasis.js use eChicken, deep_forest does it's own thing and _kalis maps use createBase in setup.js).

grep -R "chicken" -h | tr -d "\t" | sort | uniq

With the next command, we can see that almost all maps use the exact same code (surprise):

grep -R 'SimpleObject(oChicken' * -A 4 -B 7 -h | tr -d "\t" | sort | uniq

Likely the same can be done with all the other RMS code %-l

If possible, the function createBase in setup.js should just be used / adopted.

Last edited 8 years ago by elexis (previous) (diff)

comment:2 by elexis, 8 years ago

In 17920:

Make "Lion's Den" and "Empre" default maps.
Add more animals/berries to "Ambush".
Improve placing of initial resources on all of _kali's maps.

  • Increase distance from chickens to CC from 7 to 9 (to account for roman CCs, refs #3836)
  • Increase number of initial trees from 5 to 25 (ensuring players have enough wood to build a new CC)
  • Avoid resource collisions by increasing the minDistance from 2 to 4 (when not using angles)
  • Ensure that initial resources are placed (by first placing mines and adding retry-loops for the other resources) Notice The loop can't be moved to createObjectGroup since
    • the parameters (like mAngle) also need to randomized again
    • we need to place initial resources in range of the actual playerbase

comment:3 by Imarok, 8 years ago

Is this issue solved?

comment:4 by elexis, 8 years ago

No, was just fixed for the new a20 maps. Many other maps still place chickens too close to the CC, so they might end up inside the CC. This seems to be only the case for the roman CC and is likely solvable by increasing the distance from 7 to 9.

comment:5 by fatherbushido, 8 years ago

We have that for the ptol cc too.

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

by elexis, 7 years ago

Unifies the chicken placement code and increases minimum distance from 7 to 9.

comment:6 by elexis, 7 years ago

Keywords: patch rfc added
Milestone: BacklogAlpha 21
Summary: Most maps can have inaccessible chickens[PATCH] Most maps can have inaccessible chickens

by elexis, 7 years ago

Passes fx and fz, removes unused chicken variable, patches some more maps that weren't exact dupes but some characters different.

by elexis, 7 years ago

Removes some more unused chicken variables, fixes wrong argument in corsica, reuse the function for ardennes forest, fix broken declaration in setup.js

comment:7 by FeXoR, 7 years ago

Though there can still be problems (e.g. chicken and mines colliding) this patch is a definite improvement and should be committed.

comment:8 by elexis, 7 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 18816:

Don't place chicken inside civic centers and unify chicken placement code. Reviewed by FeXoR, fixes #3836.

comment:9 by elexis, 7 years ago

Keywords: rfc removed

Thanks for the review! I have also tested every individual map to guarantee that nothing broke!

Note: See TracTickets for help on using tickets.