This guide shows how to connect the 3D Simulator to your OpenFunscripter installation.
The 3D Simulator connects to OpenFunscripter via WebSocket API:
- OFS runs a WebSocket server at
ws://127.0.0.1:8080/ofs - Simulator3D connects as a client to receive real-time script data
- They communicate using the
ofs-api.jsonprotocol
The simulator receives:
- Current playback position
- Playing/paused state
- Funscript data for all axes (stroke, roll, pitch, twist, sway, surge)
- Real-time updates synchronized with video playback
- OpenFunscripter installed and running
- OFS_Simulator3D built for macOS (see BUILD_MACOS.md)
- Launch OpenFunscripter
- Go to Options or Preferences menu
- Look for WebSocket API or Network settings
- Enable the WebSocket server
- Verify the port is set to 8080 (default)
Note: The WebSocket server should start automatically when OFS launches. You can verify it's running by checking if OFS is listening on port 8080.
cd /path/to/OFS_Simulator3D
# Run setup script
./setup-macos.sh
# Open in Godot and export for macOS
open -a Godot_mono.app project.godot
# Then: Project → Export → macOS → Export ProjectOption 1: Default Connection (Automatic)
# The simulator will automatically connect to ws://127.0.0.1:8080/ofs
open FunscriptSimulator3D.appOption 2: Custom WebSocket URL
If your OFS is running on a different port or machine:
# From terminal with custom WebSocket URL
open FunscriptSimulator3D.app --args "ws://localhost:9090/ofs"
# Or for remote OFS instance
open FunscriptSimulator3D.app --args "ws://192.168.1.100:8080/ofs"When the simulator launches, you should see:
In the Simulator window:
- Top-left status: "Connected to ws://127.0.0.1:8080/ofs" ✓
- If connection fails: "Trying to connect to ws://127.0.0.1:8080/ofs"
In OFS:
- Check the OFS log/console for "WebSocket client connected"
- The simulator should respond to script playback in real-time
- In OFS, load a funscript and video
- Press Play
- The 3D Simulator should:
- Show the stroker moving in sync with the script
- Follow all axis movements (stroke, twist, roll, pitch, etc.)
- Update in real-time as you scrub through the video
Problem: Simulator can't connect to OFS WebSocket server
Solutions:
-
Check OFS WebSocket is enabled:
- Open OFS preferences
- Verify WebSocket API is enabled
- Check the port is 8080
-
Check OFS is running:
- OFS must be launched before the simulator
- The WebSocket server starts with OFS
-
Check port availability:
# Check if port 8080 is in use lsof -i :8080 # Should show OFS process listening on port 8080
-
Firewall blocking connection:
- Go to System Settings → Network → Firewall
- Allow OpenFunscripter to accept incoming connections
Problem: Connection established but simulator doesn't respond to playback
Solutions:
-
Load a funscript in OFS:
- The simulator needs an active script to visualize
- Load a .funscript file or create actions
-
Check script is playing:
- Press Play in OFS
- Verify video playback is active
-
Check script axes:
- The simulator supports: stroke (L0), twist (R0), roll (R1), pitch (R2), surge (L1), sway (L2)
- Make sure your script has data for these axes
Problem: Simulator disconnects during use
Solutions:
-
Check network stability:
- Even localhost connections can have issues
- Restart both OFS and the simulator
-
Check OFS logs:
- Look for WebSocket errors or timeout messages
- May indicate OFS is overloaded or crashing
-
Reduce WebSocket buffer size:
- In the simulator's
project.godot: network/limits/websocket_client/max_in_buffer_kb=1048576- Try reducing if memory issues occur
- In the simulator's
You can run multiple simulators connected to one OFS instance:
# Launch first simulator
open FunscriptSimulator3D.app
# Launch second simulator (they'll both connect to the same OFS)
open -n FunscriptSimulator3D.appAll connected simulators will receive the same script data simultaneously.
If you need to change the WebSocket port:
In OFS:
- Edit OFS preferences/config file
- Change WebSocket port from 8080 to your desired port
In Simulator:
# Launch with custom port
open FunscriptSimulator3D.app --args "ws://127.0.0.1:YOUR_PORT/ofs"You can connect the simulator to OFS running on another computer:
-
On the OFS machine:
- Enable WebSocket API
- Note the local IP address (e.g., 192.168.1.100)
- Ensure firewall allows incoming connections on port 8080
-
On the Simulator machine:
open FunscriptSimulator3D.app --args "ws://192.168.1.100:8080/ofs"
If you want to change the default WebSocket URL permanently:
- Open the project in Godot
- Select the
Simulator3Dnode in the scene tree - In the Inspector panel, find:
- Script Variables → WsSocketUrl
- Change to your desired URL
- Re-export the project
If you're using the OFS FunGen Edition (macOS ARM64 optimized):
-
Both OFS and the simulator support native ARM64
-
Build both for ARM64 for best performance:
- OFS: Use
build-macos.shwith default settings - Simulator: Export as ARM64 from Godot
- OFS: Use
-
They will communicate via WebSocket just like the standard version
The simulator uses the OFS WebSocket API to receive:
- Playback events: Play, pause, seek
- Script changes: Add, remove, update funscripts
- Current time: Synchronized playback position
- Script data: Action points for all axes
For developers wanting to extend the simulator or create custom integrations, refer to the OFS WebSocket API documentation.
- Launch OFS with WebSocket API enabled (port 8080)
- Launch Simulator - it auto-connects to
ws://127.0.0.1:8080/ofs - Load and play a funscript in OFS
- Watch the 3D simulator respond in real-time
The setup is automatic - just ensure both applications are running!