Nyako c02f8e004c Load an unlimited amount of loose music (#1171)
* Load an unlimited amount of loose music

Binary blobs can now store 128 tracks, and music can now be read from
loose files. Unfortunately, the two cannot be used together -- loose
music can still only use 16 tracks. This commit attempts to fix that,
allowing for music playback by filename.

* Rework music track loading

The current "loose songs" system does not load files from custom
assets. This is from the #412 PR, and is NOT the "extra loose songs"
system that this PR implements, but they both work in the same area so
I decided to squash both of these bugs at once (plus, it helped clean
up the code and make a saner system, so...)

This commit also allows "loose music" to override music stored in the
`vvvvvvmusic.vvv` binary blob. When reading a blob, it will first check
if a loose file exists at the current path it's trying to find a track
at; if it exists, it will load that instead. If the blob does not
exist, the system will try to locate all expected built-in tracks
directly from the assets folder instead of doing that during blob
loading.

The `play` command has some safety removed due to an old exploit which
needs to be kept -- `music(5b)` should play track 5. This is used in
many levels and cannot be broken; unfortunately this means that we no
longer get the nice error when a song fails to be played, but that's
better than breaking a large amount of levels.

This commit does NOT address loading a "extra" loose track overtop of
a custom blob track, because with the current tooling, and the way it
will most likely continue to work in the future, every single custom
track in blobs have a completely empty path. If someone decides to
modify their blob in a hex editor or makes their own tooling, this
issue may show up again, but that is a problem which can and probably
should be addressed at a later date. The required code to solve such a
problem would be far more than what this PR should address, and for a
situation so unlikely, it's easy enough to just avoid adding the same
custom song twice, one in a music file, and one loose, because if
you're making a level, you're probably going to use one or the other.

* Fix mentioned issues from review
2026-05-06 19:03:05 -04:00
2024-01-02 22:27:05 +01:00
2026-05-05 16:51:13 -04:00
2024-01-02 22:27:05 +01:00
2024-01-08 19:17:44 -08:00
2024-01-02 22:27:05 +01:00
2024-01-02 22:27:05 +01:00
2025-05-06 22:06:48 -04:00

logo

This is the source code to VVVVVV, the 2010 indie game by Terry Cavanagh, with music by Magnus Pålsson. You can read the announcement of the source code release on Terry's blog!

The source code for the desktop version is in this folder.

VVVVVV is still commercially available at thelettervsixtim.es if you'd like to support it, but you are completely free to compile the game for your own personal use. If you're interested in distributing a compiled version of the game, see LICENSE.md for more information.

Discussion about VVVVVV updates mainly happens on the "unofficial" VVVVVV discord, in the vvvvvv-code channel.

Credits

S
Description
The source code to VVVVVV! http://thelettervsixtim.es/
Readme 28 MiB
Languages
ActionScript 54.3%
C++ 44.4%
C 0.7%
Java 0.4%
CMake 0.2%