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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d16da17
human inputs envs - wip. Made FakeKeyboard work, need to modify launcher
pzhokhov Nov 13, 2020
b9c1540
enable modding the lwjgl
pzhokhov Nov 13, 2020
e8c5511
.
pzhokhov Nov 16, 2020
2ab9143
fixed rendering the gui for python
pzhokhov Nov 16, 2020
ba75232
add use button == right click, hotbar keys
pzhokhov Nov 17, 2020
18374b9
equip weapon task
pzhokhov Nov 18, 2020
52b48f3
equip item env
pzhokhov Nov 18, 2020
a60400f
equip weapon length is now 10 seconds
pzhokhov Nov 18, 2020
2017caa
render in java
pzhokhov Nov 18, 2020
2ea9f9e
episode length 1200
pzhokhov Nov 19, 2020
a64c982
.
pzhokhov Nov 19, 2020
0178a88
remove warning about gui open
pzhokhov Nov 19, 2020
4155dbc
make hotbar configurable in equip env
pzhokhov Nov 19, 2020
89a8d45
wip
pzhokhov Nov 30, 2020
4742c29
got viewer to work, checked causality of inventory and hotbar buttons…
pzhokhov Dec 10, 2020
e0691eb
data rendering pipeline fixes an updates
pzhokhov Dec 11, 2020
e460d56
Merge branch 'peterz/human_action_space' of github.com:minerllabs/min…
pzhokhov Dec 11, 2020
5e1ae4e
fixes
pzhokhov Dec 12, 2020
6b1a072
Merge branch 'peterz/human_action_space' of github.com:minerllabs/min…
pzhokhov Dec 12, 2020
faa60e8
.
pzhokhov Dec 12, 2020
dd2a93f
update anvil jar
pzhokhov Dec 12, 2020
dff4972
.
pzhokhov Dec 12, 2020
66f4be5
Merge branch 'peterz/human_action_space' of github.com:minerllabs/min…
pzhokhov Dec 12, 2020
2f4cea5
.
pzhokhov Dec 12, 2020
58e8737
update render jar
pzhokhov Dec 12, 2020
f7b2b12
re-rendering pipeline
pzhokhov Dec 12, 2020
dc4d459
.
pzhokhov Dec 15, 2020
0507b31
pull latest master, resolve conflicts
pzhokhov Dec 15, 2020
fe63cce
update render jar, fake mouse
pzhokhov Jan 4, 2021
dfd03da
Merge branch 'dev' of github.com:minerllabs/minerl into peterz/human_…
pzhokhov Feb 1, 2021
cf5de27
remove debug port in java startup command
pzhokhov Feb 1, 2021
9b3013c
Merge branch 'dev' of github.com:minerllabs/minerl into peterz/human_…
pzhokhov Feb 1, 2021
06800ac
cleanups
pzhokhov Feb 1, 2021
2971892
.
pzhokhov Feb 1, 2021
ccc3abd
.
pzhokhov Feb 1, 2021
fb4f36b
.
pzhokhov Feb 1, 2021
e6698ee
.
pzhokhov Feb 1, 2021
2971d1b
grab video after rendering gui (or, rather, restore that logic)
pzhokhov Feb 1, 2021
551b59f
cleanups
pzhokhov Feb 2, 2021
9632e39
.
pzhokhov Feb 2, 2021
20c04d9
.
pzhokhov Feb 2, 2021
a6dc3a3
.
pzhokhov Feb 2, 2021
4c43ae6
propagate LowLevelInputs flag from python
pzhokhov Feb 2, 2021
6214ec8
use FakeMouse version from the recorder to enable drag-splitting
pzhokhov Feb 2, 2021
dfd3f42
reset changes in data/
pzhokhov Feb 2, 2021
2b32e48
cleanups
pzhokhov Feb 2, 2021
c7a765c
more cleanups
pzhokhov Feb 2, 2021
fc51e0b
more cleanups
pzhokhov Feb 2, 2021
052c322
.
pzhokhov Feb 2, 2021
a26f349
.
pzhokhov Feb 2, 2021
091f4d5
pep8
pzhokhov Feb 2, 2021
ef92e40
more pep8
pzhokhov Feb 2, 2021
29dd741
do not use gcs
pzhokhov Feb 2, 2021
4b8ad78
.
pzhokhov Feb 2, 2021
39cf9e9
merge dev
pzhokhov Feb 2, 2021
ece6b95
cleanups, trying to fix build
pzhokhov Feb 2, 2021
f108e3b
remove logic that denies block usage
pzhokhov Feb 3, 2021
91a9252
disable cursor
pzhokhov Feb 3, 2021
372f907
restore logic disabling right click
pzhokhov Feb 3, 2021
c82dafc
PR comments
pzhokhov Feb 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions minerl/Malmo/Minecraft/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ jar {

// And add to the jvm args so that it is also loaded when running using gradle runClient:
JavaExec exec = project.getTasks().getByName("runClient")
// exec.jvmArgs(["-Dfml.coreMods.load=com.microsoft.Malmo.OverclockingPlugin","-Xmx2G", "-Xdebug", "-Xrunjdwp:transport=dt_socket,address=127.0.0.1:8888,server=y,suspend=n"])
exec.jvmArgs(["-Dfml.coreMods.load=com.microsoft.Malmo.OverclockingPlugin","-Xmx2G"])
exec.jvmArgs(["-Dfml.coreMods.load=com.microsoft.Malmo.OverclockingPlugin","-Xmx2G", "-Xdebug", "-Dmixin.debug=true"])
ilge marked this conversation as resolved.
Show resolved Hide resolved
exec.args(["--tweakClass", "com.microsoft.Malmo.Launcher.tweakers.CoremodTweaker"])
// exec.jvmArgs(["-Dfml.coreMods.load=com.microsoft.Malmo.OverclockingPlugin","-Xmx2G"])
// ForgeGradle automatically sets the runClient task's outputs to be the runDir above (eg "run"). This
// means that gradle will helpfully try to take a snapshot of the complete contents of the run folder in order
// to carry out up-to-date checks for any tasks that depend on runClient.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.


// Disable the gui for the episode!
Minecraft.getMinecraft().gameSettings.hideGUI = true;

if (missionBehaviour.lowLevelInputs) {
Minecraft.getMinecraft().gameSettings.hideGUI = false;
Minecraft.getMinecraft().gameSettings.guiScale = 2;
Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
} else {
// Disable the gui for the episode!
Minecraft.getMinecraft().gameSettings.hideGUI = true;
}

for (IVideoProducer videoProducer : currentMissionBehaviour().videoProducers)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
package com.microsoft.Malmo.Client;

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.HashSet;
import java.util.Set;

public class FakeKeyboard {

private static Deque<FakeKeyEvent> eventQueue = new ArrayDeque<FakeKeyEvent>();
private static FakeKeyEvent currentEvent;
private static Set<Integer> keysDown = new HashSet<Integer>();

public static boolean next() {
currentEvent = eventQueue.poll();
return currentEvent != null;
}

public static int getEventKey() {
return currentEvent.key;
}

public static char getEventCharacter() {
System.out.println("FakeKeyboard - getEventChar is called ");
return currentEvent.character;
}

public static boolean getEventKeyState() {
return currentEvent.state;
}

public static long getEventNanoseconds() {
return currentEvent.nanos;
}

public static boolean isRepeatEvent() {
return currentEvent.repeat;
}

public static final class FakeKeyEvent {
/** The current keyboard character being examined */
private final char character;

/** The current keyboard event key being examined */
private final int key;

/** The current state of the key being examined in the event queue */
private final boolean state;

/** The current event time */
private long nanos;

/** Is the current event a repeated event? */
private boolean repeat;

public FakeKeyEvent(char character, int key, boolean state, long nanos, boolean repeat) {
this.character = character;
this.key = key;
this.state = state;
this.nanos = nanos;
this.repeat = repeat;
}

public FakeKeyEvent(char character, int key, boolean state) {
this(character, key, state, System.nanoTime(), false);
}

public FakeKeyEvent(char character, int key) {
this(character, key, true);
}

public FakeKeyEvent(int key) {
this((char) 0, key);
}

}

public static void press(int key) {
if (!keysDown.contains(key)) {
System.out.println("Pressed " + String.valueOf(key));
add(new FakeKeyEvent(' ', key, true));
}
}

public static void release(int key) {
if (keysDown.contains(key)) {
System.out.println("Released " + String.valueOf(key));
add(new FakeKeyEvent(' ', key, false));
}
}

public static void add(FakeKeyEvent event) {
eventQueue.add(event);
if (event.state) {
keysDown.add(event.key);
} else {
keysDown.remove(event.key);
}
}

public static boolean isKeyDown(int key) {
return keysDown.contains(key);
}
}
Loading