All Projects â†’ vinceau â†’ slp-realtime

vinceau / slp-realtime

Licence: MIT license
Realtime slp parsing library focused on speed and efficiency.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to slp-realtime

smashtierlist
🎮⚡️ Popular tier lists for Super Smash Bros. series
Stars: ✭ 40 (+33.33%)
Mutual labels:  smash, melee, ssbm
slippi-db
🐸 Make sense of your gigabytes of Slippi files.
Stars: ✭ 19 (-36.67%)
Mutual labels:  ssbm, slippi
fastapi websocket pubsub
A fast and durable Pub/Sub channel over Websockets. FastAPI + WebSockets + PubSub == ⚡ 💪 ❤️
Stars: ✭ 255 (+750%)
Mutual labels:  realtime
FastPose
pytorch realtime multi person keypoint estimation
Stars: ✭ 36 (+20%)
Mutual labels:  realtime
rtmidi2
python bindings to rtmidi allowing to listen to multiple ports simultaneously
Stars: ✭ 16 (-46.67%)
Mutual labels:  realtime
barracuda-style-transfer
Companion code for the Unity Style Transfer blog post, showcasing realtime style transfer using Barracuda.
Stars: ✭ 126 (+320%)
Mutual labels:  realtime
SSE-Github
This repository contains the demo app for the blog
Stars: ✭ 17 (-43.33%)
Mutual labels:  realtime
UnityRaymarching
raymarching experiment in unity
Stars: ✭ 73 (+143.33%)
Mutual labels:  realtime
monitor
Community restock monitor template
Stars: ✭ 78 (+160%)
Mutual labels:  realtime
coolplayflink
Flink: Stateful Computations over Data Streams
Stars: ✭ 14 (-53.33%)
Mutual labels:  realtime
tipoca-stream
Near real time cloud native data pipeline in AWS (CDC+Sink). Hosts code for RedshiftSink. RDS to RedshiftSink Pipeline with masking and reloading support.
Stars: ✭ 43 (+43.33%)
Mutual labels:  realtime
tideflow
Building extensible automation. Tideflow is a Realtime, open source workflows execution and monitorization web application.
Stars: ✭ 101 (+236.67%)
Mutual labels:  realtime
AntSimulator
Simple Ants simulator
Stars: ✭ 1,939 (+6363.33%)
Mutual labels:  realtime
UPPERCASE
실시간성에 특화된 풀스택 프레임워크 ✨
Stars: ✭ 30 (+0%)
Mutual labels:  realtime
clutch
No description or website provided.
Stars: ✭ 14 (-53.33%)
Mutual labels:  realtime
MobilePose
Light-weight Single Person Pose Estimator
Stars: ✭ 588 (+1860%)
Mutual labels:  realtime
ngrx-realtime-app
Demo to build a realtime Angular app with a Vert.x backend and distributed event bus
Stars: ✭ 45 (+50%)
Mutual labels:  realtime
CanSat-Ground-station
Code for a CanSat or OBCs GUI ground station where different sensor data are displayed in real time. No sensors needed to try it.
Stars: ✭ 55 (+83.33%)
Mutual labels:  realtime
microbium-app
Draw new worlds
Stars: ✭ 89 (+196.67%)
Mutual labels:  realtime
py-mongo-sync
Oplog-based data sync tool that synchronizes data from a replica set to another deployment, e.g.: standalone, replica set, and sharded cluster.
Stars: ✭ 102 (+240%)
Mutual labels:  realtime

slp-realtime

slp-realtime is magic - Nikki

npm version Build Status Coverage Status License

The brains and the brawn of Project Clippi.

This library provides an easy way to subscribe to real-time Slippi game events as they happen. Rebuilt from the ground up using RxJS Observables, the power to subscribe to any and every event is in your hands.

Highlights

  • Go file-less. Read directly from Slippi Dolphin, the relay, or a console.
  • Custom combos. Easily add combo parameters and output Dolphin-compatible JSON files.
  • Powerful RxJS Observable and Stream API.

Installation

This package relies on the rxjs and @slippi/slippi-js packages as a peer dependency and must be installed alongside this package.

With NPM

npm install @vinceau/slp-realtime rxjs @slippi/slippi-js

With Yarn

yarn add @vinceau/slp-realtime rxjs @slippi/slippi-js

Usage

See a working example or check out the docs.

For a list of all the subscribable events, click here.

Subscribing to In-Game Events

We can use this library to subscribe to in game events.

First instantiate an instance of SlpLiveStream and connect to a Wii or Slippi relay.

const { SlpLiveStream } = require("@vinceau/slp-realtime");

const livestream = new SlpLiveStream();
livestream
  .start(address, slpPort)
  .then(() => {
    console.log("Successfully connected!");
  })
  .catch(console.error);

Then instantiate an instance of SlpRealTime and pass the SlpLiveStream to it. We will use it to subscribe to desired events. For example:

const { SlpRealTime } = require("@vinceau/slp-realtime");

const realtime = new SlpRealTime();
// Read from the SlpLiveStream object from before
realtime.setStream(livestream);

realtime.game.start$.subscribe(() => {
  console.log("game started");
});

realtime.stock.playerSpawn$.subscribe((stock) => {
  const { playerIndex, count } = stock;
  console.log(`player ${playerIndex + 1} spawned with ${count} stocks remaining`);
});

realtime.combo.end$.subscribe(() => {
  console.log("wombo combooo!!");
});

Detecting Custom Combos

We can subscribe to the end of any and every combo but really what we want is to filter for specific combos.

First, instantiate a ComboFilter. For all the possible filtering options, see ComboFilterSettings.

const { ComboFilter } = require("@vinceau/slp-realtime");

const comboFilter = new ComboFilter();
comboFilter.updateSettings({
  excludeCPUs: false, // combos on CPUs are okay
  comboMustKill: false, // combos don't have to kill
  minComboPercent: 40, // combos have to do at least 40% damage
});

ComboFilter has an isCombo() method which returns true if a given combo matches the specified criteria. We can hook it up to our live stream with the following:

realtime.combo.end$.subscribe((payload) => {
  const { combo, settings } = payload;
  if (comboFilter.isCombo(combo, settings)) {
    console.log("Combo matched!");
  }
});

Make a Custom HUD

Want to make your own HUD?

  1. Subscribe to percent and stock changes
  2. Write the data to a file
  3. Add files to OBS
  4. ???
  5. Profit!!
realtime.stock.percentChange$.subscribe((payload) => {
  const player = payload.playerIndex + 1;
  console.log(`player ${player} percent: ${payload.percent}`);
  fs.writeFileSync(`./player${player}Percent.txt`, payload.percent.toFixed(0));
});

realtime.stock.countChange$.subscribe((payload) => {
  const player = payload.playerIndex + 1;
  console.log(`player ${player} stocks: ${payload.stocksRemaining}`);
  fs.writeFileSync(`./player${player}Stocks.txt`, payload.stocksRemaining.toString());
});

NOTE: Please don't actually do this for real custom HUDs. Writing to files is slow and OBS takes a long time to update after file changes. If you actually want to build a custom layout for OBS you should use a browser source and send updates using websockets instead of writing data to a file.

Setup on WSL

If you're running the Node project inside Windows Subsystem for Linux and running Dolphin or a relay in Windows, setup requires a couple extra steps:

  1. Change the address passed to livestream.start to the one listed in /etc/resolv.conf instead of localhost (see here)

  2. Add a firewall rule allowing access from WSL (see here)

Development

To build the library from source:

yarn run build

To start the development server:

yarn run watch

To run the tests:

yarn run test

Acknowledgements

This project was made possible by:

License

This software is released under the terms of MIT license.

Linking back to this Github repo is much appreciated.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].