Sugarlawn high score list and design notes

I’ve moved Sugarlawn’s high score list to a new IF blog of mine. As much as I like intfiction, that seems to be a better long-term location for it.

Also, I’ve posted a long set of reflections on Sugarlawn’s design.

12 Likes

I didn’t have a chance to play this game during the competition, but I’m now really tempted to try to write an algorithm for optimizing the score.

1 Like

I’ve thought about trying to write a solver for it too. Maybe the high scores list should be separated between ML solutions and human solutions.

If either of you or anyone else writes a computer program to solve Sugarlawn, I’d love to see the program itself in addition to the score it produces.

As a starting point, it’s already interesting to think about what I will call “White Sugarlawn”: a simpler, more refined variant of Sugarlawn with some of the more annoying (from a computational perspective) gameplay features removed:

  • the room graph is as in the real game, but movement is unobstructed: no locked doors requiring an extra move to unlock, no chicken suit issues, etc;
  • you have 120 turns, with each turn consisting of one of the following three actions: moving from your room to an adjacent room, picking up any number of items (subject to the carry limit) from the current room; dropping any number of held items into the current room;
  • all loot items are in plain sight (in the starting location listed in the table here: Sugarlawn Hints and Walkthrough) and can be picked up without complications (no requirement to unlock safes, etc);
  • items can only be carried (not worn) and all items are subject to the carry limit;
  • no partial credit for bringing an item to the Foyer; they must be dropped in the correct room to score any points;
  • no exit or secret bonuses.

The saving grace, when it comes to algorithms for solving White Sugarlawn, is that the room graph is far from worst-case: it is very sparse, with only two nontrivial cycles. That said my first attempt at a solution was stopped in its tracks by the realization that it can be optimal to “park” items you’ve picked up in some intermediate room to save inventory space, and then come back to pick them up later. The naive state space thus contains on the order of 50^50 states which is utterly intractable.

1 Like

But you didn’t resolve the question of why you chose that location for the secret bonus! :wink:

Should you collect more treasures, or should you focus more on finding target locations? It seemed to me that players’ natural instincts would lead them to go with the former. To make the latter more attractive, I had the target location bonuses increase in an arithmetic progression. It took me a long time to work out a scheme for these bonuses that was (1) simple and (2) not immediately obviously better or worse than just picking up valuables.

Ah, now this is interesting. I took one look at the item values at the end of my first playthrough and thought, “OK, clearly the item values are a red herring: any item under $2-3K is worth less than placing one more item correctly.” I did my entire playthrough with only a fuzzy mental list of which items were “expensive”: you can see from the item list on my $153K solution spreadsheet that I only filled in a few entries, and even that was me procrastinating about finishing up the last quarter of the turn-counting sheet. And several of the values were way off from what I thought they were.

I did prioritize the higher-value items where they weren’t out of the way, but other than the loop out back to get the painting and the poem, my run was mostly just three loops to get both secret bonuses and place lots of items along the way.

Edit: Re computer solvers: I keep thinking about that too. It seems like it should be possible to use a fairly simple move valuation scheme and the lessons learned from the current high scores to guide a Monte Carlo tree search? We know the turn limit is critical: you need to average somewhere upward of $1100 to $1150 per move. You need to place 26+ items (averaging one every 5 to 5.5 turns) or you don’t have a chance: the items just aren’t worth enough to outweigh the placement bonuses. We know you need to get the secret bonus because it gives you upwards of $44,000 ($20K plus 5 items) and there’s no way you’re going to overcome that handicap. We know you need to get the time bonus (or if you don’t your moves need to be worth a full one-sixth more: in the $1300+ range). You almost certainly need to go out the front door because other than movement that is shared with other goals, it’s $20K for only four-and-a-bit moves (unlock key. unlock safe. open safe. take key (one-half move? one-third?). unlock door.).

1 Like

@Spike How many people do you know of who looked up the floor plan?

1 Like

By “trivial cycle,” do you mean a four-room or six-room cycle, such as Foyer->Parlor->Dining Room->Stair Hall?

A further refinement would be to remove the inventory limit restriction so that the problem you mention doesn’t arise. We could then use White Sugarlawn to get an upper bound on the optimal solution to the actual game. I don’t know how tight it would be, but I’m fairly confident that the movement required to place objects in their target locations combined with the time limit is much more of a restriction on the solution space than the inventory limit is. So we might get a useful upper bound from that.

You are the only person who has told me that they did that. :grinning:

Why that location...

My quintessential image of Mardi Gras is someone standing on a second-floor balcony in the French Quarter, dressed in a gaudy costume, and trying to catch some beads. Judging by how many people had trouble finding the location this image was far from universal. So I think this wasn’t one of the better puzzles.

However, there is a hint in the game: Try throwing the Mardi Gras beads. The game does reward players who engage with objects in the way one naturally would - rocking in the rocking chair, playing the piano, etc. - so I had hoped more players would discover this hint. Unfortunately, it appears few players did.

I could have clued this one better.

A response...

Based on my testers’ feedback, I had thought it would take players a while to draw this conclusion. But you realized it quite quickly - well done!

Agreed. The search space can be narrowed quite a bit by the realization that the optimal solution almost certainly includes the three features you mention: secret bonus, time bonus, and escape bonus.

2 Likes

I thought that was what you were going for, but the cover image had the mansion firmly fixed in my head as not somewhere that there would be hordes of partying people outside of. Thanks!

Also, here, have a D3.js force-directed graph of the Sugarlawn map. I hadn’t realized quite how long of a loop the north wing was until I made this…and when you figure that there are three locked doors in the way, it’s even longer.

That’s the imaginary front porch in blue, the north wing in purple and brown, the south wing in pink, out back in green and red, and the upper floors at the top right. Colors change where there are locked doors, mostly.

3 Likes

Nice visualisation of the map. I’m wondering if there’s a good way to visualise arrows pointing from the original to the target locations of all items? Or would that just be too chaotic?

I agree that the high score will certainly involve the secret bonus and the time bonus. I’m less sure about the escape bonus. It’s likely, but how much moves it costs you depends on where an ideal path would end. (Though there’s a case to be made that you’ll probably want to bring some books to the library, thus ending put near the exit anyway.)

What about the bag? Given the exponential increase of the placement bonus, you’ll earn back the bag of your successful placements increase by a factor square-root-of-two, right? That’s about 40% more items placed; a little less, because you’re not penalising the standard worths. So let’s say 30% more items places. But that easily translates into 9 items or more, and it seems unlikely that the bag will be that helpful. I never picked it up, even though it would have been useful during the exploration phase!

2 Likes

For your convenience, if you need it, my map. All treasures marked in red. MASSIVE SPOILERS.

Right, the secret bonus is essential because it is also highly efficient for placing items. The escape bonus is less so, but it also still feels like you’d need to do a lot of work to get more than it - at $20000 for 5 direct turns you’d need to be getting above 30 placed items for even three items to be worth more. Similarly, my highest route takes the ring without placing it, even though that’s a lot of turns. Two items might be enough to be worth more than the ring. But then you have to find a route where you can take advantage of the extra turns. I haven’t, yet… and Janet significantly beat my score so there must be gains to be made somewhere!

1 Like

Yeah, arrows for the item motions is pretty overwhelming. But you can play with it here: https://joshuagrams.github.io/sugarlawn-graph/

I haven’t bothered figuring out how to make the map start in a nice shape, but you can drag the circles around. If you drag the third floor straight up and hold, it mostly sorts itself out.

It shows items starting from or ending at the rooms near your mouse. The slider controls how near, so if you crank it all the way up you should be able to see pretty much everything at once.

Edit: Hmm. I left it kind of small. But it’s vector graphics, so if you zoom your web browser it will scale smoothly.

Have fun!

2 Likes

That’s a good point. Giving up the escape bonus means that your solutions are no longer forced to end in a particular location, which opens up the solution space quite a lot.

How did you decide on the inventory limit of 8, rather than 7, 9 or something else?

2 Likes

It was originally 6 - maybe 5. After playing around with the game some I raised it to 8. My goals were (1) to keep the bag vs. doubled-bonuses choice feeling like a real choice to the player, at least at the beginning, and (2) to avoid restricting the solution space too much if the player chooses the inventory limit/doubled bonuses option. With those goals, 7 seemed too restrictive and 9 seemed not restrictive enough. But there wasn’t a scientific process involved; it was more of a guesstimate on my part.

1 Like

We have a new high score, folks: Dannii Willis, with $164,043.

4 Likes