Hi, this is John. I managed to get 281st overall with a push into Gold 4 hours before end of competition! Hurray!
Here’s what I did.
DFS with depth limit 6 (that was as far as it would go before timeout).
Language: C++. Python timed-out at depth 3.
Key idea: Balance between efficient conversion by spells vs Producing the Spells (10 pts for converting efficiently, 5 pts for each depth earlier of brewing potions)
My eval function was to prioritize efficiency in conversion. I wanted my AI to convert the whole board like the gold boss as far as possible. This was done by giving an efficiency bonus of 10 points to the eval function when efficient conversion (gain of 5 points and above) is done before turn 30.
After a successful brew, I would terminate my simulation straightaway for that branch. The score would be (depth remaining)*5 + potion brew value + efficiency bonus + inventory score.
Inventory score is similar to the algos above: 1 for tier-0, 2 for tier-1, 3 for tier-2, 4 for tier-3.
If no potions are brewed at the end of the depth, then the score will simply be the efficiency bonus plus the inventory score.
I learn the first 6 spells for certain, and after that, I do a DFS of not learning any spell vs learning spell 1, 2, 3, 4, 5 and 6. I pick the action which gives me highest returns. After I brew potion 5, I do not learn any spell as the focus is to complete any potion asap.
In order to reduce excessive branches, I have a heuristic to determine whether a branch has been done before, and if so, the search terminates for future branches. This heuristic is based on number of rests since start of search, number of tier-0 to 3 ingredients, and search depth.
- Additional pointer: In order to “force” my AI not to use the lousy beginner spells of converting only 1 ingredient to the next tier, I had an inefficiency restriction. Basically, only after every brew or rest I reset this inefficiency restriction. Basically, my AI is only allowed to do 1 inefficient conversion after every brew or rest. This greatly helped the AI to pick the better paths and also serves to restrict the number of possible game branches as well.
Was an overall tough challenge. Easy to code the AI, but the optimization and heuristic evaluation required was intense. Great competition!