Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

human action space + enabled GUI #449

Merged
merged 60 commits into from
Feb 4, 2021
Merged

Conversation

pzhokhov
Copy link
Collaborator

@pzhokhov pzhokhov commented Feb 2, 2021

  • adds a "LowLevelInput" mission flag that allows malmo input to be injected at mouse and keyboard level (instead of events level)
  • when lowLevelInput is on, in-game GUIs are enabled
  • new env specs - HumanControls (base spec class), HumanSurvival, and EquipWeapon. EquipWeapon is task to equip iron axe that is placed somewhere in the inventory using human inputs. The reward and done signal for equip weapon have to be implemented via a wrapper on the python side.

@pep8speaks
Copy link

pep8speaks commented Feb 2, 2021

Hello @pzhokhov! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-02-04 00:08:43 UTC

@pzhokhov pzhokhov marked this pull request as ready for review February 2, 2021 19:52
@@ -1874,9 +1874,15 @@ protected void onMissionStarted()

// Force brightness setting
Minecraft.getMinecraft().gameSettings.gammaSetting = (float) 2.0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A gamma setting of 2 is brighter than playable without editing the options.txt manually (e.g. the highest in game via the brightness slider)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May also need to look into fov as it is beyond quake-pro in default minerl

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, but I'd rather get a wider team buy-in before changing these values, since that would affect everyone's experiments. Currently in this PR the behavior (without lowLevelInput flag) should not change.

* Event listener that logs when agents open gui windows
* @param event the captured event
*/
@SideOnly(Side.CLIENT)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was originally here to debug if we were opening a gui window unintentionally, probably OK to remove

float x = (float) (player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks);
float y = (float) (player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks);
float z = (float) (player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks);
float yaw = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * partialTicks;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we forgot to zero them out here

@@ -208,43 +208,6 @@ public void onPressed()
this.keyManager = new KeyManager(settings, extraKeys);
}

/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will we prevent locking out non-gui agents from moving?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh you make a good point, let me restore this bit of code. Deleted it accidentally with the debug function ^_^

this.currentPitch = player.rotationPitch;
}
}
return true;
}
} catch (NumberFormatException e) {
System.out.println("ERROR: Malformed parameter string (" + parameter + ") - " + e.getMessage());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ignoring number format exceptions then? That is expected right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my understanding is that, just like prior to the change, in case of NumberFormatExceptions, we print an error message and return false (which, AFAIK, means that the command will be passed further down the chain)

FakeMouse.setGrabbed(grabbed);
}
//
// @Overwrite(remap = false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No-longer needed?

<xs:element name="LowLevelInputs" type="xs:boolean" default="false" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>
If set to true, inputs to malmo are injected instead of keyboard and mouse (instead of higher level commands)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "If set to true, inputs to malmo are disabled and instead given via a virtual keyboard and mouse (instead of higher level commands)"

Copy link
Member

@brandonhoughton brandonhoughton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few more comments but otherwise looks good to me!

@pzhokhov pzhokhov merged commit c70f6cc into dev Feb 4, 2021
@pzhokhov pzhokhov deleted the peterz/human_action_spaces_pr branch February 4, 2021 00:24
brandonhoughton added a commit that referenced this pull request Feb 4, 2021
brandonhoughton added a commit that referenced this pull request Mar 11, 2021
player.setPositionAndRotation(player.posX, player.posY, player.posZ, this.currentYaw, this.currentPitch);
// TODO peterz: I am pretty sure this code is deprecated and does not match the docstring
// i.e. no smooth panning is happening here
// player.setPositionAndRotation(player.posX, player.posY, player.posZ, this.currentYaw, this.currentPitch);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be causing extra flakiness in starting position?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants