A C# Mission Launcher For Project Malmo Minecraft
This article covers the AI Help Website Malmo C# Mission Launcher for Project Malmo. This should provide a good starting point for your AI experiments.
Project Malmo is a AI experimentation platform designed to work with Minecraft. Its purpose is to support research in artificial intelligence. It allows allows researchers to write code for artificial intelligence agents that can act within the Minecraft environment.
There are a lot of code examples for the Python programming language, but very little for C#. The Malmo C# Mission Launcher is designed to assist C# developers and researchers.
The AI Help Website C# Mission Launcher
The first step to using Malmo, is to install it and Minecraft, using the directions here:
Launch the Malmo client, this will also start Minecraft.
Wait for the Malmo client and Minecraft to build and be fully running…
Download and unzip the AI Help Website Malmo C# Mission Launcher (MalmoCSharpLauncher) from the download page on this site.
Open it up in Visual Studio 2015 (or higher).
Run the MalmoCSharpLauncher.
Select the Default mission and click Run.
Minecraft will load the mission, and you can click inside the Minecraft window, press enter, and navigate inside Minecraft.
The Malmo C# Launcher will display diagnostic data.
(note, the Default mission is set to only run 90 seconds before diagnostic information stops)
If you stop the Malmo C# Launcher and look in the bin/x64/Debug/mission_records directory, you will see the saved data for the missions.
Opening one of these directories up will give you access to all the logs for the mission including a video of it.
If you run the Malmo Python example from their tutorial you will see how to create missions that teach the Agent (the player).
The Malmo C# Launcher contains a mission called “ AvoidTheLava ” that provides a simplified version of a mission.
This has the Agent walk in a strait line, until he detects lava. If he does, he turns to avoid it and continues walking.
The mission is complete when the Agent reaches a grass block.
Creating A Mission
A mission consists of a C# class and a .xml file.
The contents of the .xml file describe the world and the goal.
The documentation for the .xml file and all the API methods used in the code below are available at this link.
The code to control the mission is simple, and basically runs in a continuous loop until the mission is complete (or manually stopped).
The mission code makes an observation about what is going on, and then reacts to it by directing the Agent using the agentHost.sendCommand function.
The Malmo C# Launcher contains a number of helper classes to assist in gathering observations, so that the actual custom code required for the mission is relatively small, and is as follows:
- You can get a list of all possible moves and Minecraft objects recognized and manipulateable from the files in the schemas directory.
- When installing Malmo, do not install it in a directory that has any spaces. Use a directory like “C:\malmo”
- To run the Python examples, install the exact versions that the Malmo directions suggest.
Project Malmo Blog
Project Malmo Github
Project Malmo Issues (forum)
Project Malmo Documentation
Project Malmo Download
You can download the code for the Project Malmo C# Mission Launcher from the Download page