How to do it...

  1. Define the initial conditions of the world using the <ServerInitialConditions> tag:
Sample:
<ServerInitialConditions>
<Time>
<StartTime>6000</StartTime>
<AllowPassageOfTime>false</AllowPassageOfTime>
</Time>
<Weather>clear</Weather>
<AllowSpawning>false</AllowSpawning>
</ServerInitialConditions>
  1. Navigate to http://www.minecraft101.net/superflat/ and create your own preset string for the super-flat world:

  1. Generate a super-flat world with the specified preset string using the <FlatWorldGenerator> tag:

<FlatWorldGenerator generatorString="3;7,220*1,5*3,2;3;,biome_1"/>
  1. Draw structures in the world using the <DrawingDecorator> tag:
Sample:
<DrawingDecorator>
<!-- coordinates for cuboid are inclusive -->
<DrawCuboid x1="-2" y1="46" z1="-2" x2="7" y2="50" z2="18" type="air" />
<DrawCuboid x1="-2" y1="45" z1="-2" x2="7" y2="45" z2="18" type="lava" />
<DrawCuboid x1="1" y1="45" z1="1" x2="3" y2="45" z2="12" type="sandstone" />
<DrawBlock x="4" y="45" z="1" type="cobblestone" />
<DrawBlock x="4" y="45" z="12" type="lapis_block" />
<DrawItem x="4" y="46" z="12" type="diamond" />
</DrawingDecorator>
  1. Specify a time limit for all agents using the <ServerQuitFromTimeUp> tag:
<ServerQuitFromTimeUp timeLimitMs="100000000"/>
  1. Add all mission handlers to the block using the <ServerHandlers> tag:
<ServerHandlers>
<FlatWorldGenerator>{Copy from step 3}</FlatWorldGenerator>
<DrawingDecorator>{Copy from step 4}</DrawingDecorator>
<ServerQuitFromTimeUp>{Copy from step 5}</ServerQuitFromTimeUp>
</ServerHandlers>
  1. Add <ServerHandlers> and <ServerInitialConditions> under the <ServerSection> tag:
<ServerSection>
<ServerInitialConditions>{Copy from step 1}</ServerInitialConditions>
<ServerHandlers>{Copy from step 6}</ServerHandlers>
</ServerSection>

  1. Define the agent name and starting position:
Sample:
<Name>Cristina</Name>
<AgentStart>
<Placement x="4.5" y="46.0" z="1.5" pitch="30" yaw="0"/>
</AgentStart>
  1. Define the block types using the <ObservationFromGrid> tag:
Sample:
<ObservationFromGrid>
<Grid name="floor">
<min x="-4" y="-1" z="-13"/>
<max x="4" y="-1" z="13"/>
</Grid>
</ObservationFromGrid>
  1. Configure the video frames using the <VideoProducer> tag:
Sample:
<VideoProducer viewpoint="1" want_depth="false">
<Width>320</Width>
<Height>240</Height>
</VideoProducer>
  1. Mention the reward points to be received when an agent comes into contact with a block type using the <RewardForTouchingBlockType> tag:
Sample:
<RewardForTouchingBlockType>
<Block reward="-100.0" type="lava" behaviour="onceOnly"/>
<Block reward="100.0" type="lapis_block" behaviour="onceOnly"/>
</RewardForTouchingBlockType>
  1. Mention the reward points to issue a command to the agent using the <RewardForSendingCommand> tag:
Sample:
<RewardForSendingCommand reward="-1"/>

  1. Specify the mission endpoints for the agent using the <AgentQuitFromTouchingBlockType> tag:
<AgentQuitFromTouchingBlockType>
<Block type="lava" />
<Block type="lapis_block" />
</AgentQuitFromTouchingBlockType>
  1. Add all agent handler functions under the <AgentHandlers> tag:
<AgentHandlers>
<ObservationFromGrid>{Copy from step 9}</ObservationFromGrid>
<VideoProducer></VideoProducer> // Copy from step 10
<RewardForTouchingBlockType>{Copy from step 11}</RewardForTouchingBlockType>
<RewardForSendingCommand> // Copy from step 12
<AgentQuitFromTouchingBlockType>{Copy from step 13} </AgentQuitFromTouchingBlockType>
</AgentHandlers>
  1. Add all agent handlers to <AgentSection>:
<AgentSection mode="Survival">
<AgentHandlers>
{Copy from step 14}
</AgentHandlers>
</AgentSection>
  1. Create a DataManager instance to record the training data:
DataManager manager = new DataManager(false);
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset