-
Notifications
You must be signed in to change notification settings - Fork 153
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
Conversation
pzhokhov
commented
Feb 2, 2021
•
edited
Loading
edited
- 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.
…. Use button is a little strange - single tick click opens places the crafting table and opens the inventory
…erl into peterz/human_action_space
…erl into peterz/human_action_space
…erl into peterz/human_action_space
@@ -1874,9 +1874,15 @@ protected void onMissionStarted() | |||
|
|||
// Force brightness setting | |||
Minecraft.getMinecraft().gameSettings.gammaSetting = (float) 2.0; |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); | |||
} | |||
|
|||
/** |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No-longer needed?
minerl/Malmo/Schemas/Mission.xsd
Outdated
<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) |
There was a problem hiding this comment.
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)"
There was a problem hiding this 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!
This reverts commit c70f6cc.
This reverts commit c70f6cc.
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); |
There was a problem hiding this comment.
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?