def test_framedata(self): """ Test that frame and stage data retreive correctly """ framedata = melee.FrameData() self.assertTrue(framedata.is_attack(melee.Character.FALCO, melee.Action.DAIR)) self.assertFalse(framedata.is_attack(melee.Character.FALCO, melee.Action.STANDING))
parser.add_argument('--connect_code', '-t', default="", help='Direct connect code to connect to in Slippi Online') args = parser.parse_args() # This logger object is useful for retroactively debugging issues in your bot # You can write things to it each frame, and it will create a CSV file describing the match log = None if args.debug: log = melee.Logger() # This frame data object contains lots of helper functions and values for looking up # various Melee stats, hitboxes, and physics calculations framedata = melee.FrameData(args.framerecord) # Create our Console object. # This will be one of the primary objects that we will interface with. # The Console represents the virtual or hardware system Melee is playing on. # Through this object, we can get "GameState" objects per-frame so that your # bot can actually "see" what's happening in the game console = melee.Console(path=args.dolphin_executable_path, slippi_address=args.address, slippi_port=51441, blocking_input=False, logger=log) # Dolphin has an optional mode to not render the game's visuals # This is useful for BotvBot matches console.render = True
import melee import config import signal import sys if config.debug: log = melee.Logger() framedata = melee.FrameData(config.framerecord) console = melee.Console(path=config.dolphin_executable_path, slippi_address=config.address, slippi_port=51441, blocking_input=False, logger=config.log) console.render = True controller = melee.Controller(console=console, port=config.port, type=melee.ControllerType.STANDARD) controller_opponent = melee.Controller(console=console, port=config.opponent_port, type=melee.ControllerType.GCN_ADAPTER) # This isn't necessary, but makes it so that Dolphin will get killed when you ^C def signal_handler(sig, frame): console.stop() if config.debug: log.writelog() print("") # because the ^C will be on the terminal print("Log file created: " + log.filename)