Saints Row IV Is it hard-coded directly to the game exe?

Discussion in 'Ask Volition!' started by Raistin Kane, Mar 19, 2017.

  1. After a month of "studying" the game files, here some point I'm strugging with.

    1. What "audio_soundbank_load()" function purpose is supposed to be?
    I thought it was for adding soundbank without having to add its entry to "audio_banks.xtbl"...
    but what ever the soundbank have a entry or not, no sound from this given soundbank can be executed.
    It's like if the function was simply blocking the soundbank I try to call with it.

    2. I'm interresting about adding new voice soundbank...
    or at least adding new persona + voiceline combo to an already existing one.
    Since minimaul soundbank builder wasn't able to correctly repack a voice, a spent my
    pastime of the week studying the game voice soundbank files...
    and created my own "builder".(build _media.mbnk_pc, _media.bnk_pc and .lm_pc)
    I can change the wem used, the fileid, and the subtile:
    These parameter don't appear to be "hard-coded", so it work well.
    Then come the personaid and voicelineid.
    I do can change them...but thee game won't magically consider new combo as a valid one.
    I thought one of the voice/audio.xtbl files may be modified to do what I want.
    So I cleared all all entry of a given file and tested.(rinse and repeat for all)
    If "audio_banks.xtbl"(mute game) and "voice_control.xtbl"(audio position out of control) did cause some harm, all the other...
    didn't cause any!(audio_events.xtbl, audio_external_sources.xtbl, audio_line_tags.xtbl, audio_personas.xtbl, voice_script_text.xtbl, voice.xtbl, voice_script_us.le_strings, voice_us.le_strings, voice_conversations.xtbl)
    The .ctdg_pc?
    Tried it too, and the voice are still fine.
    I fear that what I try to change may be hard-coded directly to the game exe.
    Am I wrong and simply overlooked a detail?
    Update: I forgot to say that I play my sound with the "audio_play_persona_line" and/or "audio_play_persona_line_2d" function since I'm unable to get the the various "play_audio" function to work.

    3. I'm interresting about creating mission/activity look alike.(boss battle?)
    To do so, I need script objects.
    Such object are only accessible through zone files.
    The idea will be to get a new "zone" with all the object I need that I could swap when I trigger my "mission".
    Theorically, I simply need to get my zone files and name it "old zone"^"name of zone swap".
    If for exemple someone copy all the various "^dlc1_3c" (and their content), replace the "^dlc1_3c" by "^bingo123", update an asm file and pack everything...
    A new zone_swap named "bingo123" and doing the same thing as the "dlc1_3c" one should be accessible.
    but in practice, it don't work that way.
    What do I need to mod for adding new zone swap?
    Is it hard-coded directly to the game exe too?

    4. I noticed that the "soundboot.vpp_pc"(only vpp of the game containing .mbnk files) can be removed without causing any harm to the game sound.
    Do the game really use the .mbnk files? (I think not)
    Last edited: Mar 19, 2017
  2. Minimaul

    Minimaul Site owner Staff Member

    I know I don't have any tools that can do the lipsync, but was there anything else that didn't work?

    I've used my own tools personally to edit subtitles etc so I know that *should* work at least.
  3. I should have say that mine it's still "work in progress".
    Right now, it don't export the lipsync.
    Also, I have some trouble with the "unicode to game charlist" conversion require for the subtitles.
    Update: Subtitle are now correctly exported.
    Look like toadking already made the "unicode to game charlist" conversion table.
    Also, while "converting" from ascii to unicode, I was moving the bit in the wrong way:
    I was doing 110xxxxx, 10yyyyyy = xxxxxyyy yyy00000 while it should be 00000xxx xxyyyyyy

    As for your own app:
    All block data (DMVA, RIFF and VWSB)...
    should use a offset being a multiple of 2048! (800 in hex)
    Also, DMVA bloc size should also be a multiple of 2048.
    Last edited: Mar 21, 2017
  4. [V] Knobby

    [V] Knobby Volition Staff

    This isn't working as intended. There are layers of the sound engine and I hooked into the wrong one here. The intention was to just use this function to get a soundbank to load, but it isn't working properly.

    Zone swaps are not hard-coded. Most things outside of gameplay are not. Special mission things, movement, firing, ai, etc are hard-coded. For zone swaps you need to alter the grid_pc world file. That file has the information about what zones and swaps exist in the world. I think I put out the format for it at one point, but if not I can dig that up.

    This is an optimization. We found that Wwise reads the first hundred or so bytes of the soundbank file at startup and to speed it up we load the first x bytes into memory and then redirect the reads to that memory. It is just a speed optimization and will work fine without the file, just potentially slower. On a PC it is probably a negligible win.
    Raistin Kane likes this.
  5. flow754

    flow754 Modding patch tester

    Couldn't find any documentation on the grid_pc format. Seems you only made a thread about zone files.
  6. [V] Knobby

    [V] Knobby Volition Staff

    Format added
    Raistin Kane and flow754 like this.
  7. Right now, my attend to add a new zone swap cause a infinite loading screen.
    Fixed: I forgot to add the 0xFFFF value at the end of my new string in the grid_pc.

    Then come the "game crash right before to enter the game world.
    Fixed: For zone, we need to use stream_grid.asm_pc.
    Other asm will do nothing.

    Next, object and collision from the zone swap do not load, but we can see that using the zone swap caused object to dissapear (the saint tower/casino in my case)
    At this point, the icon of our weapon will be bugged and trying to quit the game( or go back to the main screen) will cause the game to stop responding.(have to kill it with task manager)

    Fixed(I guest): Not only do we need to add the value related to our zone to stream_grid.asm_pc, but we also need to add them to a second asm_pc.
    Preferably one using the same name as our zone.
    The "StubContainerParentName" of the container related to our new zone must use the name of this new asm as value. (this apply to both itself and stream_grid.asm_pc)

    Now, game crash as soon I enter the "map grid cell" related to my zone swap.
    I'm pretty sure it's because that we also need to update the corresponding .vpm_pc file.
    It appear to use similar format as vpp_pc.
    Last edited: Mar 24, 2017
  8. [V] Knobby

    [V] Knobby Volition Staff

    The vpm file is the packfile manifest. It is basically the header for each packfile so we don't have to read them individually. During development we used zpp files, which were just packfiles of individual zones. It took forever to trawl all the headers at level load, so we made this manifest. Similar in nature to the audio boot packfile. Interestingly, we include this in a packfile build, but I just loaded the game in a packfile build and never hit code that reads it. So I don't think this is a problem. Can you zip up your mod so I can investigate?
  9. I simply dupplicated the 1608^dlc1_3c files:
    The medium, h0, h1, h2, h3 lod .str2_pc and the 1608^dlc1_3c.asm_pc.
    Renamed all the 1608^dlc1_3c to 1608^k4n3_3c.
    Added the data from 1608^k4n3_3c.asm_pc to stream_grid.asm_pc.
    For finally adding the "new zone string" to sr3_city.grid_pc

    Update: I re-uploaded the the .zip.
    There was something in the stream_grid.asm_pc that I forgot to change back.

    Update 2: I re-uploaded the the .zip.(again)
    "Why didn't you provide a lua with the require city_zone_swap function call?"
    Ok, no one actually asked me this, but this would have been a good question.
    The lua I was using ended up with a lot of "garbage data/comment". ( I tested a lot of thing, not all related to zone_swap)
    I've decided to provide a new a clean one.
    Here came a "half-day nightmare"...

    First, the game didn't want to recognize my lua at all.
    My old lua was always packed in a vpp, but the new one wasn't.
    Well, I didn't know that gameplay_*.lua are only recognized if they are packed in a vpp.

    Second, city_zone_swap didn't want to "call". ( at least, the way I wanted it to)
    I use a infinte loop that show a prompt to teleport directly to the zone I try to mod. ( so I don't have to "walk all the way" at every new test)
    Placing the city_zone_swap in the same function as the teleport worked, but this was quite useless.
    Placing the city_zone_swap in the infinte loop with the teleport prompt worked too.
    This was better, but let face it triggering the city_zone_swap near every second is some what stupid.
    Once is enough.
    I tried to add variable with a if statement, so the city_zone_swap only execute one time...
    Painful (what can I say, lua isn't c++ :rolleyes:)
    After a lot of wasted time, I finally managed to get it done...
    without even needing a variable and if statement. :D
    I simply needed to call a delay, then my zone swap call...
    before entering the infinite loop!
    I will be honest, I espected that creating my new lua and getting it to work was only going to take like maybe 5 minutes.
    I didn't turn that way.

    Update 3: To avoid anyone losing their time with the .zip file, I removed the attachment from the post.
    As reported in my further post, I managed to "fix" my issue.
    Last edited: Apr 1, 2017
  10. Minimaul

    Minimaul Site owner Staff Member

    Ah. I'm doing this for headers, but not for data. I'll see if I can fix that. :)

    Edit: no, I'm doing this for data too?

    Edit edit: I think I've found where I was missing alignment. Writing some software to do soundbank comparisons to check.

    Edit edit edit: I've also found I'm not actually writing out the lipsync!
    Last edited: Mar 25, 2017
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice