CookieMonsterTeam / CookieMonster

Addon for Cookie Clicker that offers a wide range of tools and statistics to enhance the game
MIT License
494 stars 204 forks source link

new way of find the most profit-making building #28

Closed Crashfr closed 8 years ago

Crashfr commented 9 years ago

Hi, i used to play cookies clicker, and i found recently your add-on cookie monster. I think it's a very good addon but i disagree a bit with the way of searching what building is the most worth.The fact is that in your formula price/cps doesn't take the time to buy the item into consideration. what I did is pretty simple : i take 2 graphs : One with the actual cps * t one another with the actual cps * t = Y1(t) but when we reach the price of the building we are testing, we buy it and we have (cps + G) * t (G is the profit in cookies per second). So the actual formula of the second graph id (cps + G) * t - ( 1 + G/cps ) _P = Y2(t) because with this when we reach the price of the building ie. t= P/cps we have Y2=0 Then i search T the time when these two graphs are crossing each other, ie the time that the building refund his price + the time loss at waiting the building , so Y1(T) = Y2(T) cps_T = (cps + G) * T - ( 1 + G/cps ) _P G * T = ( 1 +G/cps ) P T = P/(G_cps) \ ( Cps + G) T = P/G + P/cps

then we use this formula for each building and less T is faster the building refund himself

Hope you read all this , Thank you , Bye

Aktanusa commented 9 years ago

This is actually discussed in Issue #3 already. There is also a flaw with comparing only 2 items at a time. The even more efficient way is to compare all combinations of buying. This is of course very costly and similar to the traveling salesman problem in programming (aka O(n!) in complexity). I've been developing a way to at least shortcut it to be slight more efficient. Yea, I need to get off my lazy butt and just implement it.

lucmans commented 8 years ago

Since the calculations don't involve many elements, isn't the n relatively small (so n! isn't to detrimental)? Especially given the current speed at which computers can calculate, this shouldn't take to long.

Aktanusa commented 8 years ago

Yes yes, I know. I've been thinking on how to implement it for a while now. I was planning to add it today or tomorrow after I did my checklist of what I wanted to work since version 2 of CC came out. Since that's done now and release in version 2.3 of CM, I'm finally free to add this.

Aktanusa commented 8 years ago

Actually I forgot this was suggesting to do cost/cps + cost/Δ cps. I was more planning on doing the optimization of considering purchases that is affordable now to help decrease the time needed for the best BCI as mention in Issue #52.

Edit: The main problem of changing to cost/cps + cost/Δ cps (despite being pretty simple to do actually) is figuring out what to rename the BCI label to. It isn't BCI anymore once you change it to cost/cps + cost/Δ cps.

svschouw commented 8 years ago

Return On Investment? Break Even Point? It is the time to wait for the necessary funds (cost/cps) plus the time to get the investment back (cost/Δcps).

Aktanusa commented 8 years ago

So I guess ROI?

Aktanusa commented 8 years ago

Added in Version 2.4

Appleguysnake commented 8 years ago

I just updated and saw this because I came looking for an explanation of why it was called ROI now, which was confusing me. A higher ROI is usually better, because it's describing how much you'll get in return. The number is still showing the cost, which is better if it's lower. So that's still something like BCI, which I think is still much closer to an accurate description.

Aktanusa commented 8 years ago

I know what you mean, but I think it's closer to inverse ROI. Writing inverse ROI didn't look good, so I shorten it to ROI. It's only BCI when you have enough cookies in the bank to buy.

Appleguysnake commented 8 years ago

Well the inverse of Return is Cost lol, that's why I was saying it. I don't think there's any good short name that can clearly explain what it does, but calling it Return on Investment for a measure where lower is better is very counter-intuitive. I think a name like "Modified Cost" or "Adjusted Cost" or "Return-Adjusted Cost" would make it clear that it's a measure of cost where lower is better for those who aren't going to come read the GitHub issues page.

Sorry if this seems like a nitpick, but I can't help much with the maths, so I might as well try to help with the words :p

Aktanusa commented 8 years ago

I think that is a good suggestion. Mind creating a new issue for me?

Appleguysnake commented 8 years ago

Sure, happy to help!

Aktanusa commented 8 years ago

Thanks!