SongCache Parser
- This topic is empty.
-
AuthorPosts
-
September 30, 2016 at 4:58 pm #475589
Well then! Drop me a message next time it happens. We can talk shop. ” src=”/wp-content/uploads/invision_emoticons/default_SA_smile.gif” />
September 30, 2016 at 5:37 pm #475593Will do!
September 30, 2016 at 6:48 pm #475602Wow just got a chance to pop back in on this thread and I’m so glad the x360 was made available too, as I’d like to have things where I can just drop the CON into my program without having to extract it first. Thanks!
TrojanNemo, I’m having a bit of a problem when I’m trying to parse the songcache. According to your code, one should skip the first 4 bytes, then read the next 4 bytes which should contain the total number of packages in the song cache. pksage’s format table indicates the same. Yet when I try to parse those bytes into a string and then to a number, I’m just getting a string of unreadable characters. As far as I can tell I’m using the Java equivalent methods for Covert.toInt32() and BitConverter.toString(), but nothing giving me the right number.
Any thoughts?
Also I know pksage is like super busy, but I responded to a PM he sent me asking if I still wanted the PHP code, which I do. Could you let him know?
Thanks.
September 30, 2016 at 7:27 pm #475604I can’t take a look at the code now, but off the top of my head, there’s also a byte swapping step I think you’re not doing based on what you described. That may be it. My Java only went so far as Java 101 on college about a decade ago…sooo yeah.
September 30, 2016 at 9:29 pm #475610Some things to help:
* If your songcache file is still in a CON container, the first 4 bytes will be ASCII for “CON ” (in hex: 43 4F 4E 20). If that’s the case, use C3 CON Tools to extract the cache.
* You’re not going to parse those 4 bytes into a string. Instead, they’re a bit-per-bit representation of a 32-bit integer value. You can’t use any sort of “atoi” routine, in this case.
* As Nemo mentions, there is a byte swapping step. This is because in this file format integers are represented in “big endian” order, meaning that the most significant (or “highest value”) byte is found at the end of the 4 bytes. You can read up on that stuff elsewhere, but in practical terms look at how Nemo uses his Arrange4Bytes() function.
October 1, 2016 at 2:57 am #475626I’m using the byte swapping for sure. I basically just reimplented Nemo’s code as is. However if you say the parsing as a string is unnecessary I will give that a shot and report back.
October 1, 2016 at 3:13 am #475629That seems to have been the problem. As soon as I got rid of the string parsing code and just switched to a ByteBuffer and getInt(), it gave me an actual number.
Let you know if I have any other issues.
Thanks!
October 7, 2016 at 8:50 am #475932Should of asked this earlier, but would it be possible to get the Parser.*Diff() functions? Or at least any idea on the formula for translating that to the standard 0 – 6 difficulty?
I found this information on translating the rankings, but I’m not sure how accurate it is: https://sites.google.com/site/mahoppiangoon/customrbdlc#editsongsdta
Thanks!
October 7, 2016 at 12:06 pm #475943Here’s what I’ve been using for years. Could be done neater, but it works.
October 8, 2016 at 11:35 am #475978Perfect! Thanks so much. Glad to see you guys are essentially using hard coded values as well for each instrument. Doesn’t exactly seem to be a rhyme or reason to these ranking numbers, since each rank is a range yet the game only ever displays 0 through 6. I’m sure it makes sense on HMXs end somewhere though.
October 8, 2016 at 12:40 pm #475979The values were obtained from the RB3 on disc files, so HMX uses them as well. But yeah. I agree they don’t seem to have a rhyme or reason.
Sent from my LG V10 using Tapatalk
October 8, 2016 at 7:12 pm #475992I was going to “cleverly” opine that those numbers were probably a bitmask that represented both the instrument and tier in one binary chunk of flags, but it turns out to be totally untrue. ” src=”/wp-content/uploads/invision_emoticons/default_SA_cheeky.001.gif” /> Typically what one expects “magic numbers” to be when reverse-engineering, though.
Shrouded in mystery, it is! I don’t need to manipulate them quite yet (besides testing/setting to 0 for “no part”), so I just store the raw value for now.
October 9, 2016 at 7:34 am #476019Two issues with “game_origin”…
1) What are the allowed values for this property under TU4? What am I missing here?
I have: “rb1”, “rb1_dlc”, “lego”, “rb2”, “ugc”, “ugc_plus”, “rb3_dlc”, “greenday”
Exists in the on-disc dta: “rb3” (But my attempts to shim RB3 on-disc songs into cache with edited metadata have been mixed: “dummy” appearance at best, never playable. That’s my grail!)
I’d thought that “acdc” would be in there, but it doesn’t show in the game. Is it perhaps “ac_dc”? And what about Track Packs?
2) It’s my understanding that “arbitrary” origins worked under TU3: What does TU4 provide in exchange for that loss of flexibility? Some critical fix that I’d miss if I “downgraded”?
October 10, 2016 at 2:10 am #476072MFX, All of the AC/DC track pack stuff shows up as “rb1_dlc” as far as the source is concerned. The track pack “game” is just the RB1 engine with all the AC/DC tracks included, and most people just import it into their library, so not surprised it’s categorized as DLC for RB1.
Not sure about track packs. I can tell you The Beatles show up as ugc_plus for instance, as does almost all customs. I imagine most track packs would be rb1_dlc or rb3_dlc depending on when they were released.
As for the RB3 songs, from going through the C3 code it appears that the on-disc songs aren’t in the cache, so they’re loaded in manually. I plan to do the same thing since my use of the code is primarily for building a database for my queue software as well as for a request system for our Twitch streams.
Not exactly sure what you’re going for. In my case I may not even use the game origin as we have so many customs, except maybe for organizational purposes.
October 10, 2016 at 3:07 am #476077I no longer have a separate list of what is and isn’t part of the game, as my game origin code accounts for things like the beatles customs, which I have labeled as tbrb but the game sees as ugc_plus. Everything based on RBN2 is ugc_plus, which includes new RBN stuff and all C3 and later customs, and TBRB customs.
AC/DC and all other track packs are listed as DLC, and is not sortable in game. I can sort AC/DC in my apps because it’s got ac/dc in the tile and Live in the short name But the game doesn’t sort that either.
It’s not worth it to lose the updates and fixes to the game to go back to custom sorting.
-
AuthorPosts
- You must be logged in to reply to this topic.