WIP: Misc update#27
Open
AntonyGarand wants to merge 4 commits into
Open
Conversation
Port the in-game world music player onto master, wiki-audio-only: - mapviewer/music: WikiMusicService fetches the authentic in-game .ogg render of each track from the OSRS wiki file CDN and plays it via the native Web Audio API (decodeAudioData + BufferSource + gain ramps); LRU AudioBuffer cache, region crossfade, nearest-track prefetch. MusicTrackIndex loads public/all-music.json and answers spatial (camera-position -> track) polygon lookups; MusicSettings persists volume/mute/mode/autoplay to localStorage. - components/rs/music: MusicPlayer bar (play/pause/stop/volume/seek/ mode/library) + searchable MusicLibraryModal browser. - MapViewerContainer: position-driven auto-play with region crossfade, manual library pick, wiki service lifecycle, index load. - Includes the crossfade-cleanup fix (was mixing AudioContext.currentTime with performance.now(); now scheduled in wall-clock time). Dropped the local MIDI/synth path and its deps (midi-parser-js, soundfont-player, @wasm-audio-decoders/ogg-vorbis): the wiki engine is the sole playback path, so they are unused. play() signature simplified to play(entry). No package.json dependency changes.
Port the full OSRS transport/teleport capability onto feature/music: - data/transports: TransportIndex + per-network TSV graph (fairy rings, spirit trees, gliders, carpets, ships, levers, spells, items, portals, minecarts, agility shortcuts, wilderness obelisks, quetzals, ...). Lookup by object id + map square so network objects only offer the destinations of the clicked node. pickChoiceDestination + buildTransportChoices resolve single vs. multi-destination picks. - data/search: SearchData unifies all-locations.json + all-npcs.json into a searchable index for the teleport panel. - components/rs/teleport: TeleportModal (search a location/NPC and go) + TransportChoicesModal (multi-destination picker). - MapViewer: transportIndex (loaded in init), findTransportEdges, teleportTo, open/closeTransportChoices, showTeleportButton, and the pendingTransportEdges state the UI polls. - InputManager: left press/release detection (click vs. camera drag) so a left-click triggers the default OSRS-style menu option. - WebGLMapViewerRenderer: object action menus now wire transport edges to their matching actions (Climb-up/Travel/...), single-destination transports teleport on left-click, multi-destination ones open the picker. Live/spectator click handling is NOT included. - OsrsMenuEntry.isTransport flag; MapViewerContainer wiring (Teleport button, panel + choices modals, transport-index polling) alongside the existing music wiring. Deps: none new (react-select + react-modal already on master).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A couple of nice vibe-coded updates: Mostly publishing them here so they can be used as reference and reviewed as there are some good concepts, but I don't trust the source code just yet, need to do a better audit first.
Vite Migration
I couldn't get the app to run locally due to create-react-app being deprecated, and didn't want to spend too much time on the issue.
I tasked my agent to migrate to a more modern Vite setup: This worked great, but would also require changes to the osrs.world deployment to be fully supported.
I think it's a step in the right direction, but pending more review before being merged as it has side-effects.
Camera improvements
Camera here refers to the recording capabilities
Music
Music player based off the official world game music data.
Music will play as you move around or via the music player on the bottom left corner of the screen.
The implementation currently downloads music from the osrs wiki: I tried implementing a reader from the cache, but this proved to be overly complex as while getting the midi track is fairly easy, getting the instruments to sound right was not.
Track metadata is stored in a json configuration from parsed-osrs and lazy fetched from the wiki when the music needs to play.
Todo:
Teleport panel and actions
Added the capability to teleport anywhere by a global teleport menu, and follow in-game teleports via the game actions.
Supported are:
Metadata was also imported from parsed-osrs : Now all known teleports named within the wiki can be accessed from a quick teleport bar, and game actions with a matching teleport location within the metadata will transport you to its appropriate counterpart.
If multiple locations are available, say fairy rings, it will open a menu with the options for you to choose from.
There are some few rough cases such as fairy rings requiring clicks on the roaming butterflies instead of the rings, but it's a great improvement to navigate the world.
Todo:
I've posted few teasers on discord on the capabilities and figured I'd kickstart the PR while I clean it up so I can gather feedback and ideas along the way, or if someone wants to take it over and fix my vibe mess to ship faster!