microsoft / malmo

Project Malmo is a platform for Artificial Intelligence experimentation and research built on top of Minecraft. We aim to inspire a new generation of research into challenging new problems presented by this unique environment. --- For installation instructions, scroll down to *Getting Started* below, or visit the project page for more information:
https://www.microsoft.com/en-us/research/project/project-malmo/
MIT License
4.09k stars 600 forks source link

DiscreteMovementCommand Attack command breaks all blocks #742

Open SamNPowers opened 6 years ago

SamNPowers commented 6 years ago

It would be very convenient if there were some block type that the attack action in the Discrete Movement set was unable to break, for the purposes of setting up permanent maze boundaries and the like. Or perhaps there is a way to configure this, that I was unable to find?

In particular, I was somewhat surprised to find I could break bedrock.

I was able to work around it by using a line of sight check, but it just seems like maybe there should be a cleaner way?

okkhoy commented 6 years ago

Maybe you can try something like this: <DiscreteMovementCommands> <ModifierList type="deny-list"> <command>attack</command> </ModifierList> </DiscreteMovementCommands> <ContinuousMovementCommands> <ModifierList type="allow-list"> <command>attack</command> </ModifierList> </ContinuousMovementCommands>

That enables all but the attack command for the discrete command handler and disables all but the attack command for the continuous command handler.

To start attacking, send "attack 1"; to stop, send "attack 0" - it acts like pressing and releasing the attack key, and all the Minecraft attack logic will come into play - so you can hurt pigs, and you won't be able to remove bedrock blocks.

SamNPowers commented 6 years ago

Somewhat surprisingly, that seems to have broken turning. My agents now appear like they start to turn, but they're only ever facing South.

If I keep the deny-list in place for discrete movements, but remove the ContinuousMovementCommands section entirely, this stops happening, and my agents begin to actually turn again.

The commands I'm issuing are "turn 1" and "turn -1".