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

BuildBattle reward handler is slow #593

Open
katja-hofmann opened this issue Sep 2, 2017 · 0 comments
Open

BuildBattle reward handler is slow #593

katja-hofmann opened this issue Sep 2, 2017 · 0 comments

Comments

@katja-hofmann
Copy link
Member

Server side evaluation of RewardForStructureCopying is slow. As a result, agents may take several steps after completing a task, leading to unpredictable task success.

Example XML shown below. An action sequence that solves this task is turn -1, move 1, move 1, turn 1, use 1 but this solution fails intermittently (at least when overclocking).

Tested on Malmo-0.21.0 and Malmo-0.30.0.

<?xml version="1.0" ?>
<Mission xmlns="http://ProjectMalmo.microsoft.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ProjectMalmo.microsoft.com Mission.xsd">
    <About>
        <Summary> Build Battle where the task is to copy a built cuboid structure in a defined area. </Summary>
    </About>
    <ModSettings>
        <MsPerTick>1</MsPerTick>
        <PrioritiseOffscreenRendering>true</PrioritiseOffscreenRendering>
    </ModSettings>
    <ServerSection>
        <ServerInitialConditions>
            <Time>
                <StartTime> 1000 </StartTime>
                <AllowPassageOfTime> false </AllowPassageOfTime>
            </Time>
            <Weather>clear</Weather>
            <AllowSpawning> false </AllowSpawning>
        </ServerInitialConditions>
        <ServerHandlers>
            <FlatWorldGenerator forceReset="true" generatorString="0;80;0"/>
            <DrawingDecorator>
                <DrawCuboid type="air" x1="-2" x2="3" y1="0" y2="6" z1="-2" z2="5"/>
                <DrawCuboid type="sea_lantern" x1="-2" x2="3" y1="0" y2="0" z1="-2" z2="5"/>
                <DrawCuboid type="sandstone" x1="0" x2="1" y1="0" y2="0" z1="0" z2="3"/>
                <DrawCuboid type="sea_lantern" x1="-2" x2="3" y1="6" y2="6" z1="-2" z2="5"/>
                <DrawCuboid type="sea_lantern" x1="-2" x2="-2" y1="0" y2="6" z1="-2" z2="5"/>
                <DrawCuboid type="sea_lantern" x1="-2" x2="3" y1="0" y2="6" z1="-2" z2="-2"/>
                <DrawCuboid type="sea_lantern" x1="-2" x2="3" y1="0" y2="6" z1="5" z2="5"/>
                <DrawCuboid type="sea_lantern" x1="3" x2="3" y1="0" y2="6" z1="-2" z2="5"/>
                <DrawBlock type="air" x="0" y="3" z="0"/>
                <DrawBlock type="air" x="0" y="3" z="1"/>
                <DrawBlock type="air" x="0" y="3" z="2"/>
                <DrawBlock type="air" x="0" y="3" z="3"/>
                <DrawBlock type="lapis_block" x="1" y="3" z="0"/>
                <DrawBlock type="lapis_block" x="1" y="0" z="0"/>
                <DrawBlock type="air" x="1" y="3" z="1"/>
                <DrawBlock type="air" x="1" y="3" z="2"/>
                <DrawBlock type="air" x="1" y="3" z="3"/>
                <DrawBlock type="air" x="0" y="1" z="0"/>
                <DrawBlock type="air" x="0" y="1" z="1"/>
                <DrawBlock type="air" x="0" y="1" z="2"/>
                <DrawBlock type="air" x="0" y="1" z="3"/>
                <DrawBlock type="air" x="1" y="1" z="0"/>
                <DrawBlock type="air" x="1" y="1" z="1"/>
                <DrawBlock type="air" x="1" y="1" z="2"/>
                <DrawBlock type="air" x="1" y="1" z="3"/>
            </DrawingDecorator>
            <BuildBattleDecorator>
                <PlayerStructureBounds>
                    <min x="0" y="1" z="0"/>
                    <max x="1" y="1" z="3"/>
                </PlayerStructureBounds>
                <GoalStructureBounds>
                    <min x="0" y="3" z="0"/>
                    <max x="1" y="3" z="3"/>
                </GoalStructureBounds>
                <BlockTypeOnCorrectPlacement type="wool"/>
                <BlockTypeOnIncorrectPlacement type="obsidian"/>
            </BuildBattleDecorator>
            <ServerQuitFromTimeUp description="out_of_time" timeLimitMs="150000"/>
            <ServerQuitWhenAnyAgentFinishes/>
        </ServerHandlers>
    </ServerSection>
    <AgentSection mode="Creative">
        <Name>Builder</Name>
        <AgentStart>
            <Placement pitch="55.0" x="-0.5" y="2" yaw="0.0" z="-0.5"/>
            <Inventory>
                <InventoryBlock quantity="20" slot="0" type="lapis_block"/>
            </Inventory>
        </AgentStart>
        <AgentHandlers>
            <DiscreteMovementCommands/>
            <ObservationFromFullStats/>
            <AgentQuitFromReachingCommandQuota description="Command quota reached." total="100"/>
            <RewardForSendingCommand dimension="0" reward="-1"/>
            <RewardForStructureCopying rewardScale="1" rewardForCompletion="10">
                <RewardDensity>PER_BLOCK</RewardDensity>
                <AddQuitProducer description="Build successful!"/>
            </RewardForStructureCopying>
        </AgentHandlers>
    </AgentSection>
</Mission>
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

No branches or pull requests

1 participant