Sonic Heroes Hacking/Modding

Discussion in 'Engineering & Reverse Engineering' started by igorseabra4, Mar 26, 2017.

  1. ShadowBlitz

    ShadowBlitz

    Member
    12
    0
    1
    [​IMG]
    So as it turns out, Heroes modding isn't dead. I'd like to present the first serious stage import that uses publicly available tools! Only a tad bit of code and what I did code was just for end level rank scores. It took a while, but hopefully this shows that Heroes modding has come quite a long way. (and yes, for the record, I go by Shadowth117 on other sites)
    https://gamebanana.com/maps/200670

    [media]https://youtu.be/MdcqrSudtmo[/media]
     
  2. Josh

    Josh

    Oldbie
    1,601
    217
    43
    USA
    So, I figure I'll ask here, because if anyone would know, it'd be you guys.

    On the newest update of Windows 10, using the widescreen mod, I seem to be having some frame rate issues. The game regularly drops, and stays, well below 60fps on a GTX1080. I'm capturing footage of the game for an episode, and I can go frame-by-frame to confirm this.

    I've tried running the game in compatibility mode for XP, and adjusting the render distance, neither of which seem to have made any difference. I've searched Google, and found other users with the same issue, but no solutions.
     
  3. Sewer56

    Sewer56

    Member
    33
    8
    8
    United Kingdom
    [Reloaded] Mod Loader
    Would you happen to be running Nvidia's GeForce Experience?
    While it may or may not have been fixed, it's known for causing significant framerate drops with this game - or as least has historically been known for doing so.

    There is also a known timing issue over the years where the game performs frame pacing incorrectly somewhere - I've never been able to look into it personally as the last time I've experienced it was all the way back in 2014.

    Back then, the consistent workaround for that issue has been to run the ENBSeries DX8 wrapper, which did run perfectly but had the side effect of not displaying the team members' faces on the HUD.

    You can find that wrapper here: http://enbdev.com/do...or_dx8todx9.htm
    But if you get that point, before you do that, you should try Crosire's d3d8to9 wrapper which has no visual side effects in this game: https://github.com/c...3d8to9/releases

    ---------------------------------------------------------------------------

    Edit:

    I thought that there's actually something else worth bringing up.

    When it comes to playing Heroes, I often find that people use non-stock executables for playing the game.

    Many of them will often grab it from a random source and in some cases - grab not just only a widescreen hack but also an executable containing other modifications.
    YouTubers are particularly guilty of this.

    You should use along with a stock, clean executable - such as this one without SecuROM DRM which is the one that all official Heroes re-releases seem to use and was nicely tagged by the Scene group, Reloaded in the PE header.

    For widescreen, the current preferred option is running my own set of Graphics Essentials for Reloaded Mod Loader. This solution lets you set an arbitrary resolution, gives you some options for controlling the game window and has an automatic widescreen hack which responds to window resizes in real time.

    Bear in mind that you'll probably want to set your game to windowed mode for now, I didn't implement fullscreen as I never planned to release it as I was not done with it (which is why I've not shared it on here, GameBanana or any other source). In case you are curious, setting the resolution to your display's and enabling borderless will get you the borderless fullscreen window you desire. (Edit 2: Someone apparently linked that on WSGF... fine, I'll switch back to this for ~2 hours and implement fullscreen toggle and tallscreen hack... then score out this text)


    Alternatively if you would really rather prefer a clean widescreen hack in .exe form, Jackfuste's executables are the preferred ones, though the resolutions and widescreen hack aspects are hardcoded.
     
  4. Sewer56

    Sewer56

    Member
    33
    8
    8
    United Kingdom
    [Reloaded] Mod Loader
    Okay, have you ever before noticed that Sonic Heroes takes exponentially slower to load while playing the game in windowed? What if I told you that it's not the slow loading times that are the bug; but the fast load times are the bug.

    Basically the game is meant to play the entire intro animation for the titlecard before letting the stage load continue; but because modern hardware is simply SO FAST, some stuff is done faster than the minimum time granularity the Operating System reports back to the game.

    This actually causes two different titlescreen functions (which I assume are for interpolation) to receive the same system time when they should not, and the game skips the entire intro sequence.
     
  5. Josh

    Josh

    Oldbie
    1,601
    217
    43
    USA
    Thanks, that seems to have done the trick!

    I know, my profession is the scum of the earth. :P I used the widescreen fix that was, until a few days ago, the only one linked on the PC Gaming Wiki. (Namely this one.) Will that cause serious issues, or should I try to find a better option?

    Seriously, thank you for the help! I couldn't find this info anywhere!
     
  6. Sewer56

    Sewer56

    Member
    33
    8
    8
    United Kingdom
    [Reloaded] Mod Loader
    Hahah, don't worry - I love geeking while you're critiquing.
    I'd probably go on PCGW myself if I was going to play an older game for the first time on a PC.

    The updated version of ThirteenAG is absolutely fine as a widescreen hack; it's relatively quite barebones and it basically runs on a mini mod loader of its own - a generic DLL injector (with DLLs renamed .asi) which is very similar to what I do under the hood.

    There are no culling issues or side effects to it - both the recipient view window (as RenderWare calls it) is squished to render more on the sides and the camera's perspective clip planes (used for object culling) are patched to accomodate more objects on the side provided you update the ThirteenAG download, you get pretty much just enough/what you need to play the game in fullscreen. If what you want is just a very simple widescreen hack, then it works fine.

    On the negative side, there is no Y scaling, "tallscreen hacking" as I call it (or any other goodies), resulting in this once you go below 1:1 aspect:
    [​IMG][​IMG]

    Left: Thirteen AG | Right: Sewer56 Graphics Essentials and/or Jackfuste Patched EXE

    (This phone aspect/resolution would not work on any widescreen hack other than mine as I hacked a workaround round it; The game queries the window size and fails on an internal RenderWare function; the game would crash the moment you load the titlecard).

    (In short: No visual artifacts on ThirteenAG, does its job as expected. Behaviour is correct so long as you play widescreen - no extra goodies/options though :/)

    As an extra note, for the sake of comparison, the improvements that my own solution has over ThirteenAG are the following (at the time of writing):

    - Y-Scaling (as seen in the spoiler).
    - Hack for extreme aspect ratios, tested it with 172.8:9 and beyond [that said, it looks exactly like you'd expect at that aspect].
    - Borderless windowed (optional)* [see footnote].
    - Resizable windowed (with real time aspect ratio adjustment).
    - Disabling frameskip and playing 2P at 60FPS.
    - Hack for stupidly fast load times.
    - Extra option for locking the game's HUD aspect for those people who desire it (default behaviour, alternate behaviour [forced 16:9 HUD - auto increased FOV to accomodate]).

    And I should probably add Field of View scaling as an option sometime soon.

    Everything aside from the widescreen hack itself is toggleable.

    * A generic borderless windowed utility would not work with Heroes as you'd expect; the game stores the resolution in memory and makes use of it between stage to menu switches - once you'd enter a stage, the area once taken by the window borders would be all black (albeit stacked at the bottom and right of the window); the result would be something that looks like this (see bottom and right).
     
  7. Eternal_Ashe

    Eternal_Ashe

    Queen Of Detailed Fanfiction Member
    Not sure if this is the right place to ask this, but this is the general Heroes modding thread so.

    Are there any tutorials/guides on how to edit the voice files? I know they're located in SH_VOICE_E.afs, but I can't figure out how to open this file, let alone replace the audio files within it. Could anyone point me in the right direction?
     
  8. MuzzarinoHez

    MuzzarinoHez

    Member
    2
    0
    1
    AFS Explorer's the tool you'll need to replace voices with custom ones and in-order to re-import your lines, use Pes Sound Converter to convert your lines from wav to adx and rename it to ahx or other adx container extension supported by the game.
     
    Last edited: Mar 11, 2020
  9. Sewer56

    Sewer56

    Member
    33
    8
    8
    United Kingdom
    [Reloaded] Mod Loader
    Related:

    If you're familiar with Reloaded II (the mod loader), there's a mod (which I wrote) that adds support for redirection of files inside AFS archives for other mods.
    e.g. Adding AfsRedirector/EVENT_ADX_E.AFS/0.adx to your mod would replace the 0th item in the original AFS Archive.

    The mod is truly universal, just like the mod loader. You can use it with SA2, Emulators, Heroes, anything that reads an AFS file from the filesystem.
    Source & Download: https://github.com/Sewer56/AfsFsRedir.ReloadedII#how-to-use

    For a list of resources, tools and guidelines on editing common file formats, I also wrote a short guide on Gamebanana.
     
  10. MuzzarinoHez

    MuzzarinoHez

    Member
    2
    0
    1

    Attached Files: