mouseas / steamSummerMinigame

Steam Summer Sale 2015 - Auto-play Optimizer
MIT License
136 stars 189 forks source link

Switch lanes for elemental damage #13

Closed Ratzap closed 9 years ago

Ratzap commented 9 years ago

Switch lanes to use the best elemental damage perhaps? For example if I have L7 fire and L3 everything else, it should seek out the fire lanes

mouseas commented 9 years ago

I'll leave this for someone else to implement.

Note that with 1000 players per game, each player's contribution to damage is small. Optimizing by element isn't a bad idea, but doesn't benefit you much since you only get rewarded for being in the lane an enemy dies in.

Gerarddp commented 9 years ago

Switching when someone is about to die would solve it, but I don't know if it's possible with the delay and freezes that are happening sometimes.

mouseas commented 9 years ago

@Gerarddp A recent pull request added switching to a creep if the spawners are all above 40% and the creeper is below 20% hp. Is that what you're talking about?

Gerarddp commented 9 years ago

That would be good enough, now just need to add going to the lane with most elemental damage if everything is above 20%.

EhsanKia commented 9 years ago

Once we have a full fledged AI, we need to figure out the optimal way to spend money. I think in a perfect scenario, each player chooses an element and maxes out that one, and we choose lane according to our elements until some creep is below 20%.

We need a proper cost analysis though to see if that's the best way to play this out, or if spreading cost across all elements is better.

ZedTheYeti commented 9 years ago

@EhsanKia To make this the most effective, wouldn't we need some kind of communication? To accurately choose a type we'd need to know A) who is in the same lane and B) and the types everyone has maxed or highest, or at least everyone using the script.

Ruzihm commented 9 years ago

I just ran the numbers and generalizing your upgrades and specializing are equal IF AND ONLY IF you are assigned lane elements uniformly and randomly. But since this is not the case, specializing is more efficient.

Trying to get this to work would be annoying but you could just:

1. Does the user have any upgrades?

Yes - 2. Move that user to lanes with that upgrade.

No  - 2. Randomly select a number between 0-3 (how to seed?) and then put one (and only one) level in the correspeonding element asap (before the user can do it) and that is their "assigned" element.```
EhsanKia commented 9 years ago

Yeah, my assumption is that if we each take one randomly (uniform distribution), then at a large enough scale, it would even out nicely. Since there are 4 elements, and 1500 in the server, even if 10-20% of those people run the script, the variance will be negligible.

Doesn't need to be a crazy cryptographically secure PRNG either, parseInt(Math.random() * 4) should be good enough. Later on in the game, putting one point in the other elements may become worthwhile though, since your element isn't always present and a single point increases damage by 2.5x

ZedTheYeti commented 9 years ago

What if we split it 2/1 or 3/1 or something. As in, upgrade our chosen element two or three times then upgrade all others or a few others once.

mouseas commented 9 years ago

Switching lanes by elemental damage isn't very beneficial, so I'm closing this issue. If someone comes up with a good implementation that weighs elemental damage along with all the other lane choice factors, I'll consider it, but it needs to result in no less gold income than without it.