* WIP: NPC animation local playback
Add NpcAnimCatalog and NpcAnimPlayer for playing NPC interaction
animations directly on player ROIs in multiplayer, bypassing the
singleplayer streaming pipeline.
- NpcAnimCatalog: reads animation entries from LegoAnimationManager
with eligibility filtering per actor
- NpcAnimPlayer: minimal SI file reader (header + offset table only,
then single MxSt read per object), extracts animation/audio/phoneme
data from ISLE.SI composite objects
- Skeletal animation with position rebasing (absolute world coords
converted to player-relative deltas)
- Audio via LegoCacheSound with proper WaveFormat parsing from SI
chunks, wall-clock sync via SDL_GetTicks
- Phoneme lip sync with FLC decode, palette update, and proper
texture restore on cleanup
- Movement lock via Controller::m_npcAnimPlaying flag
- Test trigger: emote 0 plays first eligible NPC animation
Still WIP: debug logging present, network sync not implemented,
needs testing with more animations.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* WIP: Fix NPC animation playback, props, crash safety, and movement lock
- Fix SI file reading: use declared offset count, handle RIFF word-alignment
for odd-sized MxCh chunks, parse WaveFormat struct directly (not RIFF WAV)
- Fix animation type matching: use presenter name instead of MxOb::Type enum
(skeletal anim is type Object=0x0B, phoneme is type Video=0x03)
- Fix animation positioning: compute full rigid-body rebase transform
(savedTransform * inverse(animPose0)) so all motion, rotation, and extra
actor positions are preserved relative to the player's current pose
- Add extra character support: use CharacterCloner::Clone for root-level
characters (RHODA, RD, BD, PG), extend AssignROIIndices to match
non-*-prefixed root-level nodes against extra ROIs
- Fix phoneme: update palette via SetEntries after FLC decode, restore
original texture by passing saved pointer (not NULL), initialize
filetype_/volume_ to avoid UBSan errors
- Fix sync: use SDL_GetTicks (wall-clock) instead of Timer()->GetTime()
(game timer stalls during freezes), defer clock start to first Tick
- Fix crash on camera transition: add NPC anim stop callback in
Controller::Deactivate and OnWorldDisabled (fires before ROI destruction)
- Block camera toggle and scroll/zoom disable during NPC animation
- Block player movement and camera-relative input during NPC animation
- Add StopNpcAnimation() public API on NetworkManager
- Add EnsureROIMapVisibility in Tick for prop visibility
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* WIP: Fix rebase for nested camera nodes, revert test to eligible[0]
Accumulate parent transforms when computing the player's animation-
space world pose at time 0. Fixes position offset for animations with
nested '-' nodes (e.g. -SBA001BU -> -TILT -> BU) where the local
transform alone didn't account for parent TILT offset.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* WIP: Catalog filtering, prop LOD trimming, click anim blocking
- Split NpcAnimCatalog into NPC (location==-1) and cam (location>=0) buckets
- Filter by display actor's character index (not actorId)
- Eligibility: require all 5 main actor bits set (no counterpart for now)
- DisplayActorToCharacterIndex maps display actor -> g_characters index
- Trim trailing digits/underscores from prop LOD names matching original
game's e_managedInvisibleRoiTrimmed logic (LETR12 -> letr)
- Handle *-prefixed non-actor root siblings as props via CreateAutoROI
- Block click animations during NPC animation playback (both local and
remote player paths)
- Remove verbose per-entry catalog logging
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* WIP: Actor metadata ROI creation, vehicle reuse, AssignROIIndices fix
- Replace scanForCharacters heuristic with LegoAnimActorEntry metadata
loop (GetNumActors/GetActorType/GetActorName) matching original game
- Player identified by animation name suffix, not tree position
- Handle all actor types: managed actors (2), trimmed props (3),
exact props (4), scene ROIs (5/6), and scene actors (0/1)
- Vehicle ROI reuse: borrow existing ride vehicle ROI for type 0/1
actors when CreateAutoROI fails, restore name on Stop
- Fix AssignROIIndices: check extras before claiming root to handle
tree ordering (BIKESY before SY)
- Use GetRefCount(ROI*) for cleanup instead of name-based Exists()
- Block click animations during NPC anim playback
- Vehicle animation not yet fully working (known issue)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* WIP: Fix vehicle animation, skip Controller tick during NPC anim
The ride animation and SyncTransformFromNative in Controller::Tick
were overwriting ROI transforms set by NpcAnimPlayer every frame.
Skip the entire ride animation path and non-vehicle character
animation path when m_npcAnimPlaying is true, so only NpcAnimPlayer
controls ROI positioning during NPC animations.
Also add comprehensive ROI map and tree assignment debug logging.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Move SI parsing from NpcAnimPlayer into libweaver
Replace ~300 lines of custom RIFF/MxOb/MxCh parsing in NpcAnimPlayer
with libweaver's new HeaderOnly read mode and slot-based ReadObject API.
This reuses ReadChunk's existing logic for the full MxSt->MxOb->MxCh
chain, eliminating code duplication.
Extract HD/CD path resolution into a shared ResolveGamePath utility
(extensions/common/pathutils), replacing the duplicated pattern in
NpcAnimPlayer, SiLoader, and TextureLoader.
Update libweaver to 17c7736 (HeaderOnly + ReadObject support).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Refactor animation playback into Multiplayer::Animation namespace
Split the monolithic NpcAnimPlayer and NpcAnimCatalog into five focused
components under extensions/multiplayer/animation/:
- Catalog: AnimInfo index with category enum, stores all animations
- Loader: SI file I/O, parsing, AnimData cache
- Controller: Play/Tick/Stop orchestrator, ROI creation, rebase matrix
- AudioPlayer: LegoCacheSound timed playback
- PhonemePlayer: FLC decoding, texture swap, lip sync
Also removes ~50 SDL_Log debug calls, renames all NpcAnim* references
to match the new structure, simplifies the camera animation callback
API, and documents AnimUtils divergences from the original game.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* DRY: Extract TrimLODSuffix helper and AnimData::ReleaseTracks
- controller.cpp: Extract repeated digit/underscore trimming loop into
static TrimLODSuffix() (was duplicated 3 times in CreateExtraROIs)
- loader.cpp: Extract duplicated track cleanup loops into
AnimData::ReleaseTracks() (was in both destructor and move-assignment)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Updates
* Clarify animation system separation with renames and DRY extractions
Rename Controller → ScenePlayer to distinguish multi-actor scene
animations from simple character poses. Rename AnimData → SceneAnimData
to avoid confusion with the character lookup tables. Rename
animdata.h/cpp → charactertables.h/cpp to reflect their actual content
(walk/idle/emote/vehicle tables).
Extract ApplyTree, TrimLODSuffix, and ResolvePropLODName into AnimUtils
to reduce duplication across CharacterAnimator and ScenePlayer.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove dta.py accidentally committed
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix CleanupProps corrupting global NPC actor state
ReleaseActor looks up g_actorInfo[] by ROI name, which for renamed
clones (e.g. "ma") matches the real global NPC and deletes its actor
entity. Since all props are independent clones (not obtained via
GetActorROI), use ReleaseAutoROI unconditionally — it performs
identical map/ROI cleanup without touching g_actorInfo[].
Also removes the redundant explicit Remove() call since ReleaseAutoROI
already calls RemoveROI() internally.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* WIP: Add animation catalog rework, location proximity, and coordinator
Prerequisite systems for cooperative animation reenactment feature:
- Catalog: expanded CatalogEntry with performerMask, spectatorMask,
location index. Exact character matching (replaces engine's lossy
2-char prefix). New CanTrigger() checks collective player eligibility
(spectator + all performers, mutually exclusive roles).
- LocationProximity: 2D XZ distance to nearest g_locations entry,
integrated into Tickle with OnNearestLocationChanged callback.
Remote player locations derived from ROI positions.
- Coordinator: state machine (idle/interested/countdown/playing/completed),
ComputeEligibility for frontend consumption (pre-filtered to local
player's participable animations). Networking hooks are stubs.
- NetworkManager: location proximity + coordinator integration, atomic
request pattern for anim interest/cancel, state resets on all
transition paths (world disable, disconnect, reconnect, stop).
- Bridge: OnNearestLocationChanged callback (Emscripten + Native),
mp_set_anim_interest / mp_cancel_anim_interest WASM exports.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* WIP: Add push-based animation state bridge and slot fill computation
Add OnAnimationsAvailable callback that pushes full animation eligibility
state (location, coordinator state, per-animation slot fill status) to
the frontend whenever relevant state changes. Uses a dirty flag system
with 250ms cooldown (bypassed for interest changes) to batch updates.
- Add CanTriggerDetailed to Catalog (refactor CanTrigger as wrapper)
- Enrich EligibilityInfo with SlotInfo vector and CatalogEntry pointer
- Add Coordinator::OnLocationChanged for auto-clearing stale interest
- Add dirty flag triggers at all 7 state change points in NetworkManager
- Build JSON payload with unified slots (performers + spectator)
- Remove OnNearestLocationChanged (superseded by push-based approach)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Ghastly
* WIP
* Fix animation session sync, camera-cancel, and state management bugs
- Add m_cancelPending to coordinator to prevent stale session re-enrollment
- Allow ClearInterest during countdown/playing for camera-cancel support
- Camera toggle now cancels animation in any active state instead of blocking
- Safety net: cancel animation when camera is disabled by any source
- Push idle JSON when camera unavailable so frontend clears countdown UI
- HandleCancel includes playing sessions and erases them (explicit cancel stops all)
- HandleAnimCancel/HandleAnimUpdate detect playing→idle to stop local scenes
- SendAnimUpdateToPlayer for targeted session sync to newly joined players
- HandleHostAssign: skip ResetAnimationState on initial assignment to avoid race
- IsPeerNearby helper for shared proximity checks
- HandleAnimInterest: evict far-away participants when session is full
- PushAnimationState: suppress session display when no participant is nearby
- World filter in UpdateRemotePlayers and PushAnimationState
- Set m_animStateDirty on camera change and remote player world change
- Use anyInIsle instead of anyNearby for continuous proximity-based push
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Clean up animation code: extract DRY helpers, remove debug logging
- Extract BuildAnimUpdateMsg() and ExtractSlotPeerIds() to deduplicate
message-building logic in BroadcastAnimUpdate/SendAnimUpdateToPlayer
- Replace manual tree iteration in controller.cpp with AnimUtils::ApplyTree
- Remove all [Anim]/[SessionHost] SDL_Log debug calls and unused includes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* WIP: ScenePlayer multi-participant support and cam_anim playback
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* WIP: Vehicle ROI support, alias-based ROI mapping, audio fix
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Refactor animation infrastructure: remove dead code, DRY, tighten data
Remove all debug logging (~20 SDL_Log calls), dead fields (m_savedVehicleName,
m_debugFirstTickLogged, boundingRadius, centerPoint), dead methods
(RestoreVehicleROI, HasActiveSounds), and unused parameters (Tick's deltaTime).
Tighten data structures: replace raw m_propROIs array with vector, derive
isSpectator from charIndex via IsSpectator() method (SessionSlot,
ParticipantROI), group action transform fields into sub-struct, replace
vehicle category magic numbers with VehicleCategory enum.
Extract DRY helpers: addAlias/createProp lambdas in SetupROIs,
StopScenePlayback() in NetworkManager (5 call sites), combine dual slot
iteration into single loop in HandleAnimStartLocally. Simplify Play()
signature by removing redundant p_localROI/p_vehicleROI params.
Fix bug: HandleAnimCancel now unlocks remote player ROIs when stopping
during playback (was skipping unlock, leaving remotes permanently locked).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Async SI asset preloading during animation countdown
Preload animation data from isle.si on a background thread when the
countdown starts (4s window), so ScenePlayer::Play() finds the data
already cached and avoids a 500ms-1s main-thread stall.
Adds Loader::PreloadAsync() with a one-shot MxThread subclass that
opens its own si::File/Interleaf, parses the object, and inserts into
the cache under MxCriticalSection. EnsureCached() joins any in-progress
preload before falling back to synchronous load.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Refactor animation system: fix dangling pointer, DRY extractions, correctness
- Fix dangling .c_str() in ScenePlayer::SetupROIs by using std::deque
for aliasNames (vector reallocation invalidated stored pointers)
- Push idle JSON fallback when userActor is null in PushAnimationState
instead of silently returning with stale frontend state
- Extract GetPerformerIndices() to eliminate 3 duplicate bit-iteration
loops across coordinator.cpp and sessionhost.cpp
- Promote CheckSpectatorMask to public Catalog method, replacing
inlined duplicate in sessionhost.cpp
- Extract Loader::OpenSIHeaderOnly() to consolidate duplicated SI file
open/parse between OpenSI() and PreloadThread::Run()
- Extract IDLE_ANIM_STATE_JSON constant to avoid string duplication
- Clarify proximity radius distinction with comment
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Observer mode: uninvolved players see animations play out locally
Non-participant players in the same world now see scene animations
(cam_anim, npc_anim) play out on the performing players' ROIs as an
ambient background scene. The observer's camera, movement, and vehicle
are completely unaffected.
Key changes:
- HandleAnimStartLocally always runs (not just for session participants)
- ScenePlayer gains observer mode: skips camera control, spectator
hiding, and vehicle hiding
- Preload during countdown for all clients, not just participants
- Fix 1st person camera: skip display ROI check for observers (the
display clone is destroyed in 1st person mode)
- Track m_playingAnimIndex for observer early-stop detection
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add native platform multiplayer support via libwebsockets
Add a general-purpose WebSocket transport using libwebsockets (v4.5-stable)
for all non-Emscripten platforms, enabling multiplayer on desktop, mobile,
and any other platform that libwebsockets supports.
New files:
- LwsTransport: implements NetworkTransport using lws client API with
non-blocking event loop integration via lws_service(ctx, 0) in Receive()
- NativeCallbacks: implements PlatformCallbacks with SDL_Log output
Build integration:
- libwebsockets fetched conditionally only when ISLE_EXTENSIONS=ON and
not building for Emscripten, with SSL disabled (ws:// only)
- Follows existing 3rdparty dependency patterns (FetchContent/find_package)
https://claude.ai/code/session_01BojPvEEhREJ4xdihJfin3m
* Fix Connect() reconnection guard to check context instead of connected flag
The previous check (m_connected) would fail to clean up a stale lws context
when reconnecting after a connection error, since the error handler already
sets m_connected=false. Check m_context instead, matching the emscripten
version's behavior of cleaning up any existing connection state.
https://claude.ai/code/session_01BojPvEEhREJ4xdihJfin3m
* Fix cross-platform compilation errors for libwebsockets multiplayer
- Add ISLE_USE_WEBSOCKETS cmake option to conditionally build lws transport
(disabled on Switch, 3DS, Vita, Emscripten which lack standard networking)
- Disable lws internal -Werror (DISABLE_WERROR) to fix GCC/Clang builds
- Override MSVC /WX with /WX- on the websockets target to fix MSVC builds
- Skip precompiled headers for native transport files to avoid miniwin/windows.h
type conflicts on MinGW
- Guard native transport includes/instantiation with ISLE_USE_WEBSOCKETS define
so platforms without lws gracefully skip multiplayer networking
https://claude.ai/code/session_01UdLx6KWCXocF6guCQDq8C8
* Fix native WebSocket transport compilation errors and disconnect detection
- Fix undefined variable: relayUrl → s_relayUrl in multiplayer.cpp
- Fix interface mismatch: LwsTransport now implements WasDisconnected()
matching the base class pure virtual
- Add WasRejected() to NetworkTransport interface for parity between
emscripten and native backends (rejected = closed before ever connected)
- Fix post-connection disconnect detection: m_disconnected is now set
unconditionally on any close/error, not only for pre-connection failures
- Guard shared init code with #if defined(__EMSCRIPTEN__) || defined(ISLE_USE_WEBSOCKETS)
to avoid creating a NetworkManager on platforms without a transport
- Collapse identical CONNECTION_ERROR/CLOSED handlers into fallthrough
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Move exit code constants to networktransport.h and eliminate magic numbers
Move EXIT_ROOM_FULL/EXIT_CONNECTION_LOST from NetworkManager (where they
were unused) to the Multiplayer namespace in networktransport.h so both
backends can reference them. Pass them into the emscripten inline JS as
parameters instead of hardcoding 10/11.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Implement missing PlatformCallbacks pure virtuals in NativeCallbacks
NativeCallbacks only overrode OnPlayerCountChanged, leaving three pure
virtuals unimplemented (OnThirdPersonChanged, OnNameBubblesChanged,
OnAllowCustomizeChanged), making it abstract and un-instantiable on MSVC.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove WebSocket subprotocol request to match browser behavior
The relay server doesn't negotiate subprotocols, so lws requesting
Sec-WebSocket-Protocol: lws-multiplayer caused the handshake to stall
and freeze the game. The browser WebSocket API doesn't send this header.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add debug logging to native WebSocket transport
Temporary diagnostic logs to find where the game freezes on Windows:
- Before/after lws_create_context, lws_client_connect_via_info, lws_service
- In all lws callback events including unhandled reason codes
- Suppress verbose lws internal logging
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Move lws_service to background thread to prevent game loop blocking
lws_service(ctx, 0) blocks the main thread on Windows despite the 0ms
timeout, freezing the game on a black screen. Move all libwebsockets
event processing to a dedicated LwsServiceThread using MxThread, with
MxCriticalSection-protected queues for thread-safe send/receive and
std::atomic flags for connection state.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix service thread lifecycle for reconnect support
MxThread is single-use: m_running is set TRUE in the constructor and
never reset after Terminate(). Allocate LwsServiceThread on the heap
so each connection gets a fresh instance. Also handle Start() failure
to avoid deadlock in Terminate() if SDL thread creation fails.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix right-click camera turning on Desktop by tracking button state internally
On Windows, SDL3 uses different mouse device IDs for button events (normal
input) vs motion events (raw input during relative mouse mode). This causes
motion.state to not reflect the right button being held, since the button
state was recorded under a different device ID. Track right button state
internally via SDL_EVENT_MOUSE_BUTTON_DOWN/UP instead of relying on
motion.state, which works reliably across all platforms.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Restore cursor position after right-click camera drag on Desktop
On Desktop, SDL_SetWindowRelativeMouseMode accumulates absolute position
internally, so the cursor appears at a different location when released.
Save the cursor position before entering relative mode and warp it back
on release, matching the Emscripten pointer lock behavior.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix default
* Add debug logging for peer ID assignment
Logs the assigned peer ID when MSG_ASSIGN_ID is received to help
diagnose whether ws:// connections are reaching the Durable Object.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add missing SDL_log.h include for SDL_Log
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add TLS/WSS support to native WebSocket transport via mbedTLS
Cloudflare custom domains require wss:// for proper Worker routing.
Fetch mbedTLS v3.6.3 via FetchContent and enable LWS_WITH_MBEDTLS so
the Desktop client can connect over TLS. The transport now detects
wss:// URLs and sets the appropriate SSL context and connection flags.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Disable iniparser test suite during FetchContent build
iniparser's main branch added tests that require Ruby. Set
BUILD_TESTING OFF in the block to skip test configuration.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Revert "Disable iniparser test suite during FetchContent build"
This reverts commit abdd9b37bced18dd54486c1cfb23a53a2d1b3142.
* Fix mbedTLS tarball MD5 hash
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Bump mbedTLS from 3.6.3 to 3.6.5
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Use official mbedTLS release archive instead of GitHub auto-generated tarball
The auto-generated tarball from /archive/refs/tags/ doesn't include the
mbedtls_framework submodule, causing a build failure.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix mbedTLS download URL to use correct release tag format
Release tags use 'mbedtls-3.6.5' not 'v3.6.5'.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix mbedTLS include dirs by setting cache vars inside block() scope
mbedtls_SOURCE_DIR and mbedtls_BINARY_DIR are only available inside
the block() where FetchContent_MakeAvailable runs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Disable lws export targets to fix mbedTLS export set conflict
lws install(EXPORT) fails because FetchContent'd mbedTLS targets
aren't in an export set. LWS_WITH_EXPORT_LWSTARGETS OFF disables
this since we don't need install rules.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove EXCLUDE_FROM_ALL from mbedTLS FetchContent
mbedcrypto depends on internal sub-libraries (everest, p256m) that
don't get built when EXCLUDE_FROM_ALL is set, causing link failures.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add explicit build dependencies from websockets to mbedTLS internals
The Visual Studio generator doesn't infer the build order for
mbedTLS's internal sub-libraries (everest, p256m) when they are
transitive dependencies through mbedcrypto.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Force mbedTLS to build as static libraries
Without explicit BUILD_SHARED_LIBS OFF, mbedTLS (and its internal
sub-libraries like everest) build as DLLs instead of static libs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove unnecessary add_dependencies for mbedTLS internals
The real issue was BUILD_SHARED_LIBS, not build ordering.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Scope BUILD_SHARED_LIBS to mbedTLS block instead of global cache
CACHE BOOL FORCE writes to the global cache, leaking beyond the
block() and preventing lego1.dll from being built as a shared lib.
A regular variable is properly scoped by block().
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Pre-set mbedTLS 3.x API check results for lws configure
lws uses check_function_exists for mbedtls_md_setup but the check
fails since mbedTLS targets aren't built at configure time. Without
the result, lws falls back to the removed 2.x mbedtls_md_init_ctx.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add debug logging to multiplayer initialization
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Enable verbose lws logging to diagnose TLS handshake failure
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix TLS: use ALLOW_INSECURE instead of SKIP_SERVER_CERT_HOSTNAME_CHECK
SKIP_SERVER_CERT_HOSTNAME_CHECK also skips setting SNI (Server Name
Indication) via mbedtls_ssl_set_hostname. Without SNI, Cloudflare
can't route the connection to the Worker. ALLOW_INSECURE disables
cert verification while still setting the SNI hostname.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Suppress CMake deprecation error for mbedTLS cmake_minimum_required
Newer CMake versions (3.27+) error on old cmake_minimum_required
values. Setting CMAKE_POLICY_VERSION_MINIMUM to 3.10 suppresses
this for the mbedTLS subdirectory.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix left-click and cursor warp regression from right-click camera fix
The mouse button handler ran relative-mouse-mode and cursor-warp logic
for ALL button events, not just right-button events. Left clicks would
enter the else branch, disabling relative mode and warping the cursor
to a stale/zero position. Scope the entire block to right-button events
only.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Move CMAKE_POLICY_VERSION_MINIMUM outside block() scope
The variable may not propagate from block() scope into
FetchContent's add_subdirectory call on some CMake versions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix mbedTLS cmake_minimum_required deprecation error in CI
CI uses -Werror=dev which makes the CMake deprecation warning for
cmake_minimum_required(VERSION < 3.10) a fatal error. Patch mbedTLS's
CMakeLists.txt via PATCH_COMMAND to use VERSION 3.10 instead.
CMAKE_POLICY_VERSION_MINIMUM only works on CMake 4.x, not 3.28.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Rename ISLE_USE_WEBSOCKETS to ISLE_HAS_LWS and clean up multiplayer code
Rename the CMake option and compile definition to better reflect the
presence of the libwebsockets library. Remove debug SDL_Log calls and
unused includes, extract magic numbers into named constants, add null
guard for lws_cancel_service, and use inline constexpr for namespace
constants.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Rename ISLE_HAS_LWS to ISLE_USE_LWS
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix uninitialized variable UB in WorldStateSync::HandleEntityMutation
Split GetInfoArray() output parameter from FindEntityIndex() call to
avoid undefined behavior from unspecified function argument evaluation
order. MSVC evaluates right-to-left, reading `count` before
GetInfoArray() initializes it, triggering _RTC_UninitUse and preventing
entity mutation sync in multiplayer.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* WIP
* WIP
* Make camera the single source of truth for broadcast state
Remove redundant local copies of walkAnimId, idleAnimId, and
displayActorIndex from NetworkManager. BroadcastLocalState now reads
these from the camera's Controller, eliminating dual-copy sync issues.
Additional cleanup:
- Early-return on null cam in SendEmote/HandleCustomize for clarity
- Only consume camera-dependent pending requests when cam is available
- Move local name bubble creation from BroadcastLocalState to Tickle
- Remove dead NetworkManager::SetDisplayActorIndex method
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix clang format
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* Add optional sound effects to emotes
Replace the raw 2D string emote table with a struct-based EmoteEntry/EmotePhase
table so each emote phase can declare an optional 3D spatialized sound effect.
The sound plays via LegoCacheSoundManager when the emote phase starts, positioned
at the character's ROI. No extra network sync needed since sounds trigger locally
when TriggerEmote is called on each client.
Adds "crash5" sound to the BNsDis01 (disassemble) emote phase.
https://claude.ai/code/session_013XkwJJZ4RbNcBMFESuPTfJ
* Extract animation/asset tables from protocol.h into animdata.h
Move EmotePhase, EmoteEntry structs, animation table externs
(walk/idle/emote/vehicle), and helpers (IsMultiPartEmote,
IsLargeVehicle, DetectVehicleType) into a dedicated animdata.h/cpp
pair. This keeps protocol.h focused on wire-format concerns (message
structs, serialization, enums) while animdata.h owns game asset data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Extract ~420 lines of duplicated character animation logic from RemotePlayer
and ThirdPersonCamera into a shared CharacterAnimator component. Both classes
now compose a CharacterAnimator member that handles walk/idle/emote animation
playback, vehicle ride animations, click animation tracking, name bubbles,
and animation cache management.
Behavioral differences between consumers (emote transform save/restore) are
handled via CharacterAnimatorConfig.
Also extract duplicated username encoding (letter indices to ASCII) from
NetworkManager::BroadcastLocalState and ThirdPersonCamera::CreateNameBubble
into EncodeUsername() in protocol.cpp.
Replace C standard library usage across the multiplayer extension with SDL
equivalents: sprintf->SDL_snprintf, sscanf->SDL_sscanf, atoi->SDL_atoi,
strcmp->SDL_strcmp, fabsf->SDL_fabsf, floorf->SDL_floorf, and remove
unnecessary <cmath>, <cstdio>, <cstdlib> headers.
* WIP: Add character customization to multiplayer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Refine character customization: fix message buffering, DRY up code, request-based model
- Register NetworkManager with TickleManager via HandleCreate hook in
LegoOmni::Create(), so packets are processed continuously instead of
buffering between Connect() and OnWorldEnabled()
- Spawn unspawned remote players in OnWorldEnabled() (created before
world was ready)
- Switch to request-based customization: HandleROIClick sends
MSG_CUSTOMIZE to server, server echoes to all peers, HandleCustomize
applies state and plays effects
- DRY up SwitchVariant to delegate LOD cloning to ApplyHatVariant
- Add ApplyChange helper consolidating the switch-on-changeType pattern
- Fix InitFromActorInfo to derive dependent color parts from independent
parts (matching Unpack rules)
- Remove dead code: m_hasBeenTicked, ApplyCustomizeChange on
RemotePlayer, m_localCustomizeState on NetworkManager
- Add null ROI checks in HandleCustomize for unspawned players
- Move MSG_CUSTOMIZE constant to shared protocol.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix
* Fix character customization bugs from code review
- BUG-1: Add bounds check in SwitchColor to prevent OOB access from
unvalidated network input (p_partIndex could exceed array bounds)
- BUG-2: Enforce allowRemoteCustomize on receiver side in HandleCustomize
(was only checked on sender side, byppassable by malicious client)
- BUG-3: Document stale-state sound asymmetry for remote targets
- OBS-1: Remove unused bodyVariantIndex from CustomizeState (never
modified, wasted 3 bits per state message)
- NAME-1: Fix p_ prefix convention on ApplyCustomizeChange parameters
Renders a billboard text bubble showing each remote player's display
name. Includes a WASM export to toggle visibility from the frontend.
- Bitmap font renderer generates paletted textures for name labels
- Billboard quad faces the camera each frame via orientation matrix
- Bubble visibility managed globally by NetworkManager toggle
- Fix miniwin D3DRMIMAGE constructor code style (static_cast, const)
* Add feasibility plan for reusing multiplayer animation system for third-person camera
Evaluates reusing the multiplayer extension's RemotePlayer animation system
(BuildROIMap, AssignROIIndices, ApplyAnimationTransformation) for the local
player to enable a third-person camera mode. Conclusion: feasible with only
3 single-line extension hooks added to core game code.
https://claude.ai/code/session_01NC3zdQZ4nqEcYjyvStqcdD
* WIP: Third-person camera with animation reuse and movement fix
* Fix third-person camera bugs: vehicles, remote facing, emote distortion (#2)
- Fix spawn pose and building re-entry by applying idle frame 0 and
reinitializing on world enable
- Handle vehicle transitions: ride animations for small vehicles,
first-person fallback for large vehicles and helicopter
- Keep vehicle dashboards visible for exit controls
- Disable third-person camera for large vehicles, fix ROI cleanup
- Move HandleActorExit hook to end of Exit() for immediate reinit
- Fix remote player facing 180 degrees wrong by negating direction
in BroadcastLocalState when third-person camera is active
- Fix Hat Tip emote distortion from compounding transform scale by
saving clean parent transform at emote start and restoring after
each frame's animation application
* DRY cleanup for third-person camera branch
- Extract shared DetectVehicleType() to protocol.h/cpp (was duplicated
in ThirdPersonCamera and NetworkManager)
- Remove no-op HandlePostApplyTransform hook chain (called every frame
for every LegoPathActor but did nothing)
- Add ThirdPersonCamera::ClearAnimCaches() helper (pattern repeated 5x)
- Add AnimUtils::EnsureROIMapVisibility() inline helper (loop repeated
5x across ThirdPersonCamera and RemotePlayer)
- Remove redundant static_cast in multiplayer.cpp (UserActor() already
returns LegoPathActor*)
- Delete THIRD_PERSON_CAMERA_ANIMATION_REUSE_PLAN.md development artifact
Move all Emscripten-specific multiplayer code under platforms/emscripten/
and introduce an abstract PlatformCallbacks interface for outbound
notifications, mirroring the existing NetworkTransport pattern. This
removes all #ifdef __EMSCRIPTEN__ blocks from networkmanager.cpp.
Move WASM exports (mp_set_walk_animation, mp_set_idle_animation,
mp_trigger_emote) from multiplayer.cpp into a dedicated
wasm_exports.cpp, added to the isle target (guarded by both
EMSCRIPTEN and ISLE_EXTENSIONS) so the linker keeps the symbols.
Replace the polling mp_get_player_count export with push-based
playerCountChanged CustomEvents dispatched from NetworkManager.
The count only reflects players visible in the Isle world: null
when the local player is outside Isle, filtered by remote player
worldId when inside. Remove the now-unused GetPlayerCount() method.
Implement the animation system from the Phase 1 plan:
Protocol: Add walkAnimId/idleAnimId fields to PlayerStateMsg (2 extra bytes
per 15Hz tick), add MSG_EMOTE (type 9) with EmoteMsg struct, and define
shared animation lookup tables (walk: 6 anims, idle: 3, emote: 2).
NetworkManager: Store local walk/idle animation indices, include them in
every state broadcast, handle incoming MSG_EMOTE by dispatching to the
target remote player's TriggerEmote(). Add SetWalkAnimation(),
SetIdleAnimation(), SendEmote(), GetPlayerCount() public API.
RemotePlayer: Replace per-animation raw pointers with AnimCache struct
and lazy m_animCacheMap (name -> ROI map, built on first use, cleared on
Despawn). UpdateFromNetwork() detects walk/idle ID changes and swaps the
active animation cache. UpdateAnimation() now has three states: moving
(configurable walk anim), emote (one-shot with duration tracking,
interrupted by movement), and idle (configurable idle anim after 2.5s
timeout). Add TriggerEmote() for one-shot emote playback.
WASM exports: mp_set_walk_animation(), mp_set_idle_animation(),
mp_trigger_emote(), mp_get_player_count() with EMSCRIPTEN_KEEPALIVE.
CMakeLists.txt adds EXPORTED_FUNCTIONS and EXPORTED_RUNTIME_METHODS
for Svelte ccall/cwrap access.
https://claude.ai/code/session_01BEYdu8gXr1QmYwzRRgaEA6
Move world state synchronization logic (snapshots, events, entity
mutation routing) into a dedicated WorldStateSync class, reducing
NetworkManager from ~790 to ~420 lines.
Revert plant/building manager globals back to private class statics
(matching master) and use friend declarations for extension access.
Move CreateCharacterClone out of LegoCharacterManager into a new
CharacterCloner class in the multiplayer extension.
- WebSocket relay server (Cloudflare Worker + Durable Object)
- Remote player character cloning with walk/idle/ride animations
- Vehicle support for remote players
- INI config for relay URL
- Extension hook for world transition ROI management
CI / ${{ matrix.name }} (false, -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.26100.0, false, false, Visual Studio 17 2022, true, Xbox One, windows-latest, amd64, false, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake, false, devkitpro/devkitarm:latest, false, Ninja, true, Nintendo 3DS, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake, false, devkitpro/devkita64:latest, false, Ninja, Nintendo Switch, true, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.26100.0, false, false, Visual Studio 17 2022, true, Xbox One, windows-latest, amd64, false, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake, false, devkitpro/devkitarm:latest, false, Ninja, true, Nintendo 3DS, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake, false, devkitpro/devkita64:latest, false, Ninja, Nintendo Switch, true, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.26100.0, false, false, Visual Studio 17 2022, true, Xbox One, windows-latest, amd64, false, true) (push) Has been cancelled
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake, false, devkitpro/devkitarm:latest, false, Ninja, true, Nintendo 3DS, ubuntu-latest, true) (push) Has been cancelled
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake, false, devkitpro/devkita64:latest, false, Ninja, Nintendo Switch, true, ubuntu-latest, true) (push) Has been cancelled
* - Set defaults if ini exists, but empty.
- Create a new dictionary object, not use null object.
* Switch Port
Todo: Fix: Misc crashes when interacting on island.
Todo: Fix: Joystick pointer is slow to move.
Todo: Fix: Touch doesn't behave.
* Fix: base GetPathInfo fixup in the SDL implementation, with check for null SDL_PathInfo.
Fix: Disable imgui shell functions.
Todo: Display imgui debug if enabled.
* Fix: Correction to suite style guidelines
* - Switch build homebrew NRO
- CI/CD to build Switch
* Fix typo in CI
* clang-format fix
* Clang-format against isleapp.cpp
* Use correct docker container for CI/CD
* Remove SDL fixups and use an SDL3 port with fixes.
Fixes crash bug and world issues!
* Fix: use Clang-Format 17 instead of 21
---------
Co-authored-by: SnepOMatic (Rhew) <github@rhew.co.uk>
* add psvita to cmake
* no PIE for vita
* add modules to vpk
* use custom pvr apphint
* select correct renderer for sdl renderer
* patch sdl3 shaders, got something on screen!
* use proper cmake patch for sdl
* add missing module
* remove test window which causes a bug in the vita sdl port to show up
* add gxm renderer (not working with display yet)
* avoid sdl renderer for vita, seems broken
* make gxm renderer work with new d3drm
* fix rendering somewhat, some geometry shows up
* support paletted textures directly to avoid copying the texture twice
* fix Draw2DImage
* make 3d work, broken lights
* clean up a bit
* fix normals matrix
* remove some unneeded changes
* forgot env var
* wrong env dest
* run clang format
* correct texture address mode, use tlsf instead of sceClibMspace
* double buffered uniforms seem to work now
* missed a line
* update GXMRenderer_EnumDevice
* hopefully actually fix uniform buffers
* run clang-format
* remove a change thats not needed
* improve fragment shader performance
* add vita to dist folder
* add base for vita config app
* add config self to vpk
* transform touch events to virtual size
* add livearea graphics
* Update cmake file to include livearea assets
* put manual in the right place
* add sample rco
* add messagebox on vita
* triple buffer textures because fences arent a thing on vita and making draw&cpu sync would be too slow
* make config app not crash on launch
* change defaults
* update gxm renderer with interface changes
* split 2d and 3d shaders completely
* update gxm renderer
* fix transition on gxm
* clang format
* move config cmake
* move CONFIG_vita
* always clear before drawing 2d image
* hopefully fix windows build
* clang-format fix broken includes
* order again
* undo moving qt cmake to its own list
* move uic search path
* use ifdefs for all d3drm backends, cpack to generate vpk
* cmake wrong escape
* small cleanups in gxm renderer
* defer texture delete to avoid overwriting the texture during a frame
* clang-format
* more of the layout for config
* remove top buttons
* use SceAppSettings instead of custom ui
* use select for back to info center on vita, to make screenshots possible again
* remove accidentally left in add_subdirectory
* adjust diskpath to be like other ports
* use vita_create_vpk and not cpack
* gxm: msaa support, fix wrong file path
* gxm: add mipmaps (disabled)
* clang-format
* fix open isle.ini with fopen
* add missing strings
* use iniparser_set not dictionary_set
* add default save path to config
* load config app after initializing ini on vita
* fix config build
* change the default disk & cd path, update the paf library
* update paf library headers
* include orders for clang-format
* clean up
* make shader compiler not required
* move asm language
* warn instead of error when shader source is changed when no compiler is found
---------
Co-authored-by: Li <li@silica.codes>
Co-authored-by: Christian Semmler <mail@csemmler.com>
* initial files
* get building
* proper paths & default to virtual mouse
* Wrap gradle under cmake & build SDL3.aar
run cmake with -DANDROID_NDK_PATH=/path/to/ndk to generate the .aar & run the gradle build
if using Android Studio you will have to run the aar script manually(or do the cmake cmd) then put the normal cmake args inside '-PcmakeArgs="-DCMAKE_BUILD_TYPE=Release ...."' at `Settings > Build, Execution, Deployment > Gradle-Android Compiler > Command-line Options`
Check CMakeLists.txt Android build block for more info
* workflow and format
* dont cmake -> gradle -> cmake
* icons
* prevent first start crash due to missing isle.ini
dont force require gles3 (vulkan & software are options)
* cleanup
* cmake script & ci cleanup
use a cmake script to downoad SDL3 sources for aar building
* script cleanups & gradle stub for android studio
handle the env var setting for the sdl3 aar build script
* signing
needed repository secrets:
- keystore : key.jks in base64
- keystorePassword : Key store password
- keyAlias : Key alias, ex key0
- keyPassword : Key Password
* conditionally run action without keys
* compile SDL once & cross-platformize gradle tasks
* suggestions
* use find_package over manual configuration
* use MxString
---------
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
Co-authored-by: Christian Semmler <mail@csemmler.com>
* ✨ feat: add ios support
* ⚗️ chore: trying some experiments to make ci working
* ⚗️ chore: is it really ci version problem?
* 💚 fix: it really is just a ci version issue
* 🩹 fix: go as low as possible
* 🩹 fix: support ipad
* chore: update README.md
* ✨ feat: got the audio working
* 🔧 feat: add appxmanifest
* 🩹 fix: remove opengl stuff
* ⚗️ feat: add button support
* ⚗️ chore: try to make less modification from upstream
* 🩹 fix: doesnt compile
* ✨ feat: forcibly draw cursor and map right joystick to cursor
* 🩹 fix: remap joystick
* 🎨 fix: formatting
* 🎨 fix: cmakelists formatting
* 🩹 fix: 3ds build
* 👷 feat: add xbox one ci build
* 💚 fix: github hates xbox series naming
* 💚 fix: dont run cpack for xbox one, vs does that for you
* 💚 fix: xbox one need to use vs as generator
* 💚 fix: please
* 💚 fix: it could be msix not bundle
* 💚 fix: try recursive directory search when upload release
* 🔨 feat: support cpack
* 👷 feat: better packaging
* 💚 fix: ignore if mv fails
* 🔧 feat: add mouse sensitivity config
* 🔥 chore: dont need you
* ⚗️ chore: use d3d11
* ✨ feat: hardware acceleration!!
* 🚸 chore: change default cd path so user can easily copy the assets to xbox
* 🧑💻 chore: improve reusability
* 🚨 fix: formatting error
* 🚸 chore: draw cursor by default
* 🎨 chore: cmakelists formatting
* chore: match with upstream
* chore: more matching with upstream
* chore: don't need you
* 🩹 fix: apply changes
* 🔥 fix: we don't need controller map anymore
* 🩹 fix: use isle style include guard
* 🩹 fix: last newline fix
* 👷 chore: use cpack
* 💚 fix: try to fix ci
* 💚 fix: i tried my best...