# Uncomment this if you want the test character # g.add_character(InteractiveCharacter("me", # name # "C", # avatar # 0, 0 # position # )) # Uncomment this if you want the interactive character # g.add_character(TestCharacter("me", "C", 0, 0, # nn_file="model.pickle",eps=0,explore=False)) from specialopscharacter import SpecialOpsCharacter # weights = {'__goal_dist_score': 53.012209846051945, '__distance_to_monster': 14.332240246509578, '__goal_to_monster_ratio': -16.678503789000597} weights = { '__goal_dist_score': 10.0157139736459162, '__distance_to_monster': 19.356608344043547, '__goal_to_monster_ratio': -10.899725942090054, '__goal_distance_as_crow': 1.7205125700525967, '__bomb_threats': 95.26731497713193, '__goal_dist_obstructed_score': 1.0157139736459162 } g.add_character(SpecialOpsCharacter("specops", "C", 0, 0, weights=weights)) # Run! # Use this if you want to press ENTER to continue at each step #g.go(0) # Use this if you want to proceed automatically g.go(1)
3, 5, # position )) g.add_monster( SelfPreservingMonster( "aggressive", # name "A", # avatar 3, 13, # position 2 # detection range )) g.add_character( SpecialOpsCharacter( "me", # name "C", # avatar 0, 0 # position , weights={ '__goal_dist_score': 100.0157139736459162, '__distance_to_monster': 90.356608344043547, '__goal_to_monster_ratio': -1.899725942090054, '__goal_distance_as_crow': 1.7205125700525967, '__bomb_threats': 95.26731497713193, '__goal_dist_obstructed_score': 1.0157139736459162 })) # Run! g.go(1)
# Create the game random.seed( time.time()) # TODO Change this if you want different random choices # TODO Change this if you want different random choices g = Game.fromfile('map.txt') g.add_monster(StupidMonster( "stupid", # name "S", # avatar 3, 9 # position )) # TODO Add your character # weights = {'__goal_dist_score': 53.012209846051945, '__distance_to_monster': 14.332240246509578, '__goal_to_monster_ratio': -16.678503789000597} #weights = {'__goal_dist_score': 19.63618900838964, '__distance_to_monster': 10.294196640723415, '__goal_to_monster_ratio': -14.866932303600555, '__goal_distance_as_crow': -6.017510630677442, '__bomb_threats': -1.8075836853346297} #weights = {'__goal_dist_score': 7.99835006713818, '__distance_to_monster': 1.3746297279276296, '__goal_to_monster_ratio': -8.961974001273859, '__goal_distance_as_crow': -6.69759158412074, '__bomb_threats': -10.809530207008228} weights = { '__goal_dist_score': 10.0157139736459162, '__distance_to_monster': 19.356608344043547, '__goal_to_monster_ratio': -10.899725942090054, '__goal_distance_as_crow': 1.7205125700525967, '__bomb_threats': 95.26731497713193, '__goal_dist_obstructed_score': 1.0157139736459162 } g.add_character(SpecialOpsCharacter("me", "C", 0, 0, weights=weights)) # Run! g.go(1)
# )) ''' g.add_monster(StupidMonster("stupid", # name "S", # avatar 3, 5, # position )) g.add_monster(SelfPreservingMonster("aggressive", # name "A", # avatar 3, 13, # position 2 # detection range )) ''' our_char = SpecialOpsCharacter("me", "C", sx, sy, eps=0 if not training else eps, weights=weights) g.add_character(our_char) # Run! g.go(0 if interactive else 1) games += 1 # decrease epsilon if eps > 0: eps *= 0.99 elif eps < 0: eps = 0