Delivery Robots and Destroyer Drones

11

5

Program your robots to deliver packages in a warehouse infested with destroyer drones. Avoid the drones and get your packages to the right place as fast as you can.

Delivery Robots

  • There are packages labeled a-z in a warehouse.
  • Packages must be delivered to a matching chute A-Z.
  • A robot cannot move to a square that contains a wall or another robot.
  • A robot passing over a package will pick it up if it is not holding a package.
  • A robot landing on a chute will drop their package if the package label matches the chute.

Destroyer Drones

  • Drones each start with a random heading.
  • If there is a clear line of sight to robots (NSEW), the drone will move toward the closest visible robot.
  • If in a dead end or blocked by another drone, the drone will reverse direction.
  • If at an intersection, a drone will choose a random direction (but not backtrack).
  • Otherwise, a drone will move on its current heading.
  • If a robot is ever in one of the four adjacent squares next to a destroyer drone, that robot is destroyed and disappears. If the robot had a package, it is dropped, replacing any package or chute already there.
  • Drones pass over packages.

Warehouse Arena

#################################################
#B             #             #   #      ff      #
############ ##### ######### # # # # ########## #
##### ###          efg*     ## # # #         C# #
#         # ## ############        ############ #
# ###### ## ##         ########## #####         #
#  de  # ## ## ################## ##### ## # ## #
###### # ##    ##      #      ###   ### ## # ## #
#      # ######## ########### ######### ## #  # #
# ######          #    A    #           ## ## # #
# ## ###### #### ## ####### ########### # aeb # #
# ##G       ###  ##    #    ##          ####### #
# ## ###### ### ### ####### ## ########         #
# ######### ### ###      *  ## #        #########
#  cfe   ## ### ####### ###### ########      ## #
######## ## ###     ### ######          ####    #
######## ## ### ### ### ############### ####### #
#               ### ### # # # # # #D# # #$$$$   #
# ###### ##########                     ##### # #
# ###### #### ##### ### ############### ###  ## #
#  #          ##    ###    ##gba        ###     #
# ## ### #### ## ## ### ############### ### #####
# ## ### # *        ### #                       #
# ###### ############## ############### ####### #
#            ########## ##      E  ##         # #
############ ###abc     ## ### ### ## ####### # #
#            ##### ####### ###     ##         # #
# # ######## ##### ####### ### ###### ######### #
# F #                           #     # ccc     #
#################################################

#: wall, $: delivery robot, *: destroyer drone, a-z: package, A-Z: delivery chute

Game Flow

Your program will be called with an arena file argument and MAXTURN integer. The program should follow the logic flow below.

read in arena
for turn in 1..MAXTURN
    for each robot
        optionally move robot to one of four adjacent squares
        if chute here and has matching package
            remove package from robot
            add to score
            if all packages delivered
                add turns bonus
                end game
        if next to drone
            delete robot
            reduce score
        if package here and robot has no package
            add package to robot
            remove package from square
    for each drone
        decide heading using specified rules
        move drone
        if next to any robots
            kill those robots
            drop packages onto map
    if no robots left
        end game

Output

Your program will output your score for that game.

Scoring

  • The test arena with MAXTURN=5000 will be used for scoring.
  • You score 500 points for each package delivered.
  • You lose 900 points for each robot destroyed.
  • The game ends if all robots are destroyed or MAXTURN turns elapse.
  • If you deliver all packages, you gain a bonus point for each turn you had remaining.

Your total score will be the sum of the scores of 3 consecutive games.

Your program must not assume this test arena. An arena my be up to 200x200 squares and contain thousands of packages, chutes, robots, and droids. If I suspect any submission to be tailored towards this specific arena, I reserve the right to replace it by a new arena. Standard loopholes are prohibited as usual.

Logic Knight

Posted 2015-01-10T14:36:50.227

Reputation: 6 622

6Whoa, a challenge of yours that doesn't contain an image. ;) I'm not sure it even matters, but did you check that it's even possible to deliver all 26 packages in 5000 turns with perfect movement ignoring drones? And I think in general it's a bit better for these challenges to provide a controller program, which takes care of stuff like the drones and valid implementation of the game rules, and let people only implement a program that returns the movement directions. That way you wouldn't have to check every single submission that the game is implemented correctly. – Martin Ender – 2015-01-10T15:52:58.677

I though I would branch out into non-image challenges, just to see if I could do them ;). I calculated an estimate for perfect deliveries and added a contingency factor - should be possible to complete. I did consider a controller, but I ended up with a program flow specification. The PPCG community is pretty good about following the rules. I hope some programmers try it out and have fun. – Logic Knight – 2015-01-10T16:06:39.400

2"The PPCG community is pretty good about following the rules." The PPCG community use to be known for its rule-lawyering, and while it's been moving away from that (fortunately), there are still some people around who like to find and exploit loopholes. (Just as a heads-up.) – Martin Ender – 2015-01-10T16:24:40.947

2The thing that bothers me in this challenge is that I have to write the algorithm for both bots and drones. Pretty sure I will be partial a bit. Also, it takes out the fun of writing the code for just the bots because the drones are pretty much rule bounded and there is no fun in writing them. This would be best served as a KOTH with a common arena for multiple bots trying to get the package at target in the least amount of moves without getting burned. – Optimizer – 2015-01-10T21:00:47.223

I like your idea for a KOTH challenge with multiple competing robot teams, and perhaps drones with free programming to make it really hard. I would make an entry for that. My challenge here is a bit different. The drone logic is carefully designed to encourage the robots to cooperate but not overwhelm them. Effective robot teams will distract drones when they get dangerously close to a vulnerable robot (eg: in a dead end passage). I am hoping to see some clever strategies. – Logic Knight – 2015-01-11T02:46:01.583

1That is just the kind of challenge I like, but I agree with Martin about the lack of controller. There are just too many details that would differ from one implementation to another, even trying to follow the specs in good faith. – None – 2015-01-14T15:47:39.733

No answers