Feature - Implemented Change get_campground() to contain packet of whatever seeds if planted

Ryo_Sangnoir

Developer
Staff member
Currently, if grass or mushroom spores are planted, get_campground() contains "packet of tall grass seeds" or "packet of mushroom spores". However, winter or thanksgarden seeds are identified by "ice harvest" or "cornucopia" -- returning how many you should be able to harvest. Can these be changed to have "packet of winter seeds" and "packet of thanksgarden seeds" in addition?

Edit: alternatively, you posted in the mushroom garden thread about a function "garden_type" which tells you what the type of your garden is. That might be less confusing.
 
Last edited:

Veracity

Developer
Staff member
I have little interest in making an incompatible change like that.

The original reasoning was user friendliness:

When you configure breakfast garden harvesting in the GUI (settings harvestGardenHardcore and harvestGardenSoftcore), you specify the type of crop you want. Many of those crops require multiple days of growth to achieve. Rather than requiring the user to know, for each garden type, how many days each prize will take to achieve, they pick the desired prize from a dropdown and let KoLmafia decide when to pick.

When we added get_campground(), we continued with that: it contains the item (with count) that you will get if you harvest right now. You will sometimes get multiple kinds of item: the ice and beer gardens, for example. A wrinkle is the Skulldozer, which is a fight, not an item. We denote that as "skeleton (-1)".

When grass seeds came out, there was another wrinkle. You can have from 1-7 patches of tall grass, or, on day 8, one very tall grass. Additionally, you can apply fertilizer at will to to advance your garden. If you want to harvest patches of tall grass, you may as well harvest every day. If you want very tall grass, you have to wait until it is there - either via natural growth or fertilization. The breakfast garden dropdowns therefore gave you just those two choices. But get_campground() returns the pack of grass seeds with a count from 1-8 so that scripts can decide what to do: harvest 6 tall grass or fertilize twice and harvest very talll grass (on count = 8) or whatever.

All of the above types of garden let you look at the garden in the campground and know what you were getting.
All of the above types of garden will grow every day with no attention.

The mushroom garden broke both of those things. You cannot look at the garden in the campground and know what is in it. And if you don't fertilize it, it won't grow.

My initial support for it listed the various mushrooms in the drop downs and also put them in get_campground(). When the dictator (I believe) asked me to change it to the count of mushroom spores (like grass seeds), since it would simplify his coding, I agreed, since the feature was still under development. I stored the crop progress in terms of mushroom spores and set up the drop downs so that people could continue to specify the desired crop to harvest (stored in the properties I listed) using mushroom names.

That is the user-friendly approach.

For ASH programs, well, now they have to know what you get for each day of progress. Not obvious to me that it simplifies the code. In fact, my own Garden Harvester script ended up being more complicated, since its configuration mirrors the user-friendly "expected crop" that you get for built-in breakfast harvesting - which was the whole point; you can configure ALL your gardens, just like KoLmafia internally allows you to do for one garden at a time. But, since the feature was still under development, I was willing to change it.

Changing earlier gardens to have the same convention? As I showed with the mushroom garden, you can still have user-friendly descriptions of expected harvest even if the internal representation is different. But changing what shows up in get_campground() would break existing ASH scripts - including mine, which, as I said, has to map user-friendly expected crops to whatever get_campground() says is currently available.

I could provide an ASH function to tell you what kind of garden you have. "pumpkin", "peppermint", "skeleton", "beer", "winter", "thanksgarden", "grass", "mushroom"
I could provide an ASH function to tell you how many days it's been growing. So, "skeleton" + 6 means you have a Skulldozer, which my_campground() represents as skeleton (-1).

A Thanksgarden on day 6 has 15 cornucopias. New functions might return "thanksgarden" + 6. get_campground() would return cornucopia (15).

Yeah. No backwards-incompatible changes to get_campground(). If we'd done it from the beginning as SEED_PACKET_NAME (DAYS) that would have been consistent with what we now do with grass and mushroom gardens, but I think it is too late.
 
Is there any reason we can't have both at the same time (codetechnical or somesuch)?

That is, could get_campground() contain BOTH the crop(s) with count (so that you can check what's available for harvest) AND the seed packet with a count of one, so that you can check which you have currently installed? That would keep it backwards compatible (I think). Though it would ideally mean putting the various mushrooms back into get_campground() to get full consistency with the other gardens. Well and there's the pokegarden, but that one is weird anyway, since the growing crops aren't the same as the resulting harvest, so there's no item to put into an item list like get_campground(), so that one (and the skulldozer) could stay as is.

For what it's worthy: my current implementation in my FreeFight script uses "get_campground() contains $item[packet of mushroom spores] && !get_property_bool("_mushroomGardenVisited")" as a check to see if it can adventure in the mushroom garden. It decides what it should do while it's there based on checking mushroomGardenCropLevel while inside the choice adventure (since the text for the choice adventure should update that property if the count was off for some reason, and I was worried hitting up get_campground() would fail while stuck inside a choice adventure).
 
Last edited:

Ryo_Sangnoir

Developer
Staff member
I could provide an ASH function to tell you what kind of garden you have. "pumpkin", "peppermint", "skeleton", "beer", "winter", "thanksgarden", "grass", "mushroom"

This sounds ideal -- I'm only using get_campground() because I want to know what sort of garden I have planted, and that's the only way I can see to do that.

I've got a script which could be using the thanksgarden, the grass garden, or the mushroom garden. For the mushroom garden, you get a free fight every day and a colossal mushroom every 11. After picking the colossal mushroom, you can flip to thanksgarden to get a cornucopia, then to grass to start getting Poké-Gro fertilizers, then use one, wait for rollover, harvest all your cornucopias, back to grass, then back to mushroom and do the fight + fertilize.

Edit: and according to the forum thread you can in fact flip to and from mushroom daily and have it keep the charge! Well.
 
Last edited:

Veracity

Developer
Staff member
Revision 19992 does this:

Add ASH function my_garden_type() which returns a string:
pumpkin, peppermint, skeleton, beer, winter, thanksgarden, grass, mushroom

I looked into the dictator's suggestion of adding, say, pumpkin seeds => 7 to get_campground() to say that you have a pumpkin patch with seven days of growth, but we don't actually know that.

pumpkinpatch_0 ... pumpkinpatch_4 = 0-4 days of growth
pumpkinpath_giant = 5-10 days of growth
pumpkinpatch_ginormous = 11+ days of growth

Every other kind of garden (except mushrooms) has a distinct image which changes every day until you get the ultimate prize.
We track days of fertilization for mushrooms - and put that as the count of mushroom spore packets.
We do not track days of growth for pumpkins, so if there is a giant pumpkin, we don't know how many days until you get a ginormous pumpkin.

I don't feel like adding a day counter for pumpkins since I will probably never have pumpkins growing again.
I may just have pumpkin seeds (5) and (11). Hmm.
 

Veracity

Developer
Staff member
Revision 19993 adds an extra item to all gardens which is SEED_PACKET => DAYS_OF_GROWTH.
(Grass and Mushrooms already had this.)

As mentioned above, the "days of growth" is not accurate if you have a pumpkin patch with a giant pumpkin in it; it will say 5, when it could be any of 5-10.
 

Ryo_Sangnoir

Developer
Staff member
Grand, thanks.

It NPEs for my character without a garden, though. I'm not sure what string should be preferred -- a blank string, perhaps? "none"?
 
Wow, awesome. I just wanted seed_packet => 1 (aka, true), but days of growth is even better.

Edit: hmm, something isn't updating properly, quick switchings seem to be throwing things off. This was after swapping from mushroom to thanksgarden a little before:
Code:
> /u mushroom spor

Using 1 packet of mushroom spores.

You acquire an item: packet of tall grass seeds

> ash get_campground()

Returned: aggregate int [item]
meat golem => 1
Certificate of Participation => 1
Dramatic™ range => 1
Feng Shui for Big Dumb Idiots => 1
Queue Du Coq cocktailcrafting kit => 1
pagoda plans => 1
clockwork maid => 1
Discount Telescope Warehouse gift certificate => 7
snow fort => 1
potted tea tree => 1
haunted doghouse => 1
Witchess Set => 1
Source terminal => 1
Asdon Martin keyfob => 1
packet of tall grass seeds => 1
packet of mushroom spores => 8

> ash my_garden_type()

Returned: grass
Preference nextAdventure changed from None to Your Mushroom Garden
Preference lastAdventure changed from Barf Mountain to Your Mushroom Garden

[50405] Your Mushroom Garden
Preference lastEncounter changed from government requisition form to No More Shroom at the Inn
Encounter: No More Shroom at the Inn

> use winter seeds

Using 1 packet of winter seeds...
You acquire an item: packet of mushroom spores
Finished using 1 packet of winter seeds.

> ash get_campground()

Returned: aggregate int [item]
meat golem => 1
Certificate of Participation => 1
Dramatic™ range => 1
Feng Shui for Big Dumb Idiots => 1
Queue Du Coq cocktailcrafting kit => 1
pagoda plans => 1
clockwork maid => 1
Discount Telescope Warehouse gift certificate => 7
ice harvest => 3
snow fort => 1
potted tea tree => 1
haunted doghouse => 1
Witchess Set => 1
Source terminal => 1
Asdon Martin keyfob => 1
packet of mushroom spores => 8

> ash my_garden_type()

Returned: winter

> /u thanksgarden seeds

Using 1 packet of thanksgarden seeds.

You acquire an item: packet of winter seeds

> ash get_campground()

Returned: aggregate int [item]
meat golem => 1
Certificate of Participation => 1
Dramatic™ range => 1
Feng Shui for Big Dumb Idiots => 1
Queue Du Coq cocktailcrafting kit => 1
pagoda plans => 1
clockwork maid => 1
Discount Telescope Warehouse gift certificate => 7
snow fort => 1
potted tea tree => 1
haunted doghouse => 1
Witchess Set => 1
Source terminal => 1
cornucopia => 1
Asdon Martin keyfob => 1
packet of mushroom spores => 8

> ash my_garden_type()

Returned: thanksgarden
 
Last edited:
Ok, forcing 'refresh all' seems to fix the mismatching, but 'refresh camp' does not. I don't know if that helps to figure out where it's losing track, but it as a workaround I can sprinkle my script with some cli_executes to keep up.
 

Veracity

Developer
Staff member
There is code to update the campground when you change gardens, but I did not update that for this, yet.
Mushroom garden resets on ascension, but otherwise retains progress, eh?

I'll do both of those things.
 
Top