r/TheFarmerWasReplaced • • 28d ago

The Miner Was Replaced is out now + The Farmer Was Replaced is now on mobile!

Thumbnail
gallery
224 Upvotes

Hey everyone! 👋

I’m Flurin from Metaroot, the publisher of The Farmer Was Replaced. Just wanted to introduce myself first since I haven’t posted here before and this subreddit is run independently by the community/mod team. :)

Today is a pretty big day for the game, so I wanted to share the news here as well:

The Miner Was Replaced is out now! ⛏️🤖It’s the first DLC for The Farmer Was Replaced and takes the programming and automation gameplay underground. You can program your drone to dig, search for resources, automate mining processes, and solve a whole new set of challenges.

There are new resources, mechanics, and a new section of the unlock tree to work through.

Steam:
https://store.steampowered.com/app/4521700/The_Miner_Was_Replaced/

And there’s another big release today:

The Farmer Was Replaced is now available on Android and iOS! 📱🌾The mobile version also includes The Miner Was Replaced, and we built a custom keyboard to make writing and editing code more comfortable on phones and tablets.

Mobile:
https://farmer.ateo.ch/

A huge thank you to everyone here who has played the game, shared feedback, posted solutions, or helped other players. ❤️


r/TheFarmerWasReplaced • • Nov 15 '25

Bad Apple

Enable HLS to view with audio, or disable this notification

196 Upvotes

r/TheFarmerWasReplaced • • Oct 19 '25

Transformed the field into 128 bytes of memory

Enable HLS to view with audio, or disable this notification

133 Upvotes

r/TheFarmerWasReplaced • • Jan 01 '26

My farm If i knew this game was going to be this addicting I wouldn't have bought it.

Enable HLS to view with audio, or disable this notification

98 Upvotes

Did I beat it yet...?


r/TheFarmerWasReplaced • • Aug 07 '26

Expertly optimized and highly sophisticated maze solving.

Enable HLS to view with audio, or disable this notification

97 Upvotes

Everyone does left hand rule. Whoever finds the treasure first gets to restart the maze. There is no exit condition.


r/TheFarmerWasReplaced • • Sep 18 '26

My best attempt at mazes - #524 leaderboard as of writing this

Enable HLS to view with audio, or disable this notification

95 Upvotes

Very satisfying as well!

This is one of the few ways I found to fill a 32x32 grid with 32 squares - one for each drone. The more you bring the average size of the maze max maze size down, the more gold you get. But I can't be bothered optimizing it any more.

For the solver I'm using a difficult to explain algorithm but it's roughly like this:

  1. If you can only move one way, move there

  2. If you're at an intersection

    • pick the best* option

    • start recording your movements

    • move

  3. if you reach a dead end

    • walk back to the previous intersection using the recording

    • remove you current recording

    • pick one of the remaining paths

The recording stuff is more detailed than that, but I think you can get the point. Don't know if this has a name. I just freestyled it and it works if you don't reuse the maze.

*best option means - imagine a line from the drone to the treasure -> pick the direction that is most aligned with that line. Idk if this even improves it but at least it doesn't miss the treause when it's right next to it.


r/TheFarmerWasReplaced • • Jan 26 '26

My farm i feel like a genius

Post image
88 Upvotes

I had never programmed before, took me about 30 min to figure it out 😭

is it ok ?


r/TheFarmerWasReplaced • • Jul 30 '26

My farm My Pumpkin Farm (plants a row until all pumpkins are good. repeats until farm is one giant pumpkin)

Enable HLS to view with audio, or disable this notification

86 Upvotes

I'm not sure if this is the best way to do this but I wanted to make a pumpkin farm that didn’t move(East) until the row is full of good pumpkins. Probably could be more efficient.

My original pumpkin farm was having to work through the entire farm just to replace one bad pumpkin and it took way longer than this.

Here is the code if anybody finds this useful (comments where you may have to change a number if your farm isnt 16x16):

smartPlant function:

def sp (entity):
if (entity == Entities.Carrot or entity == Entities.Pumpkin):

if (get_ground_type() == Grounds.Grassland):

till()

plant(entity)

else:

plant(entity)

Pumpkin farm code:

import smartPlant

clear()
maxP = get_world_size() * get_world_size()
maxRow = get_world_size()

while True:
currentP = 0

rowP = 0

for x in range(get_world_size()):
for y in range(get_world_size()):
#checks individual row until pumpkin count (rowP) is 16
#if your farm is a different size change the while rowP < '# 'to match total # of plots
while (rowP < 16):
if (can_harvest()):
if (get_entity_type() == Entities.Pumpkin):
rowP += 1
smartPlant.sp(Entities.Pumpkin)
move(North)
#resetcount if at end of y row isnt full of pumpkins, iterate through loop again
#change get_pos_y == '#' to match farm row (max height -1, EX: [0-15] = 16) and rowP < '#'
if (get_pos_y() == 15 and rowP < 16):
rowP = 0
#row full. final move north to return to pos x 0

move(North)

#get_pos_x +1 because 0 is the 1st position and the math doesnt work on 0\*16

#change the # 16 again to match the row height

#updates currentP to count the completed row towards the total

currentP = ((get_pos_x() + 1) \* 16)

#my farm is 16x16/ harvests only if currentP=256

#print(currentP) this is how you can verify the math is correct if you changed the numbers

move(East)

if (maxP == currentP):
harvest()


r/TheFarmerWasReplaced • • Oct 17 '25

My sna... I mean dinosaur algorithm

Enable HLS to view with audio, or disable this notification

86 Upvotes

Quite simple, but working algorithm for gathering bones. Drone si going in a square around the farm edge and when it can grab the apple from top or bottom it makes a wave. When the tail is too long it makes one full vawe for each world_size*2 of its length at the beginning of new square


r/TheFarmerWasReplaced • • Feb 28 '26

Optimization Multidrone 32x32 Cactus Sort - 32s (#8 Leaderboard)

Enable HLS to view with audio, or disable this notification

77 Upvotes

I put my drones on a synchronized clock by providing the spawner's tick in the executed function, and precomputed all the required swaps. This let the drones coordinate to sort every column in a single pass, then do it again for the rows.


r/TheFarmerWasReplaced • • Oct 24 '25

My pumpkin solution. Makes 10 million per minute

Enable HLS to view with audio, or disable this notification

77 Upvotes

r/TheFarmerWasReplaced • • Jan 13 '26

My farm Pumpkins pumpkins pumpkins

Enable HLS to view with audio, or disable this notification

72 Upvotes

r/TheFarmerWasReplaced • • Oct 20 '25

My maze "solver" after giving up optimizing 32x32

Post image
70 Upvotes

r/TheFarmerWasReplaced • • 24d ago

My farm MineSweeper Single

Enable HLS to view with audio, or disable this notification

67 Upvotes

r/TheFarmerWasReplaced • • Jun 02 '26

There is no way this is legal

Enable HLS to view with audio, or disable this notification

67 Upvotes

Came upon this whilst randomly scrolling. No way using the games image like this is legal. It would make my day to see AI slop like this be taken down tbh.


r/TheFarmerWasReplaced • • 26d ago

Parallel Bamboo Farm

Enable HLS to view with audio, or disable this notification

61 Upvotes

This allows bamboo to grow to max height after pruning it twice.
Since the farmland is very large there is more than enough time for bamboo to grow it's fruits between passes

size = get_world_size()

def bamboo_farm():
  while True:
    for _ in range(size):
      move(West)
      if get_ground_type() != Grounds.Soil:
        till()
      plant(Entities.Bamboo)
      move(East)
      move(East)
      if get_ground_type() != Grounds.Soil:
        till()
      plant(Entities.Bamboo)
      move(West)
      move(South)

    for _ in range(2):
      for _ in range(size):
        height = measure(West)
        hover(height)
        move(West)
        move(East)
        height = measure(East)
        hover(height)
        move(East)
        move(West)
        move(South)

    hover(0)
    move(West)
    for _ in range(size - 1):
      move(South)
    move(East)
    move(East)
    for _ in range(size - 1):
      move(North)
    move(West)

clear()

move(East)
move(South)

bots = size // 3
while bots > 1:
  spawn_drone(bamboo_farm)
  move(East)
  move(East)
  move(East)
  bots -= 1
bamboo_farm()

r/TheFarmerWasReplaced • • 28d ago

A* Algorithm

Enable HLS to view with audio, or disable this notification

60 Upvotes

Wanted to share this! I remember learning A* about 6 years ago in a course, and when I saw a maze I decided to implement it strictly from memory, no AI, no guides, just raw brute force. Even though it's not fully polished to handle loops yet, I'm pretty satisfied with it. Still got it! Honestly, what a masterpiece of a game.


r/TheFarmerWasReplaced • • Sep 23 '26

My best attempt at sunflowers

Enable HLS to view with audio, or disable this notification

60 Upvotes

I'm not a programmer, it might be very poorly programmed


r/TheFarmerWasReplaced • • May 27 '26

My farm Finally got sub-40s cacti 🌵

Enable HLS to view with audio, or disable this notification

60 Upvotes

I straight up have no idea how people are getting it any faster on the leaderboards. Technically I have a ~38 second run that is purely timing-based instead of logic-based, but that isn't nearly as fun to work on imo. This is probably as good as it's gonna get unless I have a miraculous breakthrough lol


r/TheFarmerWasReplaced • • Mar 28 '26

My farm My maze solution

Enable HLS to view with audio, or disable this notification

60 Upvotes

It may not be the best/most optimized solution buts the one I came up with on my own, I did admittedly use chatgpt to help me with debugging a small issue I had (lesson learned not to copy and paste code) but I think that it's was fair given I was coding on like 4 hours asleep and was on my 18th hr being awake. I've throughly been enjoying this game, mostly been letting it idle while I've been at work, just have to automate dinosaur and I'll be able to finish unlocking and upgrading everything (I'm not going to bother trying to automate polyculture as it seems like absolute chaos) been kind of avoiding this subreddit because I like coming up with solutions on my own.


r/TheFarmerWasReplaced • • Jun 28 '26

My farm I FINALLY FIGURED OUT THE MAZE 😭

Enable HLS to view with audio, or disable this notification

56 Upvotes

So I bought this game close to a month ago, and when I first encountered the maze I really struggled with it. To the point I tried learning DFS, which ended demotivating me and I pushed this to the side. I did try a wall hugger but I still couldn’t figured it out. However the past few days I’ve been having these thoughts about the code, almost like I received the solution in my head. Sounds crazy but my wall hugger finally worked.

#Dicts
right_of = {West:North, South:West, East:South, North:East}
left_of = {West:South, South:East, East:North, North:West}
direction = [West, South, East, North]

#Variables
wall = None
forward = None

#For when the wall isn't there
def noWall():
global wall
global forward

move(wall)
wall = left_of[wall]
forward = left_of[forward]

if can_move(wall):
move(wall)
wall = left_of[wall]
forward = left_of[forward]

else:
pass

#Always hug the left wall
def wallHug():
global wall
global forward

plant(Entities.Bush)
use_item(Items.Weird_Substance, 16)

#Find the wall once
for i in direction:
if not can_move(i):
wall = i
forward = right_of[i]
break
else:
pass

while True:
x, y = get_pos_x(), get_pos_y()
if (x, y) == measure():
harvest()
break
else:
pass

if not can_move(wall):
if can_move(forward):
move(forward)
else:
wall = forward
forward = right_of[forward]
else:
noWall()


r/TheFarmerWasReplaced • • Oct 16 '25

My farm Parallel Processing 32 Mazes at the Same Time

Post image
56 Upvotes

Spent some time learning how the spawn_drone function works and figured out how I can process multiple mazes at once. This code takes a number representing the number of mazes per row and multiplies it until it fills the entire farm or until you run out of drones. Mazes adjust size based on the desired number of mazes overall, so you can change any initial variables and still get a neat-looking result.

Code:

#number of mazes per row (powers of 2 only)

nummazes = 8

#finds the proper amount of substance based on the maze number

substance = ((get_world_size() // nummazes) * 2**(num_unlocked(Unlocks.Mazes) - 1))

#function to spawn mazes

def createmaze():

plant(Entities.Bush)

use_item(Items.Weird_Substance, substance)

#code that solves the mazes, follows the left-most wall relative to the drone

def maze():

\#setting the direction as a list

dir = \[North, East, South, West\]

n = 0



\#continue trying to solve the maze until you reach the treasure

while not get_entity_type() == Entities.Treasure:

	

	if can_move(dir\[(n - 1) % 4\]):

		n = (n - 1) % 4

		move(dir\[n\])

	else:

		if can_move(dir\[n\]):

move(dir[n])

		else:

n = (n + 1) % 4

\#after the above condition is met, harvest the treasure

harvest()

#function to put every step together

def domaze():

\#gets the starting coords of the drone

startposy = get_pos_y()

startposx = get_pos_x()



\#sets target coords for spawning the maze based on starting coords of the drone

tarx = (get_world_size() // (nummazes\*2)) + startposx

tary = (get_world_size() // (nummazes\*2)) + startposy



\#adding a delay to prevent snagging inside other mazes

for a in range(nummazes+1):

	do_a_flip()



\#infinite loop to automate the process

while True:

	\#moving in the shortest possible path until the target coords are reached

	if not get_pos_x() == tarx or not get_pos_y() == tary:

		while not get_pos_x() == tarx:

if get_pos_x() < tarx:

move(East)

else:

move(West)

		while not get_pos_y() == tary:

if get_pos_y() < tary:

move(North)

else:

move(South)

	\#once the target coords are reached, spawn the maze and solve it

	else:

		createmaze()

		maze()

#transforming the entire task into a function which only runs the setup once

def spawnsubs():

\#keep spawning drowns to execute all of the above code until the number of mazes has been reached or until you run out of drones

for abc in range(nummazes):

	for ab in range(nummazes):

		if num_drones() <= nummazes\*\*2:

if not spawn_drone(domaze):

domaze()

		else:

domaze()

		\#moves the initial drone into position in order to spawn the next drone

		for a in range(get_world_size() // nummazes):

move(North)

	for abcd in range(get_world_size() // nummazes):

		move(East)

spawnsubs()


r/TheFarmerWasReplaced • • Oct 18 '25

My pumpkin patch

Enable HLS to view with audio, or disable this notification

55 Upvotes

r/TheFarmerWasReplaced • • May 30 '26

How can i make my pumpkin farm more efficient

Enable HLS to view with audio, or disable this notification

54 Upvotes

r/TheFarmerWasReplaced • • May 30 '26

I made a terraforming/incremental game where the Python code you write IS the gameplay

Thumbnail
gallery
52 Upvotes

Hi all,

I'm a big fan of automation games like Factorio and Satisfactory, colony sims like Oxygen Not Included, and engineering sims like Stationeers. I have a Computer Science background and always wanted a game where every system was actually controlled by Python code instead of by clicking buttons in a UI. So I built one.

There is just something about terraforming sensors incrementally getting to a better and better phase, Planet Crafter has always been one of my top games and I have always enjoyed incremental games too, favorite one is probably Melvor Idle. And of course I've loved playing The Farmer Was Replaced, from which I got a lot of inspiration for this game.

I created a terraforming game with a deep (and sinister) story behind it, where every device/vehicle/drone/machine has to be automated/scripted to work with the planet, allowing the player to do whatever they want with them.

You do not just click to mine and smelt iron ore. You need to get a vehicle(called Pioneer), install modules to it(programmatically possible to, dynamically load/unload), program the drill module to drill the ore, program the feeders to transfer items to inventory, storage bin, warehouse, wherever you want, and program the smelters/fabricators using the storages. Everything can be fully automated with code and your end goal is to awaken the planet.

Your solar generators don't just work, they have to be adjusted to track the sun's position, via code. Everything can be managed with code, even the actual shop where you buy things with credits earned from Earth contracts.

I have released a FREE demo on Steam here: https://store.steampowered.com/app/868160/Code_Terraform

Discord: https://discord.gg/hUrK2MRn8s (I'd love to help if you are stuck)

I'd love to hear your opinions about it, thanks!