Interface for PAMIQ to interact with VRChat
Project description
PAMIQ VRChat
Interface for PAMIQ to interact with VRChat.
✨ Features
- Visual Input: Capture VRChat gameplay through OBS virtual camera with the
ImageSensor - Mouse Control: Simulate mouse movements and clicks with natural-feeling transitions using
MouseActuatorandSmoothMouseActuator - Avatar Control: Send OSC commands to VRChat for avatar movement, jumping, and actions via
OscActuatorandSmoothOscActuator - Smooth Transitions: Natural-feeling controls with gradual acceleration and realistic button timings
- PAMIQ Integration: Seamlessly works with PAMIQ-Core for AI agent development
📦 Installation
[!NOTE] If Linux 🐧 user, install inputtino first which is a required dependency.
# Install via pip
pip install pamiq-vrchat
# Install from source
git clone https://github.com/MLShukai/pamiq-vrchat.git
cd pamiq-vrchat
pip install .
🛠️ Setup VRChat Environment
Prerequisites
- Linux or Windows machine with Desktop environment.
- Machine capable of running VRChat
Install Steam
Download and install Steam from the official website.
(🐧 Linux User Only) Enable Proton
Open Steam → Settings → Compatibility and enable Enable Steam Play for all other titles.
(Optional) Install Proton GE
If you want to use video players in VRChat on Linux, install Proton GE.
After installation, select GE-Proton as the compatibility tool in Steam → Settings → Compatibility under Run other titles with:.
Install VRChat
Add VRChat to your library from the Steam store and install it.
After install, launch VRChat and login.
Setup OBS
For OBS installation and virtual camera setup, refer to pamiq-io documentation.
[!NOTE] The
Output (Scaled) ResolutionandFPS Valuein OBS Video settings will affect the output of theImageSensorclass.
Capture the VRChat window in OBS and enable the virtual camera.
You can also use our pre-configured Scene Collection. Import it from the OBS Scene Collection tab → Import, and ensure the checkbox is checked.
Enable OSC
- Open the "Launch Pad" (press the
Esckey) - Go to the main menu
- Open settings (click the ⚙️ icon)
- Click
Search all settingsand type "OSC", then press Enter - Enable the
OSCbutton
🚀 Quick Examples
Image Sensor
from pamiq_vrchat.sensors import ImageSensor
# Connect to OBS virtual camera automatically
sensor = ImageSensor()
# Or specify a camera index
# sensor = ImageSensor(camera_index=0)
# (Windows only) you can specify width and height
# sensor = ImageSensor(width=1920, height=1080)
# Capture a frame
frame = sensor.read()
# frame is a numpy array with shape (height, width, channels)
Mouse Control
[!NOTE] When using mouse control, remember to keep the VRChat game window focused (selected) on your desktop.
from pamiq_vrchat.actuators import MouseActuator, MouseButton, SmoothMouseActuator
# Basic mouse control
mouse = MouseActuator()
# Move mouse at 100 pixels/sec horizontally, 50 pixels/sec vertically
mouse.operate({"move_velocity": (100.0, 50.0)})
# Click the left button
mouse.operate({"button_press": {MouseButton.LEFT: True}})
# Release the left button
mouse.operate({"button_press": {MouseButton.LEFT: False}})
# Smooth mouse control with gradual acceleration and natural-feeling clicks
smooth_mouse = SmoothMouseActuator(
delta_time=0.05, # Update interval
time_constant=0.2, # Movement smoothing
press_delay=0.05, # Button press delay
release_delay=0.1 # Button release delay
)
smooth_mouse.operate({"move_velocity": (100.0, 50.0)})
OSC Avatar Control
from pamiq_vrchat.actuators import OscActuator, OscAxes, OscButtons, SmoothOscActuator
# Basic OSC control
osc = OscActuator()
# Move forward
osc.operate({"axes": {OscAxes.Vertical: 1.0}})
# Jump
osc.operate({"buttons": {OscButtons.Jump: True}})
# Move forward while running
osc.operate({
"axes": {OscAxes.Vertical: 1.0},
"buttons": {OscButtons.Run: True}
})
# Smooth OSC control for more natural movement
smooth_osc = SmoothOscActuator(
delta_time=0.05, # Update interval
time_constant=0.2, # Axis value smoothing
press_delay=0.05, # Button press delay
release_delay=0.1 # Button release delay
)
smooth_osc.operate({"axes": {OscAxes.Vertical: 0.5}})
🎮 Running the Sample Project
After setting up VRChat environment and cloning this repository, you can run the sample project. It trains an agent that interacts with VRChat.
-
For Linux Users
# Run the sample ./run-sample.linux.sh -
For Windows Users
# Run the sample (in PowerShell) .\Run-Sample.Windows.ps1
These scripts will:
- Check and install dependencies automatically
- Verify CUDA availability
- Check if VRChat and OBS are running
- Start the keyboard control interface (
pamiq-kbctl) - Launch the autonomous learning agent
[!IMPORTANT] Mouse Control Notice: When the agent starts, it will take control of your mouse for VRChat interaction. To pause the system, press
Alt+Shift+P. This is essential for regaining mouse control when needed.
For detailed implementation, see src/run_sample.py which contains the architecture, hyperparameters and training procedure.
🤝 Contributing
See our Contributing Guide for details on how to set up the development environment and contribute to the project.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pamiq_vrchat-0.1.0.tar.gz.
File metadata
- Download URL: pamiq_vrchat-0.1.0.tar.gz
- Upload date:
- Size: 465.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2065144e4d12456f02aa290774caba25b0298d302d581dd7c673fd6a0ce45ba8
|
|
| MD5 |
a799beee271dbc281deea2cde7bf967e
|
|
| BLAKE2b-256 |
c8c30b98392681cebd30544ed9ed2bbb0ba24dfebb4f9d9a8470f6205c9e7c43
|
Provenance
The following attestation bundles were made for pamiq_vrchat-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on MLShukai/pamiq-vrchat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pamiq_vrchat-0.1.0.tar.gz -
Subject digest:
2065144e4d12456f02aa290774caba25b0298d302d581dd7c673fd6a0ce45ba8 - Sigstore transparency entry: 224987069
- Sigstore integration time:
-
Permalink:
MLShukai/pamiq-vrchat@b331fff47b8c71cda7d63b33a08ce364bd57ba8e -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/MLShukai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@b331fff47b8c71cda7d63b33a08ce364bd57ba8e -
Trigger Event:
push
-
Statement type:
File details
Details for the file pamiq_vrchat-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pamiq_vrchat-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10cc93fa4460028b985a2b148b584e31bb0c65ae888b5ffda17afeb620619e3e
|
|
| MD5 |
08b1cfc6fd6c6557f4fd8a8b2f560613
|
|
| BLAKE2b-256 |
4e53f941e219c1235f0b5bb7ed98570872c345713474fa472dab7121a234e0df
|
Provenance
The following attestation bundles were made for pamiq_vrchat-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on MLShukai/pamiq-vrchat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pamiq_vrchat-0.1.0-py3-none-any.whl -
Subject digest:
10cc93fa4460028b985a2b148b584e31bb0c65ae888b5ffda17afeb620619e3e - Sigstore transparency entry: 224987099
- Sigstore integration time:
-
Permalink:
MLShukai/pamiq-vrchat@b331fff47b8c71cda7d63b33a08ce364bd57ba8e -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/MLShukai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@b331fff47b8c71cda7d63b33a08ce364bd57ba8e -
Trigger Event:
push
-
Statement type: