The Farmer Was Replaced

The Farmer Was Replaced

How does the new water upgrade work?
You can use water tanks to water your plants. One water tank is automatically added to your inventory every 10 seconds.
Upgrading Unlocks.Watering will give you an additional water tank every 10 seconds.

the part of the "upgrading unlocks.watering" I have no clue on how to use this?

Tried this,
x = use_item(Items.Water)
if not x:
Unlocks.Watering
tried use_item(Unlocks.Watering) but that also just gives error, what's the thought behind this?
< >
Showing 1-5 of 5 comments
owenz Dec 31, 2024 @ 2:21am 
Well, you are on the right thought train,

use_item(ITEM)
returns true/false depending on the result.

I would follow the in-game about watering though and use get_water() in conjunction with use_item() instead.

MIN_WATER_LEVEL = 0.25 if get_water() < MIN_WATER_LEVEL: use_item(Items.Water)

In addition to the information provided in game, the use of water is 0.25 up to 1 with each use, and maintaining a higher water level of course would consume the water faster. Up to a maximum of 2 per second.

Also, water levels of 0 = 1x, 1 = 5x multiplier on growth speed. So it stands to reason that if you maintain the water level at anything above .25 you would maintain a growth multiplier of 2x-3x, if and only if you can maintain those levels.


The really cool thing is you could implement a simple algorithm to analysis your water usage over time to increase or decrease the uses of water giving you the most optimal water level for each tile. A really good use case of a PID controller, but this is a complex thing to implement but would be hella fun to.

It would look something like,

TIMESTEP = 2 water_delta_min = -2 MAX_WATER_LEVEL = 0.75 MIN_WATER_LEVEL = 0.25 MAX_WATER = 100 MIN_WATER = 10 params = { "last_time": get_time(), # init the time "water_level": num_items(Items.Water), # Set the water level for each time step "delta_water": 0 # Init to 0 as we have yet to use any water } def calculate_water(PARAMS): PARAMS["last_time"] = get_time() PARAMS["delta_water"] = num_items(Items.Water) - PARAMS["water_level"] PARAMS["water_level"] = num_items(Items.Water) return PARAMS def water_tile(PARAMS): if water_delta_min > PARAMS["delta_water"]: return if get_water() < MAX_WATER_LEVEL: use_item(Items.Water) def plant_here(): if get_ground_type() == Grounds.Grassland: till() if get_entity_type() != Entities.Grass: plant(Entities.Grass) while True: if get_time() - params["last_time"] > TIMESTEP: params = calculate_water(params) quick_print("Delta Water: ", params["delta_water"]) if num_items(Items.Water) > MIN_WATER: water_tile(params) harvest() plant_here() if get_pos_x() == get_world_size() - 1: move(North) move(East)

Overall, you can go about this any way you want from complex to simple. Do as you see fit and just have fun.
The Mad Panda Dec 31, 2024 @ 5:45am 
Sure, that's a way to use the water, but don't get how to increase the water refill time from the default of 0.1 per second?
samite_alchemist Dec 31, 2024 @ 9:04am 
Not so clear in the instructions, you need the "unlock" command:
unlock(Unlocks.Watering)
samite_alchemist Dec 31, 2024 @ 9:07am 
It costs Wood to unlock Watering levels. The first 5 levels cost:
50, 60, 84, 118, 165
The Mad Panda Dec 31, 2024 @ 10:21am 
just realized you can click upgrade in the unlock menu........
< >
Showing 1-5 of 5 comments
Per page: 1530 50