Giter Site home page Giter Site logo

py-slippi's Introduction

py-slippi

Py-slippi is a Python parser for .slp game replay files for Super Smash Brothers Melee for the Nintendo GameCube. These replays are generated by Jas Laferriere's Slippi recording code, which runs on a GameCube or the Dolphin emulator.

Installation

Requires Python >= 3.6. To install, run the following command (optionally inside a virtual environment):

pip install py-slippi

Usage

Reading from a replay file:

>>> from slippi import Game
>>> game = Game('test/replays/game.slp')
>>> game.metadata
Metadata(date=2018-06-22 07:52:59+00:00, duration=5086, platform=Platform.DOLPHIN, players=(Player(characters={InGameCharacter.MARTH: 5086}), Player(characters={InGameCharacter.FOX: 5086}), None, None))
>>> game.start
Start(is_teams=False, players=(Player(character=CSSCharacter.MARTH, costume=3, stocks=4, team=None, type=Type.HUMAN, ucf=UCF(dash_back=False, shield_drop=False)), Player(character=CSSCharacter.FOX, costume=0, stocks=4, team=None, type=Type.CPU, ucf=UCF(dash_back=False, shield_drop=False)), None, None), random_seed=3803194226, slippi=Slippi(version=1.0.0.0), stage=Stage.YOSHIS_STORY)
>>> game.end
End(method=Method.CONCLUSIVE)
>>> game.frames[0]
Frame(index=-123, ports=(Port(follower=None, leader=Data(post=Post(character=InGameCharacter.MARTH, combo_count=0, damage=0.00, direction=Direction.RIGHT, last_attack_landed=None, last_hit_by=None, position=(-31.94, 0.00), shield=59.66, state=ActionState.LANDING, state_age=7.00, stocks=4), pre=Pre(buttons=Buttons(logical=Logical.NONE, physical=Physical.NONE), cstick=(0.00, 0.00), direction=Direction.RIGHT, joystick=(0.00, 0.00), position=(-32.08, 0.00), random_seed=1373931959, state=ActionState.LANDING, triggers=Triggers(logical=0.00, physical=Physical(l=0.00, r=0.00))))), Port(follower=None, leader=Data(post=Post(character=InGameCharacter.FOX, combo_count=0, damage=0.00, direction=Direction.LEFT, last_attack_landed=None, last_hit_by=None, position=(9.96, 53.35), shield=60.00, state=ActionState.JUMP_F, state_age=19.00, stocks=4), pre=Pre(buttons=Buttons(logical=Logical.NONE, physical=Physical.NONE), cstick=(0.00, 0.00), direction=Direction.LEFT, joystick=(-0.99, 0.00), position=(10.78, 54.04), random_seed=1373931959, state=ActionState.JUMP_F, triggers=Triggers(logical=0.00, physical=Physical(l=0.00, r=0.00))))), None, None))

Iterating over frame data:

for frame in game.frames:
    data = frame.ports[0].leader # see also: port.follower (ICs)
    print(data.post.state) # character's post-frame action state

API Docs

See the Module Index for detailed API docs, starting with slippi.game.

py-slippi's People

Contributors

hohav avatar nikhilnarayana avatar

Watchers

James Cloos avatar Johan Backman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.