Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Please read the forum rules before posting.



Check if you are posting in the correct category.



The Off Topic section is not meant for discussing Cookie Clicker.

Gatherer scaling in NeverEnding Legacy

creidiekicreidieki Posts: 19Member ✭✭
Line 3748 of main.js indicates that the correct behavior for gatherers is " //if .max is specified, each single unit can only gather that amount at most, forcing the player to create enough units to match the resources available in owned tiles
"

However, I don't believe this matches the implemented behavior -- on average, the player is still getting more resources per gatherer, past the maximum.

Consider line 3776:
var amount=randomFloor(Math.min(max,Math.random()*(effect.amount||1)*res[ii])*myAmount);

If I've understood the code correctly, myAmount is the number of gatherers; effect.amount is typically 1 and max is typically 5 (data.js:1505). res[ii] is the total map yield of your given resource.

So, the value inside the randomFloor will simplify to whichever is smaller: 5*# of gatherers, or Math.random()*(map contents)*(# of gatherers). Either way, it's scaling linearly with the number of gatherers. So this code doesn't actually cap out the gathered amount at the map resources. Instead, it makes the map resources give diminishing returns above 5 / day.

I believe the desired behavior would be something more like
var amount=randomFloor(Math.min(max*myAmount*(effect.amount||1),Math.random()*res[ii])));
but of course I imagine that fixing it at this point would require a lot of rebalancing.

My apologies if I've misunderstood anything in the code, I'm just trying to understand whether the behavior matches the comments.

(Note also that if line 3776 is changed, line 3761 will need to be changed to match.)

Comments

  • ManiklasManiklas Posts: 1,687Member ✭✭✭
    I think you are in the wrong section O_o
    Is god a cookie, or is the cookie a god?
    The world may never know
    "You have now, officially broken the game,"-Maniklas
    "Okay, ANYWAY, yes, I am a magician,"-RunninginReverse
    """"My game will be playable on all Samsung Microwaves with firmware update 5.3.2 and up." - Audiot" - RunningInReverse" - Purge" - Agubhagu
    Adopt one today! Adopt one today!
  • creidiekicreidieki Posts: 19Member ✭✭
    The NeverEnding Legacy page at http://orteil.dashnet.org/legacy/ says "Help? Bugs? Ideas? Check out the forum", and links to this forum. And this is the "Suggestions & Bug Reports" section. Is there somewhere else you'd like me to report this?
  • ViniVini Posts: 2,596Member ✭✭✭✭✭
    creidieki said:

    The NeverEnding Legacy page at http://orteil.dashnet.org/legacy/ says "Help? Bugs? Ideas? Check out the forum", and links to this forum. And this is the "Suggestions & Bug Reports" section. Is there somewhere else you'd like me to report this?

    Suggestions & Bug Reports is for the forum. Until we get a section specifically for Legacy, I believe you're safe with moving it to Off-Topic. (Gear on the top right of the OP, in case you don't know.)


    As for the code...
    I can't really tell if the way you read it is correct, so I'll assume it is.

    Balancing isn't really an issue right now. Orteil said the game balance could've been off on release.
    But if the gatherers give diminishing resources, isn't that okay? The more you take from nature without giving back, the less you'll be able to take next time.
    Unless I too am reading it incorrectly. 「(°ヘ°)

  • ManiklasManiklas Posts: 1,687Member ✭✭✭
    on that

    you can't really move your own threads with the edit button, thy should change that
    Is god a cookie, or is the cookie a god?
    The world may never know
    "You have now, officially broken the game,"-Maniklas
    "Okay, ANYWAY, yes, I am a magician,"-RunninginReverse
    """"My game will be playable on all Samsung Microwaves with firmware update 5.3.2 and up." - Audiot" - RunningInReverse" - Purge" - Agubhagu
    Adopt one today! Adopt one today!
  • creidiekicreidieki Posts: 19Member ✭✭
    I don't seem to be able to move it, perhaps because I'm a new member?

    Anyway, that's the problem -- gatherers *don't* give diminishing returns. If you have twice as many gatherers, you'll get twice as much stuff, regardless of what your map resources are.

    If you have twice as much map resources, you'll ALSO gain about twice as much stuff, kinda, until your map resources get to about 5/day, at which point it starts decreasing somewhat, because you hit the gatherer maximum more often.
  • ManiklasManiklas Posts: 1,687Member ✭✭✭
    ^^^^^
    ^^^^^
    Is god a cookie, or is the cookie a god?
    The world may never know
    "You have now, officially broken the game,"-Maniklas
    "Okay, ANYWAY, yes, I am a magician,"-RunninginReverse
    """"My game will be playable on all Samsung Microwaves with firmware update 5.3.2 and up." - Audiot" - RunningInReverse" - Purge" - Agubhagu
    Adopt one today! Adopt one today!
  • ViniVini Posts: 2,596Member ✭✭✭✭✭
    creidieki said:

    I don't seem to be able to move it, perhaps because I'm a new member?

    Anyway, that's the problem -- gatherers *don't* give diminishing returns. If you have twice as many gatherers, you'll get twice as much stuff, regardless of what your map resources are.

    If you have twice as much map resources, you'll ALSO gain about twice as much stuff, kinda, until your map resources get to about 5/day, at which point it starts decreasing somewhat, because you hit the gatherer maximum more often.

    How about this: If the tribe is optimizing its collectable area, two persons will return 100% more than one person, because the area they are working in is large enough so one won't explore the same place the other did.
    If one area has twice as much resources as the other, you can find more of whatever you witch to collect easier. In this case, faster, which increases production pretty much linearly.
    It's only when you have so many people (or so few resources) working in a limited space that you start to notice a drop in productivity. Sure, maybe 1:1 ratio on gatherer/resources collected is a bit unrealistic, but before the point of saturation it might as well be.

  • creidiekicreidieki Posts: 19Member ✭✭
    Yes, what you're describing is similar to what I think was *intended*, based on the comments in the code.

    But from what I can see in the current code, twice as many gatherers will *always* give twice as many resources. A thousand gatherers will give a thousand times as many resources as one gatherer. Regardless of what the map has on it.

    The "diminishing returns" in the current code only apply to the *map* number.

    The current code is, very loosely, a more random version of: (# of gatherers) * (min(5, map resources)).

    And it's supposed to be min(5*# of gatherers, map resources).
  • OrteilOrteil Posts: 121Administrator, Game Dev Admin
    this has been changed in yesterday's patch, very thankful for creidieki's insight.
Sign In or Register to comment.