Home | Help | Download | Community | Site Map | New Posts | Sign in
Replies: 7 (Who?), Viewed: 7462 times.
Test Subject
Original Poster
#1 Old 27th Feb 2010 at 4:02 PM
Default Optimal Nectar Recipes via RecipeGenerator
Greetings.

I was highly unsatisfied with the inefficient means of finding Nectar formulas. I've yet to find anyone who took the formula as found in the reflected DLLs and created a nectar blend generator from that.

So, I did that.

After some testing, I believe what I've produced is a functional base library.

I will, if there is desire, expand it to provide accurate predictors of price based on various factors (eg, Quality of Fruit, skill of user, Challenges completed, etc) via a GUI.

For now, I would like to just contribute the top 20 'Best' blends, and the top 20 most valuable blends. These are different, as the 'best' blends merely have higher multipliers, but the most valuable bends have much higher base values.

Oh, and an interesting note. Pomegranate 1 Lifefruit 9 is, in fact, the most valuable (but maybe not the most efficient in terms of time/cost) blend available.

If there is desire, I will release the application and the source code. It is written in C#, and requires Mono to work accurately. Standard .NET runtime will not work, as it requires the use of the Mono Random function.

Please note that while not all of these blends are "amazing," they should be more price effective than any blend not listed here.

One last note. Any time a bottle is created, there is a fairly large (I believe, I have not confirmed) variance that is possible. Therefore, it is conceivable that one can produce a bottle of nectar that has a base value of less than another, yet with higher resulting value.


Most Valuable Blends:
Code:


Blend: 90% Lifefruit, 10% Pomegranate
Multiplier: 1.627517

Blend: 10% Gralladina Fran, 30% Cranerlet Nuala, 60% Lifefruit
Multiplier: 1.705838

Blend: 20% Flame Fruit, 70% Lifefruit, 10% Plum
Multiplier: 1.634267

Blend: 20% Flame Fruit, 70% Lifefruit, 10% Watermelon
Multiplier: 1.633048

Blend: 10% Flame Fruit, 10% Meloire, 80% Lifefruit
Multiplier: 1.516474

Blend: 10% Cherries, 20% Cranerlet Nuala, 60% Lifefruit, 10% Pomegranate
Multiplier: 1.690434

Blend: 30% Flame Fruit, 20% Cranerlet Nuala, 40% Lifefruit, 10% Plum
Multiplier: 1.670337

Blend: 10% Cherries, 10% Cranerlet Nuala, 80% Lifefruit
Multiplier: 1.49217

Blend: 30% Flame Fruit, 40% Lifefruit, 10% Lime, 20% Pomelo
Multiplier: 1.72388

Blend: 10% Flame Fruit, 20% Gralladina Fran, 10% Cranerlet Nuala, 50% Lifefruit, 10% Pomegranate
Multiplier: 1.70761

Blend: 10% Cranerlet Nuala, 80% Lifefruit, 10% Watermelon
Multiplier: 1.482645

Blend: 50% Cranerlet Nuala, 50% Lifefruit
Multiplier: 1.54242

Blend: 10% Cherries, 30% Gralladina Fran, 60% Lifefruit
Multiplier: 1.650744

Blend: 10% Cherries, 90% Lifefruit
Multiplier: 1.410807

Blend: 10% Cherries, 10% Avornalino, 70% Lifefruit, 10% Watermelon
Multiplier: 1.631859

Blend: 10% Flame Fruit, 80% Lifefruit, 10% Pomegranate
Multiplier: 1.444266

Blend: 10% Cherries, 10% Cranerlet Nuala, 70% Lifefruit, 10% Pomelo
Multiplier: 1.504178

Blend: 10% Cherries, 20% Meloire, 10% Gralladina Fran, 60% Lifefruit
Multiplier: 1.657943

Blend: 90% Lifefruit, 10% Lime
Multiplier: 1.386188

Blend: 10% Flame Fruit, 70% Lifefruit, 10% Plum, 10% Watermelon
Multiplier: 1.527568


Best Blends (in terms of multiplier)
Code:


Blend: 10% Cherries, 20% Flame Fruit, 10% Avornalino, 10% Gralladina Fran, 10% Lifefruit, 10% Plum, 10% Pomegranate, 20% Watermelon
Multiplier: 1.741778

Blend: 10% Cherries, 20% Gralladina Fran, 20% Lifefruit, 10% Lime, 10% Pomegranate, 30% Pomelo
Multiplier: 1.734722

Blend: 10% Cherries, 20% Flame Fruit, 20% Avornalino, 10% Meloire, 10% Plum, 20% Pomegranate, 10% Pomelo
Multiplier: 1.732575

Blend: 10% Cherries, 10% Gralladina Fran, 20% Lime, 20% Plum, 10% Pomelo, 30% Watermelon
Multiplier: 1.732458

Blend: 10% Meloire, 10% Gralladina Fran, 10% Cranerlet Nuala, 10% Lifefruit, 10% Plum, 10% Pomegranate, 10% Pomelo, 30% Watermelon
Multiplier: 1.727982

Blend: 30% Avornalino, 20% Gralladina Fran, 20% Cranerlet Nuala, 10% Plum, 20% Pomegranate
Multiplier: 1.7277

Blend: 20% Meloire, 10% Gralladina Fran, 20% Cranerlet Nuala, 10% Lime, 10% Plum, 20% Pomelo, 10% Watermelon
Multiplier: 1.727596

Blend: 40% Avornalino, 10% Meloire, 20% Plum, 30% Pomegranate
Multiplier: 1.727292

Blend: 10% Cherries, 10% Flame Fruit, 20% Avornalino, 10% Cranerlet Nuala, 30% Lifefruit, 10% Plum, 10% Pomelo
Multiplier: 1.726758

Blend: 30% Flame Fruit, 40% Lifefruit, 10% Lime, 20% Pomelo
Multiplier: 1.72388

Blend: 10% Flame Fruit, 20% Avornalino, 30% Cranerlet Nuala, 10% Lime, 10% Plum, 10% Pomegranate, 10% Pomelo
Multiplier: 1.722018

Blend: 10% Cherries, 10% Flame Fruit, 10% Meloire, 30% Gralladina Fran, 20% Pomelo, 20% Watermelon
Multiplier: 1.721862

Blend: 40% Cherries, 10% Flame Fruit, 10% Avornalino, 10% Gralladina Fran, 10% Lifefruit, 10% Lime, 10% Plum
Multiplier: 1.720538

Blend: 30% Cherries, 10% Meloire, 20% Lifefruit, 10% Lime, 20% Pomegranate, 10% Watermelon
Multiplier: 1.719615

Blend: 10% Gralladina Fran, 20% Cranerlet Nuala, 20% Lifefruit, 10% Lime,10% Plum, 30% Pomelo
Multiplier: 1.719288

Blend: 10% Cherries, 10% Flame Fruit, 10% Gralladina Fran, 30% Pomegranate, 10% Pomelo, 30% Watermelon
Multiplier: 1.717608

Blend: 30% Gralladina Fran, 10% Cranerlet Nuala, 10% Lifefruit, 40% Lime, 10% Pomegranate
Multiplier: 1.716071

Blend: 10% Flame Fruit, 40% Gralladina Fran, 10% Lifefruit, 20% Plum, 20% Watermelon
Multiplier: 1.715981

Blend: 20% Cherries, 20% Flame Fruit, 10% Avornalino, 10% Gralladina Fran, 10% Pomegranate, 10% Pomelo, 20% Watermelon
Multiplier: 1.715924

Blend: 10% Avornalino, 20% Gralladina Fran, 10% Lifefruit, 10% Lime, 40% Plum, 10% Watermelon
Multiplier: 1.715831




I hope this is of value to someone.

(Side note: If there are any issues with the formatting of my post, please PM me and I will correct it.)
Advertisement
Fat Obstreperous Jerk
#2 Old 27th Feb 2010 at 4:32 PM
The kicker with the Nectar values is that the ORDER the ingredients are inserted into the machine affects the list, since the string has is generated by strcatting the ingredients together in the order they are first encountered on the list, and there does not appear to be any mechanism that sorts the list. Inserting ingredients in a different order will produce a totally different hashstring, and therefore, a totally different outcome.

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
Test Subject
Original Poster
#3 Old 28th Feb 2010 at 3:43 AM Last edited by ArchitectHere : 28th Feb 2010 at 3:45 AM. Reason: to thank JMP + additional info re: sorting
Yes. The list is sorted. Ingredient implements IComparable, which simply compares the Key (a string defined in the XML) from the Ingredient.Data member.


Code:



private void NectarFinishTask()
{
List<Ingredient> fruitsUsed = base.Inventory.FindAll<Ingredient>(false);
//more stuff goes here
fruitsUsed.Sort();
//rest of function
}



Also in my own tests, I have confirmed that the hash generated by the application does not change. For testing purposes, I created an object which was just a Nectar Maker copy but ran the Hashing/Formula functions (roughly). I did this to confirm

a) That the order does not matter when creating the Hash (it does not, but that's obvious in the code)
b) That the internal Mono engine used in the Sims 3 does not use a different Random class than standard Mono (it does not)
c) That the names of items matched up to what the names of the models they used (they did not, which caused confusion when I first was doing tests).


Oh, and a note. All those generated combos lack the first 3-4 cheapest Nectar items. This is because of a bug with Mono that doesn't allow for huge amounts of data sets to exist on the heap. I either need to recompile Mono with altered settings (bleh) to account for a larger heap space, or I need to optimize my algorithm to reduce memory usage (uncertain how at the moment).

As a result, things like grapes (standard) and Lime are not represented, and may alter the optimal results slightly. It's unlikely that the top value nectars will change, however.


(Also, thank you for AM).
Fat Obstreperous Jerk
#4 Old 28th Feb 2010 at 6:22 AM
Ah, so they are sorted. Very good, then. Does the intermix ratio matter? I did a quick browse through of it, and it appears that when strcatting the names together, it may be ignoring components of types it has already viewed. One issue with quality prediction, however, is that it is not a reversible process: You can't figure out what the best value is, then reverse the algorithm to determine what the best fruits are, and thus you are essentially still limited to bruteforce scanning.

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
world renowned whogivesafuckologist
staff: administrator
#5 Old 28th Feb 2010 at 9:54 AM
Moved to a perhaps more appropriate place for technical discussion of your program and hashes and whatnot.

Would be darn useful, though IMO it might be more useful simply to edit the nectar making page on the wiki with the best recipes based on the data from your program since it'd be the same for everyone and really, only one person needs to figure out what the recipes are one time.
Test Subject
Original Poster
#6 Old 28th Feb 2010 at 6:29 PM
@HystericalParoxysm -- Ok.

@JMP

At first I thought it was ignoring items it found already as well, but what it is actually doing is storing the strings in a Dictionary of string/int where int represents the count of items with that name. That is used later for the purpose of writing out what the blend is (eg, 90% Lifefruit, 10% Pomegranate).

The str itself is expanded for all ten items.

The algorithm _is_ Brute force. I use recursion to build out a data structure that holds all (ordered) combinations.

It ends up consuming 600MB in the standard .NET runtime, but in Mono, when it hits about that 600MB mark, it collapses. I have to reduce the footprint for mono, for now, by dropping the lowest-cost items.

I haven't taken the time to optimize the application (yet).

Although you cannot predict the precise quality of a nectar blend, you can predict its median, max, and min value based on various unique factors (challenges, upgrades, etc).

As a result, you can predict which blends, on average, will have the highest value.
Test Subject
#7 Old 4th Mar 2010 at 12:27 AM
Default This is GREAT
If you don't mind, I'd love to see the source code. Did some playing around with this myself a few months back, but when I realized that taste was entirely dependent on this Rand function that was seeded by the hash from the ingredients, I gave up.

Well, not entirely. I simply duplicated the code for the normal nectar maker but reduced it's production time so I could get nectar in 15 minutes.

Thanks so much for the hard work!
Lab Assistant
#8 Old 21st Mar 2010 at 5:40 PM
Awesome report. I'm not a modder but I do appreciate the effort put forth to creat them. Thanks from all my Master Nectar Makers.
Back to top

Section jump