Good!
Before continuing to analyze the sections that have an xml file with the definition of a mission in Minecraft, I will share a small ConsoleApp sample project which creates from scratch the necessary elements to interact in a Minecraft mission.
The function that initializes the mission from a file is
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void InitMissionSpecs() | |
{ | |
var missionXmlDefinition = File.ReadAllText("SampleMission.xml"); | |
_mission = new MissionSpec(missionXmlDefinition, false); | |
_mission.requestVideo(640, 480); | |
var recordedFileName = $"./mission_data{DateTime.Now:hh mm ss}.tgz"; | |
_missionRecord = new MissionRecordSpec(recordedFileName); | |
_missionRecord.recordCommands(); | |
_missionRecord.recordMP4(20, 400000); | |
_missionRecord.recordRewards(); | |
_missionRecord.recordObservations(); | |
} |
In line 4 we can see the definition in plain xml mode can be used in the MissionSpec() constructor. From this moment, the mission is created with the parameters of the file.
It is possible, once created about writing some values, as for example in line 5 where I define the video quality with which the mission will be executed.
Sample Project en GitHub link
Greetings @ Toronto
El Bruno
References
- El Bruno, Definition of Minecraft missions in Xml format
- El Bruno, Minecraft game interaction agents, missions definitions and recording with Project Malmo
- El Bruno, Learning to code with Minecraft? start with Hour of Code, MakeCode and Project Malmo
- Malmo, GitHub Home
- Malmo Mission Xml Schema
- Malmo Mission Xml Schema, FlatWorldGenerator
- Superflat Preset Generator
4 comments