Brian151 / Various-Projects

Everything here is so WIP, experimental, or small, that it doesn't warrant its own repo yet
4 stars 0 forks source link

Questions about sounds #1

Closed jdjakub closed 8 months ago

jdjakub commented 1 year ago

I was amazed to discover yesterday that the "missing" songs have been sitting here for years in _cct. Thanks so much - but they never seemed to be in any extant copy of the game. How on earth did you manage to get them?

assets/_readme.txt:

However, only 5 of them actually contain anything. The external casts all are intended to add additional sound, but I am unsure if they were actually released to the public. I got mine straight from the original developers.

Can you elaborate on this? I contacted the composer and reached out to Lego a couple of years ago but it was fruitless.

assets/sound/sound.txt:

snd_datamap_blackout_sfx { random s.electricity s.blackout_swell m.blackout_1 s.blackout_3 }

snd_datamap_sfx { random s.electricity s.siren s.slam s.slam 0 255 -10 }

I remember these sounds and was always sad not to hear them in the surviving copies. It seems even this archive doesn't have them. Could they be obtained the same way you got the music? (This also goes for an alleged in-databattle extension of the intro theme, but the corresponding cast member music_databattle_6 in _cct/snd_netload.txt seems to contradict this.)

Finally, any tips on how I could hack around with the Flashpoint filesystem / local fileserver / a hex editor to get the game to see the extra music files and play them?

Thanks for this incredible work of data preservation. I knew your username from Open Shockwave / Earthquake but never realised you'd done this as well.

Brian151 commented 1 year ago

i managed to contact one of the developers specifically eric zimmermn, iirc

i faintly recall those, too... i suspect they were meant to be in the sound_lvl files, but those all appear empty it's also possible some older version had these sounds and they were removed/lost for some reason frustrates me....

i wouldn't recommend hex-editing to achieve those effects. the code itself has to be de-compiled, re-written, and then recompiled. shockwave player movies/casts also are structured slightly differently, so you'd first need to pull every single section out, then decompress, then figure-out what's what... just...awful idea... all those of us who worked on cracking director/shockwave format basically have PTSD from it. hex-editing these, especially the shockwave variant, is absolutely a fool's errand.

jdjakub commented 1 year ago

So, several years ago you emailed a developer and he sent you the _cct files? What did you ask for? Just trying to determine if it would be worth asking again specifically for the other things, or if that's all he had.

I don't know what you mean by sound_lvl files, what are those?

I heed your warning on hex editing :D however, I doubt it's necessary. The extra music was loaded from the network, right? I really do think it's "extra" because the preserved copies all include music_databattle_1 and it has special status in sound.txt instead of cct. Also, the other day, after installing Flashpoint on my new computer and starting the game up for the first time, I got an error when it tried to reach a nonexistent music URL. The next time I started it up, it was fine. So I'm assuming I just need to place the cct folder or files somewhere locally, or setup a local web server to handle the requests for these files, and then the game will play these songs in-game. I was wondering if you had any knowledge relating to that.

I don't see how the game could be preserved without the extra music unless the extra music was loaded on the intro screen from a server. Otherwise, how are we to account for the music not playing on the preserved copies (jayisgames)? Either these assets were removed from the game (requiring the re-jigging and re-compiling you mentioned - absurd) or they actually are included in the preserved files but for some reason the game wouldn't play them?

I remember running Cheat Engine on the game a few years ago and discovering lots of decompressed plain text in memory. Perhaps a search for the music cast members could rule out whether the audio was packaged in the preserved files.

Brian151 commented 1 year ago

i specifically asked for the CCT files. eric contacted a guy and he sent the DCR and the CCTs

there are 5, snd_lvl[x].cct and director/shockwave is very interesting in that it tends to expect them to exist and will attempt to load them whether they do or not. at least, this is the default behavior. every copy tries to load these, and every copy fails. however, director/shockwave are capable of ignoring this, as long as their content is unused. but evidently, this wouldn't matter since they're empty. maybe they always were? snd_netload[x].cct also are interesting. based on the fact they contain the music loops for the databattles, my guess is at one point, those were external. likely during development since no surviving copy actually references/loads them.

sound.txt technically doesn't exist. in fact, nothing with .txt exists in the game exactly as-is. the data does, but the whole file does not. i painstakingly copied every text cast member into a single text file, one per cast. and some i need to re-do because the text window didn't display or copy the whole thing. found that out when actually analyzing the file format. i'm guessing as-is, nothing would happen if you dropped the files in place. i think i tried that once. game runs as normal, iirc....

the extra music probably was unused for one reason or another. anything with m.[name] is embedded in the DCR, it's loaded immedietly, and that's that. jayisgames copy has no music? i can't say... never understood why that is... director/shockwave was just bizarre.

so, i loaded one of my backups of the files and hit them with offzip. this rules-out possibility of diropener culling things it doesn't need/understand. snd_lvl are totally empty. if they ever existed, with contents, they don't anymore. maybe some dev still has them, but it's likely they either deleted/lost those, won't share [cuz legal BS], or didn't do version control [this is likely]. if LEGO has them, it's an internal backup we'll probably never see. snd_netload all have the same number of files, they're presumed to be the same, but i'll check that later. the .dcr is interesting... even factoring in some [noticable] dupes i made and didn't purge [oops] , less files than what i originally extracted were recovered. that said, numerous errors were logged and one file refuses to play. it's likely offzip skipped data, and even read some corrupted data. i'm still combing-through the couple thousand things which were dumped. again, my theory is no preserved version has the sounds. if there's a remote possiblity, it's with LEGO, either internal backups or someone's archive. [do you recall when crash/siren vanished? i think at least in 2007 and 2008, they still existed, that's when i discovered this game.] iirc, i tried to do this once. slightly unrelated, i swear that i recall the southpark lemmiwinks game had a different main/start music track [clipping/mixing the song from the episode], but i can't find that, either. the "joys" of preservation, amirite? you wouldn't want to see my current preservation projects... especially the emergency "crap, EOS announced!" panick one i have recently started.

jdjakub commented 1 year ago

I've just been down a rabbit hole into Director file formats etc... I see that all the sound_level files are exactly the same. I turned the cct into cst using "recover_cct" and opened it in the KaiTai online IDE using common/RIFF as a base format. Currently using Director internet docs to adapt the yaml format spec for XFIR. Doesn't look like there's anything interesting, as you said, so I wonder if those files are vestiges.

More importantly, I've dropped all that because I had the idea to look at Flashpoint's logs while entering a node in-game. It tries to load snd_netload_1.cct from the server!! I've entered several but it only requests that file. Maybe it does them in sequence, so it'll request the next after I supply this one.

Please, do me a favour and point me to the raw snd_netload_1.cct file / upload it, so I can shove it in the relevant local directory? I've no idea how to reconstruct a cct from your files on github.

Lol, I sound like one of the characters in the game. A game about hacking has compelled us to hack it, it's truly come full circle. Anyway, get me that file and I'll give you 5000 credits and an experimental piece of software ;)

jdjakub commented 1 year ago

Also, I just ran spybotics.dcr through ProjectorRays and it looks like the Lingo decompiler works. I searched "music" in my hex editor and saw code to do with playing music. Neat, might help.

jdjakub commented 1 year ago
if glob[#blackoutFlag] = 1 then
    whichSound = "music_databattle_6"

Aha! So the intro theme is supposed to play as databattle background after the netmap blackout.

    if member("whichSound").type = #empty then
      whichSound = "music_databattle_1"
    end if
  end if
  if whichSound = "music_databattle_1" then
    if (glob[#soundExternalLoading] = #on) and (glob[#soundLoadingMode] <> #done) then
      SndStartLoading()
    end if
    whichSound = "whichMusicShouldItBe"
    if glob[#soundNetSource] > 5 then
      myLimit = 5
    else
      myLimit = glob[#soundNetSource]
    end if
    repeat while member(whichSound).type = #empty
      randomNumber = random(myLimit)
      whichSound = "music_databattle_" & randomNumber
    end repeat
  else
    SndAbortLoading()
  end if
  if (whichSound = "music_worldmap") and (glob[#blackoutFlag] = 1) then
    whichSound = "music_worldmap_blackout"
  end if

I rest my case that it treats databattle_1 specially and wants the others loaded externally :)

jdjakub commented 1 year ago
on SndStartLoading
  glob[#soundLoadingMode] = #on
  whichCast = getAt(glob[#soundCasts], glob[#soundNetSource]) & glob[#soundNetSourcePostFix]
  SndLoadNetSource(whichCast)
end

on SndLoadNetSource whichCast
  glob[#soundNetID] = preloadNetThing(glob[#soundPath] & whichCast)
  glob[#soundNetSourceName] = whichCast
end

on SndCheckLoadStatus
  if glob[#soundLoadingMode] = #on then
    if netError() = "OK" then
      if netDone(glob[#soundNetID]) then
        castLib("sound_level_" & glob[#soundNetSource]).fileName = glob[#soundPath] & glob[#soundNetSourceName]
        SndMessage("Netloaded..." & glob[#soundNetSourceName])
        glob[#soundNetSource] = glob[#soundNetSource] + 1
        if glob[#soundNetSource] > glob[#soundCasts].count then
          glob[#soundLoadingMode] = #done
          SndMessage("Done Loading Sounds!")
        else
          whichCast = getAt(glob[#soundCasts], glob[#soundNetSource]) & glob[#soundNetSourcePostFix]
          SndLoadNetSource(whichCast)
        end if
      end if
    else
      SndMessage("netError = " & netError())
    end if
  end if
end

on SndAbortLoading
  netAbort(glob[#soundNetID])
  if glob[#soundLoadingMode] = #on then
    glob[#soundLoadingMode] = #off
  end if
end

on SndFixCastLibraries
  if (the environment).runMode = "Author" then
    glob[#soundNetSource] = 1
    repeat while glob[#soundNetSource] <= glob[#soundCasts].count
      whichCast = "sound_level_" & glob[#soundNetSource] & ".cst"
      SndMessage("Loading..." & whichCast)
      SndLoadNetSource(whichCast)
      repeat while not netDone(glob[#soundNetID])
      end repeat
      castLib("sound_level_" & glob[#soundNetSource]).fileName = glob[#soundPath] & whichCast
      glob[#soundNetSource] = glob[#soundNetSource] + 1
    end repeat
    SndMessage("SndFixCastLibraries done.")
  end if
end

on SndLoadCastLibraries
  if (the environment).runMode = "Author" then
    glob[#soundNetSource] = 1
    repeat while glob[#soundNetSource] <= glob[#soundCasts].count
      whichCast = getAt(glob[#soundCasts], glob[#soundNetSource]) & glob[#soundNetSourcePostFix]
      SndMessage("Loading..." & whichCast)
      SndLoadNetSource(whichCast)
      repeat while not netDone(glob[#soundNetID])
      end repeat
      castLib("sound_level_" & glob[#soundNetSource]).fileName = glob[#soundPath] & whichCast
      glob[#soundNetSource] = glob[#soundNetSource] + 1
    end repeat
    SndMessage("SndFixCastLibraries done.")
  end if
end
sound code

You know what, get me all five snd_netload CCT files and I'll upgrade you to Security Level 6...

(I wonder how one could see those debug messages, they'd be very helpful.)

I'll shut up now, sorry for the spam. But it is interesting.

Brian151 commented 1 year ago

I've just been down a rabbit hole into Director file formats etc... I see that all the sound_level files are exactly the same. I turned the cct into cst using "recover_cct" and opened it in the KaiTai online IDE using common/RIFF as a base format. Currently using Director internet docs to adapt the yaml format spec for XFIR. Doesn't look like there's anything interesting, as you said, so I wonder if those files are vestiges.

More importantly, I've dropped all that because I had the idea to look at Flashpoint's logs while entering a node in-game. It tries to load snd_netload_1.cct from the server!! I've entered several but it only requests that file. Maybe it does them in sequence, so it'll request the next after I supply this one.

Please, do me a favour and point me to the raw snd_netload_1.cct file / upload it, so I can shove it in the relevant local directory? I've no idea how to reconstruct a cct from your files on github.

Lol, I sound like one of the characters in the game. A game about hacking has compelled us to hack it, it's truly come full circle. Anyway, get me that file and I'll give you 5000 credits and an experimental piece of software ;)

where'd you even get the sound_level files?

idk how binding it really is, but i technically agreed not to upload the CCTs.. rather, as the dev put it : "copyrights!". given how lax lego is, i probably can... [heck... BMP has the commercial games, and several leaked marketing docs...] long as it's not preliminary photos, LEGO actually really seems to hate when some rando on youtube does that. or, they used to

i am not sure if director would import these files in their compressed form, but what you would do is create a new external cast and name it appropriately. you'd take the SWAs and import them, naming these new cast members the same thing as the filename, sans the ".swa". using 1 as the example new external cast > "sound_netload_1" import "m.z1", "m.z2", "m.z3" .swa and name each cast member respecitively, without the ".swa" then, from the .txt: [snd_netload_1] music_databattle_2 { random 4 m.z1 m.z2 m.z3 } you'd create another new cast member, "music_databattle_2" and copy everything within the curly braces then you'd save and export/publish as .cct/shockwave, whatever director's UI says one other important thing to remember is, this game is OLD (2002) , you might also consider targeting an older version, ideally the same one. a lot of programs will read something older than their version, usually not something newer due to the possibility a "breaking change" happened to the file/data format.

now, i actually tried, using the stand-alone projector, to load my "full" copy of the game, i did not hear the snd_netload tracks. unless they only play much later into the game. [which i could cheat cuz the test buttons are showing/working when playing it this way]. and, if you take a listen, these stick-out like a sore thumb, there's no doubt when/if they play. and can't rule-out director being director. or modern windows being windows. that is, assuming every random file/exe contains/is malware.

Brian151 commented 1 year ago

Also, I just ran spybotics.dcr through ProjectorRays and it looks like the Lingo decompiler works. I searched "music" in my hex editor and saw code to do with playing music. Neat, might help.

oh, i also did have it run through projectorrays. tho damn is it confusing so out of context, and no small part is honestly not that interesting/useful... the rest is taking me some time. the sound engine is ironically mostly straightforward. i know what it's supposed to do, at least. how it specifically works within director/shockwave or the architecture of the DCR? not so much...

Brian151 commented 1 year ago
on textWall // :P

You know what, get me all five snd_netload CCT files and I'll upgrade you to Security Level 6...

(I wonder how one could see those debug messages, they'd be very helpful.)

I'll shut up now, sorry for the spam. But it is interesting.

i may or may not upload the snd_netload CCTs at some point. porting the game is certainly not out of the question, either if i recover them from my old drive, they're absolutely being released the sound_level CCTs i currently have are as manlybadasshero would put it: "useless!" but if intact/complete ones are recovered, they're getting extracted and [re-]released

the decompiled code i always intended to upload, but this all was dumped before decompilation was particularly feasible and i kinda just forgot i even planned to until seeing "code" folder of this repo

the debug messages probably only appear in the IDE. as long as you don't modify/touch any of the scripts, you should be able to re-publish/test a dir-opened copy of the game. my friend and i managed to add a blueprint for one of the worldbuilder enemies just my modifying data/assets in that game. but i never tried to re-publish spybotics as-is... tried and failed to use some "naughty" XTRAs to asset dump, but i ended-up having to do it the hard way in the end.

it is interesting, and i don't really consider this "spam" level/quality just yet...

jdjakub commented 1 year ago

where'd you even get the sound_level files?

Flashpoint has them: sound_level_x.cct, 1 to 5. They're pulled from biomediaproject, as you mentioned. They do have these cct files, I assume you mean they lack the netloads - yes.

not sure if anyone's tried to contact michael sweet

I did, early 2022. He advised me to contact Lego as he still felt legally bound not to share the files. I had a few email conversations with customer service but it went nowhere, with generic "we can't comment on this" stuff. I'm considering getting back to him soon just laying out what I tried, and ask him how I could obtain the assurance he needs (I don't remotely believe Lego actually cares about this, from multiple lines of evidence, and common sense that it's so old and they've never revived the product line).

as of yesterday, the HDD has been imaged

Good man, godspeed :)

i technically agreed not to upload the CCTs

Yet you already uploaded the SWA and scripts which would seem to be the meat of the files, unless they contained something else of significance? 7 years and nothing bad. I'm not a lawyer and maybe uploading the different bits of an archive file is somehow different to uploading the file itself, even though technically there's little difference... but multiply all this by the 0.00001% chance Lego cares. Still, if you're not comfortable with that, maybe they can be reconstructed.

but what you would do is create a new external cast and name it appropriately (...)

Thanks, I was actually up late last night doing exactly this (For anyone interested: to make a CCT you use Xtras > Update Movies > Convert to Shockwave, this used to be called Afterburner). But when I supplied the CCT to the game it crashed with "too many errors". As you said, I probably need to get an earlier Director version - I'd downloaded 11.5 from Archive.org (I trust it more than the other random websites on offer), and when importing spybotics.dir or the casts it says I need to let it upgrade the files to the new version. I will try and get a copy of version 8 or something.

Just realised - if you happen to have an old version, you could make a snd_netload_1.cct and send me it without breaking any previous agreements.

now, i actually tried, using the stand-alone projector, to load my "full" copy of the game

I'm not sure exactly what you're telling me here. If you're not using Flashpoint, you'd have to have some way to serve the web requests it makes for the snd_netload files. By default, it'll fail and it just won't play the music, as we know from jayisgames. If you mean that you're running it in Flashpoint and have your snd_netload cct's in the htdocs folder, and they still didn't play in databattles, that would be very sad.

porting the game is certainly not out of the question, either

Someone already did a Web clone but to my knowledge it doesn't include the extra music (nor ambient sounds, but I haven't checked).

the sound_level CCTs i currently have are as manlybadasshero would put it: "useless!"

I still don't understand what we're saying about sound_level. They exist, they're from biomediaproject, they're all the same, and they don't contain anything interesting, certainly no sound samples. It's unclear what purpose they serve. Do you think the biomediaproject ones were reconstructed or stripped of assets, and you're hoping your hard drive holds the originals which actually have stuff? Unless they are where the ambient sounds came from (but then why would they be split across 5 files?) I'm content with the "development vestige" theory :S

Contra that, this line:

castLib("sound_level_" & glob[#soundNetSource]).fileName = glob[#soundPath] & glob[#soundNetSourceName]

Made me think these casts were somehow just placeholders for the net-loaded music. But this isn't based on anything rigorous.

jdjakub commented 1 year ago

Update: Director 8. New cast (External). Call it snd_netload_1. Import the SWA's. Insert > Media Element > Text. Call it music_databattle_2. Add the playlist. Because this cast is external, it'll let you save as an external cst. Xtras > Update Movies, convert to Shockwave, select the cst and a backup folder. CCT obtained.

I copied this CCT into Flashpoint's htdocs. THE MUSIC PLAYS INGAME!!!

I will repeat this for the others and figure out how to submit them to Flashpoint.

Also, Director 8 complains the file is too new when I try to import a decompressed sound_level_x.cst. Internally, the file has version numbers 0x744 = 1860, which corresponds to Director 10. So maybe someone created these files later to get it to work.

If I hex edit the versions to 0x640 = 1000 (Director 8) and import, it doesn't crash, but it is indeed empty.

Brian151 commented 1 year ago

hmm... biomediaproject's downloadable version lacks the CCTs, so that's an interesting discrepency

yeh, i tried customer service all those years back. need to contact the actual corporate and/or tech part of the company...

yeh...

pretty much. iirc i was aware even then.

archive.org is quite a useful place, tho the copyright zealots keep attacking it lately...

i just used the stand-alone projector, that easily could make a difference

ah yes, i'm aware of it. i don't really like/endorse it due to shopjob assets and being ...commercial product...

they must contain the other ambient sounds, or once did... it's interesting how the game is set-up to force them to pre-load. they actually appear in the cast library. honestly, i'm curious why these warranted being external files at all. the game wasn't that big, and the average play session would've loaded multiple even within the first day.

apologies for delays and kinda crappy response. i'm so glad the "acceptable" personal freedoms enjoyed in this country extend as to violate others' personal freedoms. for example : for others to not be sick... mostly recovered now >.>

Brian151 commented 1 year ago

well, looked at the BMP CCTs in flashpoint. they're suspiciously byte-accurate to each other. down to byte size. i also know what jayisgames used blank HTMLs. biomediaproject in the past has modified game files, usually with disclosure what was done and why. and the download copy doesn't have the CCTs or even mention them. just says "all files are original/intact". they do not match my copies which definitely are genuine in the sense they came from a dev and/or his associate.

so my two theories: -bmp counterfeited them because the game wasn't loading over internet without them [iirc, this is the rare case director/shockwave itself directly cares about missing files] -replaced/updated files. at some point, the CCTs had at least some changes made. these files would likely be the last version ever released. i don't really buy this. if they came with the game, BMP would've included them in download version, not assumed they were worthless. alternatively, they would've disclosed "deleted junk unused files". or at least, they should've done that. also, this would mean proper archival efforts having to go back at least a couple years prior. even more unlikely, because by now, SOMEONE should've come forward or released a suspiciously "perfect" port/"stand-alone" version of the game [likely bragging and asking for $$$ since these two go hand in hand with some particular types of individual/entity whom preservationists/everyone depise].

someone would have to ask them, but bmp most likely faked these. a lot of effort to go through when jayisgames simply realized "i'll just make a blank webpage cuz this ancient broken plugin just doesn't care". but that seems most likely what happened. the bmp files are a tad smaller, and all their variation to each other is concentrated about at the end of file. probably silly things like time stamps since short of intentionally writing a fake one, most software by convention writes the current time.

and well, if they're real, they arguably are even less useful than the ones i was sent. there's at least something that makes those "unique".

i at this point really do not trust my memory in regards to what happened on that computer or when, but i think it's possible those files are on there. i'm pretty sure it loaded the game before the sounds disappeared. and that's not the only old lost stuff i'm now hoping to pull from it...

also, you mentioned earlier it's funny we're hacking a game about hacking. what's more funny is we're real-life hacking a game about hollywood-style hacking...XD much as it'd be cool [and sometimes frustrating] playing out a databattle to break-through code/data/etc... , the reality is stuff like... [attached] image

Brian151 commented 8 months ago

snd_datamap_blackout_sfx { random s.electricity s.blackout_swell m.blackout_1 s.blackout_3 } snd_datamap_sfx { random s.electricity s.siren s.slam s.slam 0 255 -10 }

I remember these sounds and was always sad not to hear them in the surviving copies. It seems even this archive doesn't have them. Could they be obtained the same way you got the music? (This also goes for an alleged in-databattle extension of the intro theme, but the corresponding cast member music_databattle_6 in _cct/snd_netload.txt seems to contradict this.)

so, there's been a development another user has recovered 3/5 of the netloads off an old hard drive

s.electricity : found s.blackout_swell : found m.blackout_1 : found s.blackout_3 : found s.slam : found

s.siren : still missing...

sound_level_x files: their copies also turned-up as empty, so it seems more than likely these specific files are not worth concerning ourselves with

i will be uploading these soon and i've just decided i'll upload the files i was sent

however, i think it's time to split this project off into its own dedicated repo as such, i will be closing this issue, keep checking my profile for the new one, should be up soon ™️

jdjakub commented 7 months ago

Very exciting!! They don't seem to be uploaded yet in the new repo, I'm watching but do ping me when they're available.

Brian151 commented 7 months ago

everything is there, but i did change the organizational structure during re-upload.

jdjakub commented 7 months ago

Just listened, under snd_netload_X/r543. Incredible. Huge thanks to you and the mysterious user.

I've learned:

  1. Commenters weren't lying about the reverb effect. Maybe I got the name wrong but the new music files seem to just be the old ones plus this sound effect and maybe a lower pitch shift. This means the missing ones (1, 4) could perhaps be whipped up with Audacity.
  2. Evidently the music tracks were meant to change a little each time you reached a new security level. I don't remember this, but I like it. I can never tell if stuff I don't remember was actually part of the running game, or if it was left in but never activated.
Brian151 commented 7 months ago

apparently, the music is actually randomized every time you start a battle if there is anything further to discuss on this matter, please open a new issue in the dedicated repo and we really can't be sure about the other two files unless/until they show-up...