Welcome to RoboFarm!

Saving you time by intelligently automating minecraft farming to give you an optimum crop growth

Accessing the project

The project was built by Daniel Davies and Brett Galkowski as part of UCIs CS175 "Project in Aritifical Intelligence" course

Check the project out on Github

Summary of project

Crop farming in Minecraft can be quite a time consuming process: to get any significant benefit in the game, we may have to first find suitable spots for the seeds to grow, and then physically go to each of those optimal locations to plant them. So to make the process quicker and easier we have made a tool that allows an AI to do the farming process for you and save more time for you to do whatever else you want to do in the game.

The final aim of this project is to have an agent that, given a map, and some farmable objects defined by the user, will plant the objects for the user in an optimal position.

What exactly is an optimal position you may ask?

Technically there are many variables that influence the growth of a crop in minecraft (see here for details). This includes:

  • Is the farmland block you're planting on hydrated?
  • Is there good lighting? (Provided by a torch)
  • Are the plants organised? If in a row/ column of crops, these will grow faster than individual crops.

Given these criteria, our agent should find optimal planting coordinates using GENETIC ALGORITHMS

Genetic algorithms

In brief, a genetic algorithm is essentially a search algorithm based on natural selection. In general, the best "genes" (aka the best of your states from a set of states in your world) will survive and reporduce to make a better population in each round than you had before.

The stages of a genetic algorithm are roughly as follows: (see here)

  • Generate a random population of n initial samples
  • Evaluate the fitness f(x) score of each sample in the population
  • Create a new population by repeating following steps until the new population is complete:
    1. Select two parents from a population according to their fitness (the better fitness, the bigger chance to be selected)
    2. Form new children by using attributes of the selected parents
    3. Mutate each offspring slightly to allow for world exploration
    4. Add the child to the population
  • Re-run the algorithm based on your new population
  • If the algorithm has converged/ you have reached your stopping condition, return the current results

Related Resources on Genetic Algorithms

Below is a list of resources we found useful when researching Genetic Algorithms

Matlab Article

This resource demonstrates how a genetic algorithm is used to find minimum points on a graph

A nice breakdown is given of the seperate stages of the genetic algorithm and how you can actually code up a solution by yourself

Visit here to see the article

Video Demonstration

The below video shows a nice visual animation on how genetic algorithms repeatedly take the best performing samples from the "gene pool" to eventually converge on a population that each finds itself on some optimal point.

See the video on youtube here