Commit Graph
110 Commits
Author SHA1 Message Date
andrew 1480f0b584 Rewrite ROADMAP.md and add archived initial roadmap
Replace the phase-based ROADMAP.md with a vertical-slice focused "Commonwealth Online Roadmap" that documents current status (Working Internal Vertical Slice) and the new playable slices (Same-Cell Foundation, Multiplayer Menu, Player State/Animation MVP, World-State Sync, Internal Playtest Package, Small Session, Gameplay Experiments, and later items). The previous Phase 0-6 plan is preserved verbatim in docs/ROADMAP_2026_06_Initial.md for archival reference. The change pivots tracking from low-level bootstrap tasks to playable vertical slices and highlights completed internal milestones and remaining tests.
2026-06-22 22:02:35 +12:00
andrew 99595ef87c Add host-authoritative world-state sync
Implement host-authoritative time/weather sync across server and clients. Adds a new worldState packet (and worldStateHost for host assignment) and server-side host tracking/reassignment to the lowest remaining playerId when the host disconnects. Plugin-side changes introduce F4T::WorldStateSync (new header + implementation), polling/apply hooks in the game-thread main loop, and Networking support to send/receive/parse worldState/worldStateHost packets. The server validates host-only sends, relays worldState to peers, broadcasts worldStateHost on host handoff, and augments logging/stats. Protocol and documentation files updated (protocol/world-state.md, docs/*) and server/fake_client.py extended to track/print host world-state snapshots.
2026-06-22 21:50:59 +12:00
andrew 9ceb6601ae Add LAN discovery and Local servers UI
Adds LAN server discovery and a Local tab in the multiplayer UI so clients can find relays on the same LAN. Introduces a new F4T::LanDiscovery module (plugin/include/F4TLanDiscovery.h, plugin/src/F4TLanDiscovery.cpp) that probes LAN hosts via UDP discover (port 7778) and TCP welcome fallback (port 7777). Server-side support includes a UDP responder (server/lan_discovery.py) and integration in server_core.py to start/stop discovery.

Plugin changes (F4TServerBrowserBridge/Data) add background scanning, dispatch results to the game thread, new local-server storage and events (scanLocalServers, localServersUpdated, localScanStarted/localScanFinished), and small join/recent handling updates. UI changes (ui/.../app.js and components) add localServers state, scanning UX, Recent persistence (localStorage), and join logic for local/direct entries. Docs updated (docs/protocol.md, docs/dev-log.md, server/README.md) and build script links iphlpapi. Also removes two unused exported sprite PNGs.
2026-06-22 15:53:17 +12:00
andrew 7efe407421 Add responsive UI scaling for server browser
Introduce resolution-aware UI scaling to keep fonts, glyphs, and panel chrome readable and aligned above 1920×1080. Adds a new components/layout.js that sets --co-ui-scale (baseline 1920×1080) on load/resize and exposes CO_Layout.update; index.html now loads it and app.js triggers updates onBrowserShown and on window resize. styles.css converts many fixed px values to calc()/em driven by --co-ui-scale, removes the old pixel-floor media queries and clamp caps, and scales borders, spacing, and font sizes. controller-glyphs.js multiplies glyph dimensions by the UI scale so controller icons grow correctly. Changes address small/drifting server browser content on high-res and ultrawide displays.
2026-06-18 15:51:42 +12:00
andrew 102acd3340 Add controller icon PNGs and tinting logic
Add per-platform controller PNGs and runtime tinting, hook them into prompts, and update deploy/stage scripts.

- Add many controller PNG assets under ui/Icons and copy them into browser/assets/icons on deploy/stage.
- New controller-glyphs.js: image-based glyph renderer that tints white pixels to the UI color via a canvas pixel pass, caches results, and supports platform selection.
- New controller-icons.js: adapter that forwards rendering to controller-glyphs.
- Update controller-prompts.js to render icon glyphs (and include LB/RB tab-switch prompts) and call hydrate after rendering.
- Call CO_ControllerGlyphs.onThemeApplied from theme.js so glyphs re-tint when theme changes.
- Include new scripts in index.html and add CSS rules for glyph image sizing in styles.css.
- Update docs/dev-log.md describing the change and testing/next steps.

This change replaces previous inline/SVG glyph handling with individual PNG icons and adds deploy-time copying so the repo keeps a single source for controller icons.
2026-06-18 15:41:46 +12:00
andrew 1353e5a52c Gamepad-aware cursor handling in server browser
Add gamepad-aware pointer handling so the server browser hides the mouse cursor when a controller is connected and only shows it after mouse movement/click. Changes include:

- PrismaUI: track browser pointer mode, prefer gamepad detection, suppress native CursorMenu/MenuCursor when in gamepad mode, unfocus the Ultralight view to prevent PrismaUI drawing its cursor, and restore pointer mode on mouse activity. Integrate pointer-mode initialization on browser show and call PollGamepad + UpdateBrowserPointerMode in the permanent task loop.
- MenuInput: expose IsGamepadConnected(), provide PollGamepad() wrapper and simplify Register() logging.
- UI: add window.CO_App.setPointerMode to toggle a co-gamepad-mode class and clear hover state; add CSS to hide the HTML cursor when co-gamepad-mode is active.
- docs: add dev-log entries describing the PrismaUI Ultralight cursor fix and the new gamepad-aware server browser behavior.

These changes ensure consistent cursor behavior between mouse and controller input, prevent the Ultralight cursor from appearing in controller mode, and restore the cursor after mouse interaction.
2026-06-18 14:37:31 +12:00
andrew f720d35d2a Add controller support and safe main menu hooks
Enable gamepad navigation for the PrismaUI server browser and install MainMenu input hooks safely. Poll XInput each game-thread tick and forward button/stick changes to the browser (ForwardButtonEvent / ForwardThumbstickEvent), allocate an input-enable layer to suppress vanilla kMenu events while the browser is open, and register polling via the F4SE task interface. Replace direct vtable writes that caused a loading-screen crash with REL::Relocation::write_vfunc on the MainMenu BSInputEventUser secondary vtable and install OnButton/OnThumbstick hooks once at plugin Install(). Add MainMenu API to suppress inputEventHandling and call it when showing/hiding the browser. Also update PrismaUI browser JS to support controller focus for direct-connect, filter activation/cycling, improved controller prompts, and add CSS for focused direct-connect fields. Files touched include plugin/src/F4TMenuInput.cpp, plugin/src/F4TMainMenuInject.cpp, plugin/include headers, PrismaUI view JS/components, styles, and documentation.
2026-06-18 14:26:33 +12:00
andrew 3d14918ee8 Add staging step and reorganize assets
Add stage-mod.bat and update build scripts to stage the mod package instead of automatically deploying (build-all.bat now calls stage-mod.bat; build.bat prints plugin output path and packaging hint). Reorganize Creation Kit assets into DataFolder and RawAssets directories, add new mesh/texture files, and update CommonwealthOnline_Vault109.esp. Also include ancillary updates to deploy scripts, docs, and server code to reflect the new packaging workflow.
2026-06-17 23:03:30 +12:00
andrew f56b6cf113 Maintain runtime proxy frustum visibility
Add periodic nudging to restore proxy frustum visibility when a proxy is near the local player to prevent proxies from remaining invisible after a frustum cull. Introduce kRuntimeProxyVisibilityNudgeInterval and kRuntimeProxyForceVisibilityRange, track lastObservedProxyVisible on ProxyActorSlot, and add MaintainRuntimeProxyFrustumVisibility and NudgeProxyFrustumVisibilityIfNearLocalPlayer helpers (with throttled logging and animation re-apply when visibility is regained). Switch several readiness checks from ProxyMeshReadyForPresentation to ProxyHasLoaded3D, and stop gating puppet updates on IsVisible so puppets continue to update while the mesh is loaded even if frustum-cleared. Also reset lastObservedProxyVisible when clearing a slot.
2026-06-16 16:44:09 +12:00
andrew cd3679e548 Improve runtime proxy 3D recovery and head refresh
Make proxy 3D/visibility handling more robust to avoid headless A-poses and corrupted movement after PlaceAtMe spawns or 3D reloads. Added helpers to check mesh readiness, queue targeted 3D updates, and refresh head/face nodes; introduce settle/wait timing (2s default, 12s max) and recovery state tracking on proxy slots. Retain proxies for prior exterior cells when appropriate, reset/clear additional slot flags on lifecycle changes, and block puppet updates while proxies are settling. Adjusted animation sync and puppet logic to require visible/loaded meshes before applying motion feedback. Added related includes and expanded logging to aid diagnostics.
2026-06-16 16:36:43 +12:00
andrew 73d44a828b Improve proxy mesh readiness and spawn logic
Introduce ProxyMeshReadyForPresentation to treat partially loaded but visible proxy meshes as ready (avoids headless A-poses). Track lastObservedRemoteCellId on proxy slots and use it to detect remote cell changes so proxies can be restored or snapped when needed. Harden spawn lifecycle handling: reset stale promoted state, add/clear fields (pendingSpawnHandle, spawnAttempted, spawnFailed, lifecycleState, holdReason, visibility flags) and ensure slots are properly reinitialized. Replace ProxyHasLoaded3D checks with the new readiness check in animation sync and movement updates. Also publish an initial transform (including cell/worldspace info) immediately on connect so host/client can resolve same-cell placements without waiting for movement.
2026-06-16 16:08:59 +12:00
andrew 31406a1275 Add hover sync and CO hover component
Add a hover system to restore :hover-like behavior for custom UI elements in the CommonwealthOnline view. Changes include:

- plugin/src/F4TPrismaUI.cpp: add SyncBrowserHover() which reads the native cursor position, converts it to client coordinates, and invokes a JS update on the server browser view; register a periodic task to call SyncBrowserHover every other tick.
- ui/views/CommonwealthOnline/browser/components/hover.js: new component that tracks pointer position, determines hovered targets using a selector list, and applies/removes a .hovered class; exposes bind(), updateFromPoint(), and clear().
- ui/views/CommonwealthOnline/browser/app.js & index.html: include and bind the new hover component during UI initialization.
- ui/views/CommonwealthOnline/browser/styles.css: add .hovered variants and transitions for nav items, buttons, rows, and filter controls to match hover visuals.
- steam_interfaces.txt: add a list of Steam interface version strings (new file).

Purpose: ensure custom buttons/rows that don't receive native :hover updates from the renderer get visible hover feedback by syncing the native cursor into the web UI and toggling a .hovered class.
2026-06-16 15:55:32 +12:00
andrew 7ab3f080f7 Add new Vault and furniture 3D assets
Add several new 3D assets for the creation kit: 109-Entrance-Test.fbx (stored via Git LFS), FurnitureMarkerSit.obj with its FurnitureMarkerSit.mtl (exported with NifSkope), Vault95Exterior.fbx, and VaultGearRoom assets including Vault109Exterior.fbx, Vault109Exterior.nif, and Vault109ExteriorCOL.obj/.mtl (collision mesh and material). These files provide exterior and furniture geometry for the Vault 109 area.
2026-06-16 15:11:06 +12:00
andrew 6ef383a23e Add wall mural OBJ/MTL; update bench NIF & ESP
Add new wall mural assets (creation-kit/assets/WallMurals/VltWallFree01.obj and .mtl). Remove Substance Painter lock for the double-sided bench and update its NIF mesh (CO_VltDoubleSidedBench01.nif). Update creation-kit/esp/CommonwealthOnline_Vault109.esp (binary) to include or reflect these asset changes.
2026-06-14 22:20:21 +12:00
andrew 0f376eb6d3 Add DoubleSidedBench art assets
Add a complete DoubleSidedBench asset set: Blender source files, OBJ/MTL, Fallout 4 NIF and BGSM material files, many textures (DDS/PNG), decals and exports, and painter lock/spp LFS pointers. Remove legacy CO_DoubleSidedBench.fbx and duplicate FBX/spp files. Also reorganize VaultLeather textures into a VaultLeather subfolder and update related .blend and .spp files.
2026-06-13 22:33:20 +12:00
andrew e593060282 changed backslashes in file path to forward slashes 2026-06-12 18:18:58 +12:00
Andrew Zambazos 80b0d72b2d Add DoubleSidedBench asset files
Add DoubleSidedBench assets to creation-kit/assets/DoubleSidedBench: the FBX model (CO_DoubleSidedBench2.fbx) and associated .spp file are added as Git LFS pointers, along with the Blender source file (DoubleSidedBench.blend) and its autosave/backup (DoubleSidedBench.blend1). These files provide the new double-sided bench model and source for the creation kit.
2026-06-12 03:56:00 +12:00
Andrew Zambazos a4a8845ec6 Add DoubleSidedBench model, references, textures
Add a new DoubleSidedBench asset to creation-kit/assets. Includes model files (CO_DoubleSidedBench.fbx, CO_DoubleSidedBench.mb, CO_DoubleSidedBench.spp), three reference images (concept, top plan, isometric technical), and two textures (VaultLeather diffuse and VaultLeather normal). These provide the mesh, scene/project files, visual references, and material maps for the Vault bench prop.
2026-06-11 23:18:01 +12:00
Andrew Zambazos 1ffad68250 Add Workshop wide door assets and update ESP
Add Ronin's Vault Workshop wide door assets: material files (BGSM, alpha), glass shader (BGEM), NIF mesh, and diffuse/normal/specular DDS textures for RVP_VltWorkshopWideDoor01. Update CommonwealthOnline_Vault109.esp to include/integrate the new door assets.
2026-06-11 21:35:17 +12:00
Andrew Zambazos 467f64fd4f Update CommonwealthOnline_Vault109.esp 2026-06-11 20:32:07 +12:00
Andrew Zambazos 11cfbced13 Update CommonwealthOnline_Vault109.esp 2026-06-11 15:23:35 +12:00
Andrew Zambazos f557835b19 Add Fallout 4 path resolver and update deploys
Introduce resolve-fallout4-path.bat to centralize locating the Fallout 4 installation. deploy-all.bat and deploy-ui.bat now call the resolver (accept an optional path arg or prompt interactively), and the chosen path is saved to a local .fallout4-path file (added to .gitignore). Updated docs (docs/dev-log.md, plugin/setup.md) to reflect the new behavior and usage examples. The resolver normalizes game or Data paths, probes common Steam locations, prompts the user when needed, and exports F4_DIR and DATA_DIR for callers.
2026-06-11 14:35:50 +12:00
Andrew Zambazos 5bbcccee2c Add Ultralight SDK submodule and update scripts
Add Ultralight SDK as a git submodule (ThirdParty/Ultralight-SDK, Windows branch) and update build/deploy tooling and docs to use the vendored SDK by default. Updated .gitmodules and added the submodule pointer; build-prismaui.bat and deploy-all.bat now default UL_SDK to the submodule path and build-prismaui.bat checks the submodule is initialized. The PowerShell linker script (scripts/setup-ultralight-link.ps1) now falls back to ThirdParty/Ultralight-SDK when no SdkPath is provided. Documentation and developer log updated (docs/setup.md, plugin/setup.md, docs/dev-log.md) to document submodule initialization and usage; ULTRALIGHT_SDK_PATH can still override the default. Run 'git submodule update --init --recursive' on clones to initialize the SDK.
2026-06-11 14:16:41 +12:00
andrew 0980567605 Update CommonwealthOnline_Vault109.esp 2026-06-10 23:09:04 +12:00
andrew 0bf7a1c5ef Add Vault109 ESP; update CommonwealthOnline
Adds a new plugin file creation-kit/esp/CommonwealthOnline_Vault109.esp and updates the existing binary creation-kit/esp/CommonwealthOnline.esp. The change introduces a Vault 109-specific ESP alongside an updated main CommonwealthOnline ESP binary, likely to add or modify in-game records/assets for that location.
2026-06-10 18:29:28 +12:00
andrew 8ff760ed39 Add main menu button injection guide
Add a comprehensive step-by-step guide for injecting a custom main-menu button from an F4SE C++ plugin (docs/MainMenu_Button_Injection_Guide.md). Update existing docs to reference the new guide: add link in docs/MainMenu_Injection.md and expand the setup note in docs/setup.md to point to the full how-to and project-specific notes.
2026-06-09 22:44:18 +12:00
andrew e61922678b Add server validation, profile store, session launch
Introduce server validation and a session launch flow with persistent server profiles.

- Add ConnectAndValidateServer to Networking to validate handshake/timeouts and return human-friendly errors; avoid auto-connecting in transform send path and remove unconditional local connect on startup.
- Add ServerProfileStore (header + implementation) to persist server->saveFile bindings under Documents/My Games/.../CommonwealthOnline/server-profiles.json with thread-safe load/save, lookup, touch and bind operations.
- Add SessionLaunch (header + implementation) to handle launching validated sessions, first-time join flow (auto coc to SanctuaryExt, character creation menus, save binding), F4SE message handling and periodic Update processing.
- Update ServerBrowserBridge to parse/validate ports, use ConnectAndValidateServer, display joinLoading UI events, schedule validated session launch on the game task thread, and centralize join success/failure handling.
- Wire SessionLaunch into main.cpp (update loop and F4SE message hook).
- Improve direct-connect UI in app.js with client-side validation, port parsing, and handling of joinLoading events.

These changes provide better connection validation, user feedback during joins, and automatic handling for first-time server joins with persistence of associated saves.
2026-06-09 16:26:33 +12:00
andrew e6748556ae Update framework-F4-Conversion 2026-06-09 15:19:24 +12:00
andrew fb4e238fcc Add dynamic UI theme for server browser
Introduce runtime-driven UI theming for the server browser

- Expose PushUITheme() in F4TServerBrowserBridge and implement ColorToJson + PushUIThemeInternal to serialize HUD colors and invoke a JS hook.
- Call PushUITheme on UI initialization and when the browser is shown so the webview receives current HUD colors.
- Add frontend handler for "uiTheme" in app.js and a new components/theme.js that implements window.applyCoTheme to set CSS vars and tint the cursor SVG.
- Update styles.css to use RGB component CSS variables (--co-r/--co-g/--co-b and background equivalents) so colors can be overridden at runtime.
- Update index.html to include the new theme script and tweak cursor SVG stroke width; cursor asset updated as well.

This enables the plugin to synchronize the in-game HUD colors with the browser UI dynamically.
2026-06-09 15:19:03 +12:00
andrew 1f80b8ea49 Ensure main menu in MAIN_STATE before multiplayer
Add EnsureMainMenuMainState to try returning the main menu to MAIN_STATE by repeatedly invoking onCancelPress (up to 12 attempts with args true,false). Modify OpenMultiplayerMenu to early-return on null, call the new helper and log a warning if it cannot restore MAIN_STATE before proceeding, and preserve the existing uiMovie handling.
2026-06-09 14:56:38 +12:00
andrew d4d3268b12 Add runtime MainMenu injection and docs
Introduce a C++ runtime injection that adds a Multiplayer row to the Fallout 4 main menu instead of patching MainMenu.swf. Adds F4TMainMenuInject.h/cpp implementing injection, ITEM_PRESS handling, accept/button hooks, resync tasks and logging; integrates installation by calling MainMenuInject::Install() from PrismaUI init. Update PrismaUI to use the new helper and remove a duplicate IsMainMenuOnMainPanel implementation. Documentation updated to deprecate FFDec SWF patching (new docs/MainMenu_Injection.md, note in FFDEC guide, and setup.md) and restore-vanilla-mainmenu.ps1 messaging updated to instruct using the runtime injection.
2026-06-09 14:52:27 +12:00
andrew 1f39c3a929 framework f4 2026-06-09 11:47:33 +12:00
andrew 9c84c9d4bc Add FFDec docs/tools and server-browser fixes
Add comprehensive FFDec walkthrough and short patch docs for safely adding a Multiplayer item to MainMenu.swf, plus helper scripts to extract the vanilla SWF and restore it (tools/extract_ba2.py, tools/restore-vanilla-mainmenu.ps1). Update exported MainMenu.as with a warning comment and remove an outdated exported PATCH markdown. Patch binary Interface/MainMenu.swf (updated).

Hardening fixes in the plugin: include GFx headers, avoid leaving the PrismaUI overlay focused after menu changes, only call OnBrowserHidden when the browser was actually visible, and add IsMainMenuOnMainPanel() so WatchMainMenuState ignores MainMenu when not on the MAIN_STATE. Ensure events are only dispatched when the browser is valid & visible (CanDispatchToBrowser) and make Scaleform UI hide the browser immediately during transitions. These changes prevent the overlay from staying focused during Settings transitions and stop JS events from being sent to a hidden/invalid view.
2026-06-08 22:26:00 +12:00
andrew 50d48f1f99 Add custom cursor assets and deploy step
Add F4MouseCursor.png and F4MouseCursor.svg assets and wire up a CSS variable (--co-cursor) to use the custom cursor in the browser. Update styles.css to apply the cursor variable to body and interactive elements. Modify deploy-all.bat to create %PRISMA_ROOT%\misc and copy the PNG to %PRISMA_ROOT%\misc\cursor.png at deploy time, with a warning if the file is missing. This enables a consistent custom cursor for the PrismaUI_F4 runtime (runtime reads misc\cursor.png) while still providing a browser CSS fallback.
2026-06-08 14:54:58 +12:00
andrew cfd1fab6b2 Revamp CommonwealthOnline browser UI and styles
Rework the CommonwealthOnline browser UI: restructure HTML into a nav + subpanel layout, add SVG/PNG/font assets and new sprites, and overhaul styles with a new font-face and refreshed color/spacing variables. Refactor components: tabs use a left nav list; filters extraction (renderRow) and reset focus handling; direct-connect renders into a dedicated container; server-list switched to compact row layout and adds a scroll indicator; server-details now uses a preview area and simplified preview/stats rendering. Update app logic: adjust focus zone handling (nextFocusZone), limit zones per tab, update connection status/count display, and avoid rendering details for direct-connect. Overall changes improve responsiveness, visual hierarchy, and focus/navigation behavior.
2026-06-08 14:40:00 +12:00
andrew fe620020be Add PrismaUI HTML server browser & integration
Integrate a PrismaUI_F4-based HTML server browser and related tooling. Adds a ThirdParty submodule (framework-F4-Conversion), UI views (CommonwealthOnline browser HTML/JS/CSS), and multiple plugin headers/sources to bridge PrismaUI/Scaleform, handle menu input, and manage server browser data and actions (mock server list, join/connect flow).

Key changes:
- New build/deploy scripts: build-prismaui.bat, build-all.bat, deploy-all.bat, deploy-ui.bat and a PowerShell helper for linking the Ultralight SDK (ULTRALIGHT_SDK_PATH, default F:\\UltralightSDK).
- Plugin additions: F4TPrismaUI, F4TScaleformUI, F4TServerBrowserBridge, F4TServerBrowserData, F4TMenuInput, F4TDebugOverlay and implementations to create/show/hide the HTML view, forward controller input, register Scaleform functions (openManager/closeManager), and push UI events.
- Networking: add ConnectToServer(host,port) and keep ConnectToLocalServer() as wrapper; update connection logs and error handling.
- Main menu SWF/AS updates: updated MainMenu.swf and MainMenu.as to call closeManager() when leaving multiplayer and to integrate open/close hooks.
- Documentation: plugin/setup.md updated with PrismaUI build/deploy instructions.
- Removed Main_ModManager.swf (deleted).

Primary intent: provide an in-game HTML server browser (toggleable with F9 or Scaleform calls), wire up controller input, and add build/deploy workflow for PrismaUI/Ultralight so developers can build and deploy the UI and plugin together. Mock server data is used for now; network join/connect plumbing is provided for local/dev servers.
2026-06-08 14:02:49 +12:00
andrew 2ced73f7b9 Handle runtime proxy 3D unload/recovery
Track and recover runtime proxy actors when their 3D meshes unload and reload. Adds slot flags (proxyObservedLoaded3D, proxyPending3DRecovery, proxy3DResetQueued), MaintainRuntimeProxy3DState and RecoverRuntimeProxyAfter3DReload to defer animation/puppet updates while mesh is missing, queue Reset3D and restore animation/locomotion state once fully loaded. Integrates checks throughout controller logic to skip smoothing/updates for proxies without 3D and updates slot initialization/reset. Also prevents puppet-driven motion/graph speed writes when the actor's 3D is unloaded to avoid corrupted PlaceAtMe proxies, with logging for diagnostics.
2026-06-07 21:31:28 +12:00
andrew 9b133b3109 Add proxy positioning API and CK-placed pool
Add a ProxyGameAPI (F4TProxyGameAPI.h/.cpp) exposing PositionRemoteActor which centralizes positioning logic, play-space resolution, MoveRefrToPosition-style moves, and 20Hz throttling bypass for forced moves. Replace ad-hoc SetPosition/SetHeading calls across the proxy controller to use the new API, ensuring correct cell/worldspace migration, logging, and move-rate throttling.

Introduce support for Creation Kit placed proxy refs: detect CK-placed proxies by editor ID prefix or base form, populate a per-cell proxy pool, and prefer assigning CK-placed proxies for runtime remotes (with fallbacks). Update proxy spawn/holding logic (skip smooth frame once, handle settle states, preserve/reuse CK pool entries) and improve worldspace/cell mismatch checks to avoid incorrect movement across play spaces.

Other changes: add CommonwealthOnline.esp resource file, update setup.md with the new local FormID (0x002666) for COPlayerProxy, enable animation sync gating to require loaded 3D, and small logging/message improvements.
2026-06-07 21:24:07 +12:00
andrew cc4d8aac5a Add Papyrus sync scripts and proxy spawn refactor
Add new Papyrus scripts (CoSync.psc, CoSyncPlayer.psc, CoSyncQuest.psc) providing native bindings and quest/player proxy logic for networking: connection/session APIs, entity management, world/weather/workshop/companion sync, consumable/pipboy/door/power-armor events, and proxy animation/initialization handlers. Refactor the proxy actor controller (F4TProxyActorController.cpp) to support dynamic/runtime proxy spawning and improved lifecycle/visibility handling: change proxy base/form IDs to COPlayerProxy/CommonwealthOnline, add process-list actor lookup, spawn helpers, play-space/cell checks, 3D visibility refresh, ActorHandle usage, and spawn mutexes and globals for safer spawning. Update docs and setup (architecture.md, limitations.md, plugin/setup.md) to describe global dynamic spawn behavior, max runtime proxies (kMaxRuntimeProxyActors = 4), and validation checklist; update launch-two-fallout4.bat to show instance log locations. Misc: small tweaks to logging and debug flags to gate diagnostics.
2026-06-07 20:31:51 +12:00
andrew 21c8bf9593 Smooth remote proxy rotation and conditional snapping
Add interpolation for remote proxy rotation and conditional snapping logic. Introduces kProxyRotationLerpAlpha and a ShouldSnapRemoteMovement declaration, and uses LerpRotation to smoothly apply headings for non-slot proxies (and slot-backed proxies in frame smoothing) unless movement type or large drift forces a snap. Adds a kLargeDriftSnapDistance threshold and threads a computed headingToApply through proxy locomotion/animation calls. Also updates the informational log to mention rotation lerp and removes an unused void cast.
2026-06-07 16:34:21 +12:00
andrew 8dfec0a4b3 Rename project to Commonwealth Online
Replace occurrences of "Fallout 4 Together" with "Commonwealth Online" across docs and testing guidance. Add Interface assets and tooling: MainMenu/Pipboy SWFs, translation/fonts, exported scripts (Interface/exported/scripts/MainMenu.as) and a PATCH_MainMenu_Multiplayer.md describing how to add a Multiplayer menu entry that calls root.f4se.plugins.commonwealthOnline.openManager(). Also add build/run batch scripts and apply assorted updates to README, plugin, server and protocol documentation/source to align with the rename and UI changes.
2026-06-07 16:22:50 +12:00
andrew 4adc7d57ef Add third-party networking dependencies 2026-06-07 15:50:56 +12:00
andrew 4e459b789c TP 2026-06-07 15:50:12 +12:00
andrew 0d00938396 Add x64_vc11 Release .obj files and tlogs
Add prebuilt Visual C++ x64 (vc11) Release object files and associated build tlog metadata under ThirdParty/common and ThirdParty/xse_common. The changes introduce multiple .obj files for common interfaces (IBufferStream, IDataStream, IDebugLog, IDirectoryIterator, IErrors, IEvent, IFileStream, IInterlockedLong, IMutex, IPrefix, ISegmentStream, ISingleton, ITimer, ITypes) and tlog files (CL.*, Lib.*, Cl.items.tlog, common_vc11.lastbuildstate) including an unsuccessfulbuild marker for xse_common. These are generated build artifacts capturing the last build state and compilation records.
2026-06-07 15:48:26 +12:00
andrew c4a7b6dedb Fix proxy stop/land animation linger & snap
Prevent proxies from continuing jog/landing animations after a remote stops and fix snap desyncs. Treat network-authoritative idle (graphSpeed < 0) as definitive and stop falling back to measured lerp speed; pin/snap position when remote is not locomoting and ensure transforms snap on stop receive. Shorten sender-side hold times for movement and jump states to reduce stale motion in packets, and use isMoving (not stale graphSpeed) for landing resume decisions. Changes in plugin sources and main config, plus an updated dev log entry.
2026-06-05 16:12:34 +12:00
andrew 9412fcf8ea Improve proxy jump sync and event handling
Handle remote jump state more robustly and avoid locomotion graph clobbering. Changes: detect jumping early in ActorController and short-circuit to apply jump animation/state; suppress locomotion (Speed/Sprint) while airborne and keep graphSpeed for landing-tier selection; add ApplyJumpStateToGraph helper to set jump vars; only write bulk descriptor fields when not airborne to avoid stomping jump graph; change snapshot writes so in-jump vars are not overwritten by descriptor bulk writes; reorder and refine jump/movement event logic so jump start/up/down/land are handled before locomotion tier events and preserve the pre-jump locomotion tier for landing transitions; ensure graph updates are applied while jumping; set puppet locomotion speed to -1 when jumping or idle so the engine's idle speed remains; and increase the network jump hold duration from 200ms to 400ms. These changes prevent missed/incorrect jump animations and improve landing clip selection.
2026-06-05 15:59:35 +12:00
andrew f4b37b6d12 Improve proxy animation motion handling
Add explicit motion-driven animation sync and strengthen moving logic to reduce desyncs. Initialize puppetGraphSpeed and reset applied animation state for non-moving puppets on restore. Introduce SyncProxyAnimationFromMotion to drive proxy animation from measured per-frame speed (with a 8.0F threshold) and to clear puppet graph speed when the remote isn't locomoting. Replace previous inline motion/graph merge logic in ApplySmoothFrameMovement with this helper. In F4TProxyAnimationSync, make isMoving authoritative (require both isMoving flag and movementSpeed >= idle threshold) and clear movingHoldUntil when the remote is not moving to avoid stale hold states.
2026-06-05 15:52:01 +12:00
andrew a137821406 Improve proxy locomotion, tier & jump sync
Fix multiple proxy animation issues: stale graph Speed collapsing jog into walk, missing slow-walk/jog tiers, and jump takeoff/landing not playing. Key changes:

- Prefer position-derived movementSpeed when animationGraphSpeed is missing/stale (ResolveLocomotionGraphSpeed) and fall back to graph Speed only when it agrees within a tolerance; sender now transmits movementSpeed when local graph read is 0 and TryReadLocalAnimationGraphSpeed falls back to SpeedSmoothed.
- Introduce locomotion tiers (Walk/Jog/Run) with ComputeLocomotionTier and sync ints (iSyncWalkRun/iSyncLocomotionSpeed/iSyncJumpState) to the graph; fire corresponding tier events when starting or changing tier.
- Fix proxy motion application: persist per-proxy velocity and worldDelta so the Update hook does not zero-out controller motion; use measured frame motion to drive animation when network flags are sparse.
- Restore correct jump behavior: fire MT/weapon-compatible jump events for takeoff and landing (JumpUp/JumpStartFrom*/jumpLand/jumpLandTo*), clear bInJumpState on landing and remove the extra proxy-side jump hold so landings exit the jump loop.
- Misc: add constants and thresholds for tier/run/walk/run-land decisions and update logs to include tier labels.

Files updated: plugin/include/F4TProxyAnimationSync.h, plugin/src/F4TProxyAnimationSync.cpp, plugin/src/F4AnimationDescriptor.cpp, plugin/src/F4TProxyPuppet.cpp, plugin/src/F4TProxyActorController.cpp, plugin/src/main.cpp, and docs/dev-log.md.
2026-06-05 15:48:16 +12:00
andrew 6a38e7226c Use authoritative FO4 animation variable names
Replace previously guessed graph variable names/types with the real FO4 humanoid movement behavior names (from MTBehavior.hkx) and update syncing logic accordingly. F4AnimationDescriptor now lists only the variables F4T drives (Speed, SpeedSmoothed, IsSprinting, bInJumpState, iIsInSneak) to avoid clobbering graph state; Direction is intentionally not written. Enable proxy sneak sync using the INT32 iIsInSneak, change SpeedSampled -> SpeedSmoothed, and update all Set/Get calls and diagnostic logging to the new names. Fix jump detection by relying on the actor IsJumping() API (removing the noisy vertical-speed heuristic that produced false positives and caused proxies to remain in jump state). Changes touch descriptor, proxy sync, puppet, main logic, and related docs to explain the rationale and testing notes.
2026-06-05 15:29:31 +12:00
andrew 5ba440ab5d Add crouch state and fix jump sync
Add isCrouching to network, state and animation systems; enable proxy jump syncing with a jump-hold debounce and update animation descriptor and server tooling.

Key changes:
- Networking: F4TNetworking.h/cpp: added a_isCrouching, include "isCrouching" in transform packets and parsing, and logging.
- Remote state: F4TRemotePlayerState.h: added isCrouching field.
- Proxy animation: F4TProxyAnimationSync.*: added crouch fields, enabled jump sync, implemented ApplyJumpHoldState and jump hold timing, wrote crouch/jump bools into descriptors when available, updated event firing and logs.
- Animation descriptor: F4AnimationDescriptor.cpp: added isJumping and isCrouching to bool variable list.
- Local detection: main.cpp: added isCrouching in movement state, stubbed GetCrouchState(), adjusted jump hold timing and included crouch in outgoing transform calls.
- Server/dev tooling: server/dev_server_app.py, fake_client.py, fake_player.py, README.md: added crouch reporting, toggle UI/control and fake client support for crouch, and updated docs/logging.
- Docs: docs/dev-log.md updated with notes on jump/crouch fixes and testing.

Rationale: ensure remote players can report crouch state and make jump animations transition reliably by debouncing jump state on proxies and writing available graph bools; also provide dev-server controls and fake-client support for testing.
2026-06-05 14:22:17 +12:00