How it works...

In step 1, the following configurations are added as the initial conditions for the world:

  • StartTime: This specifies the time of day at the start of the mission, in thousandths of an hour. 6,000 refers to noontime.
  • AllowPassageOfTime: If set to false, then it will stop the day-night cycle. The weather and the sun position will remain constant during the mission.
  • Weather: This specifies the type of weather at the start of the mission.
  • AllowSpawning: If set to true, then it will produce animals and hostiles during the mission.

In step 2, we created a preset string to represent the super-flat type that is being used in step 3. A super-flat type is nothing but the type of surface seen in the mission. 

In step 4, we drew structures into the world using DrawCuboid and DrawBlock

We follow three-dimensional space (x1,y1,z1) -> (x2,y2,z2) to specify the boundaries. The type attribute is used to represent block types. You may add any of the available 198 blocks for your experiments.

In step 6, we add all mission handlers specific to world creation under the <ServerHandlers> tag. Then, we add them to the <ServerSection> parent tag in step 7.

In step 8, the <Placement> tag is used to specify the player's starting position. The starting point will be chosen randomly if it is not specified. 

In step 9, we specified the position of the floor block in the gaming window. In step 10, viewpoint sets the camera viewpoint: 

viewpoint=0 -> first-person
viewpoint=1 -> behind
viewpoint=2 -> facing

In step 13, we specify the block types in which agent movement is stopped once the step is over. In the end, we add all agent-specific mission handlers in the AgentSection tag at step 15. Mission schema creation will end at step 15.

Now, we need to store the training data from the mission. We use DataManager to handle the recording of training data. It creates the rl4j-data directory if it does not exist and stores the training data as the reinforcement learning training progresses. We passed false as an attribute while creating DataManager in step 16. This means that we are not persisting the training data or the model. Pass true if the training data and model are to be persisted. Note that we are going to need the data manager instance while configuring DQN. 

..................Content has been hidden....................

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