Sonic and Sega Retro Message Board: Sonic R Hacking - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 18 Pages +
  • ◄ First
  • 14
  • 15
  • 16
  • 17
  • 18
    Locked
    Locked Forum

Sonic R Hacking Because somebody should.

#226 User is offline InvisibleUp 

Posted 12 November 2017 - 12:33 AM

  • Posts: 97
  • Joined: 10-November 12
  • Gender:Not Telling
  • Project:Sonic Redux (Sonic R hack)
Posted Image

Took me a while to get situated with how the mod loader worked, but I've made a widescreen hack for the '04 version of Sonic R. It's actually better than the one in Sonic Redux (my contest hack), because the 2004 version has a variable for the screen X scale. This means I can actually make widescreen work when the screen is split horizontally.

But anyways, download link (with source for Visual Studio 2017) is at https://mega.nz/#!MC...uq2ImvUvW9eK950

EDIT: Updated DL link, fixed phrasing

EDIT2: Also uploaded to GameBanana (https://gamebanana.com/guis/33496) because I saw that MainMemory started a Sonic R section.
This post has been edited by InvisibleUp: 12 November 2017 - 01:32 AM

#227 User is offline MainMemory 

Posted 12 November 2017 - 01:33 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4001
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
That looks promising, although it seems from your screenshot that certain graphical elements are not properly adjusted. I'd like to see this polished and implemented directly into the mod loader, if that's alright with you.


In other news, I did a music mod. It replaces all the music with SADX music. You can get it on GameBanana.

#228 User is offline InvisibleUp 

Posted 12 November 2017 - 01:46 AM

  • Posts: 97
  • Joined: 10-November 12
  • Gender:Not Telling
  • Project:Sonic Redux (Sonic R hack)
Alright, wasn't sure if you wanted it in the mod loader or not.

It's only really broken in 3P/4P mode, because it does some funky stuff with the aspect ratio variable I'm using. I think I know how to fix it, though.

EDIT: That was a lot easier than I thought it would be. New link: https://mega.nz/#!QX...jlzmEo_qiI2mpiQ
I simply changed it so that instead of halving the X stretch variable if it was in 3/4P mode, it halved it if the original value was already halved. Works perfectly now. I might work on adding this to the mod loader itself tomorrow.

This post has been edited by InvisibleUp: 12 November 2017 - 02:03 AM

#229 User is offline CheatFreak 

Posted 12 November 2017 - 03:48 AM

  • Everything or Nothing.
  • Posts: 52
  • Joined: 22-May 13
  • Gender:Male
  • Location:Michigan
  • Project:BetterSADX Patch

View PostInvisibleUp, on 12 November 2017 - 01:46 AM, said:

Alright, wasn't sure if you wanted it in the mod loader or not.

It's only really broken in 3P/4P mode, because it does some funky stuff with the aspect ratio variable I'm using. I think I know how to fix it, though.

EDIT: That was a lot easier than I thought it would be. New link: https://mega.nz/#!QX...jlzmEo_qiI2mpiQ
I simply changed it so that instead of halving the X stretch variable if it was in 3/4P mode, it halved it if the original value was already halved. Works perfectly now. I might work on adding this to the mod loader itself tomorrow.


I think he's also referring to the UI elements in general being positioned in the center of the screen. Ideally these elements would be moved to the edges of the screen properly instead.

Also, the change to these appropriate things should scale with the actual resolution, allowing the game to properly render at any aspect ratio ideally, but that's also a bit of work probably.

Regardless, what impressive work! I can tick this off my Sonic R Wishlist.

#230 User is offline CheatFreak 

Posted 12 November 2017 - 07:30 AM

  • Everything or Nothing.
  • Posts: 52
  • Joined: 22-May 13
  • Gender:Male
  • Location:Michigan
  • Project:BetterSADX Patch
This post has been changed significantly since it was originally posted so uh. Redownload junk if you saw it before I changed it.
Yesterday morning I posted a mod called "ADX Looped Music" which I released not knowing there was an issue with one of the included tracks. In addition I found out from MainMemory on IRC that the Saturn version of Sonic R has longer Instrumental Tracks. I also came to the decision that for a proper ADX Music mod, I shouldn't be editing in my own loops, so I've created 2 mods now instead.

So first we have the ADX Music mod.
This contains unedited ADX format encodes of the Sonic R music tracks, which takes advantage of MainMemory's implementation of bass_vgmstream in the Sonic R Mod Loader.
The main purpose of this is to replace the space inefficient (albeit lossless) *.SON files of the standard 2004 Sonic R port, and simultaneously take advantage of the capability for looping that the ADX format provides.

Download ADX Music

In addition, I'm releasing an optional mod that includes edited loops of the main 7 vocal track themes that I made yesterday. They were done by cleanly overlaying the portion of music at the end of the song where it fades out with the first few seconds of music from the start of the song, removing any silence that would ordinarily be there when the music would loop, and setting an appropriate loop point in the song.

Download ADX Music - Overlapping Fades.

I'll also post links to these on my website but uh. Not until I feel like updating my site, so it could be a day or two.
This post has been edited by CheatFreak: 13 November 2017 - 05:11 AM

#231 User is offline CheatFreak 

Posted 17 November 2017 - 11:55 AM

  • Everything or Nothing.
  • Posts: 52
  • Joined: 22-May 13
  • Gender:Male
  • Location:Michigan
  • Project:BetterSADX Patch
So I was saying I was working on a patch for Sonic R 1998 to make it into the 2004 port, and I did it.
Enjoy that for anyone interested in dabbling in Sonic R mods, this might be of use.

http://forums.sonicr...showtopic=37536

#232 User is offline Strife 

Posted 18 November 2017 - 05:36 PM

  • Posts: 1775
  • Joined: 19-October 11
  • Gender:Male
  • Location:United States
  • Project:Freedom Planet 2
I'm wondering if there are a few things in the PC version of the game that can be modded, mostly having to do with restoring elements and settings from the Sega Saturn version.

- Adjusting the camera's height and angle to roughly the same place that it was on the Saturn.
Comparison:
Spoiler

Messing around in Cheat Engine I was able to find a 4-byte value at 32D918 that adjusts the zoom level (and setting it to a negative value even acts as a look-behind camera), but no luck finding anything related to the actual position.

- Fixing/toning down the pitch modulation on Amy's car since it's way off in the PC version. Modifying the sound file's pitch is only a half solution in this regard.

- Swapping the darker backgrounds of the PC version's menu with the Saturn's brighter ones, or at least altering the palette that the PC's background uses on each screen to approximate it.

#233 User is offline muteKi 

Posted 19 November 2017 - 03:26 PM

  • Fuck it
  • Posts: 7516
  • Joined: 03-March 05
  • Gender:Male
  • Wiki edits:91
Truly lovely! Now if only there were a known way to get the lighting to resemble the software-rendered mode

#234 User is offline InvisibleUp 

Posted 20 November 2017 - 12:54 AM

  • Posts: 97
  • Joined: 10-November 12
  • Gender:Not Telling
  • Project:Sonic Redux (Sonic R hack)
Finally. Multiplayer was being a bit of a pain.

Posted Image

I've created a pull request for the mod loader, so hopefully that'll be integrated soon.

#235 User is offline CheatFreak 

Posted 20 November 2017 - 10:24 AM

  • Everything or Nothing.
  • Posts: 52
  • Joined: 22-May 13
  • Gender:Male
  • Location:Michigan
  • Project:BetterSADX Patch

View PostInvisibleUp, on 20 November 2017 - 12:54 AM, said:

Finally. Multiplayer was being a bit of a pain.

Posted Image

I've created a pull request for the mod loader, so hopefully that'll be integrated soon.

Neat, feedback time.

You may need to have a look at how you position the elements on the right side, tried running in an ultrawide resolution, and it works fine for the most part save for the map and timers on the right.

Spoiler


EDIT: Actually it doesn't seem to be working for me in 720p 16:9 either, so something must be up there, I guess.

Additionally, the "Ready, Set, Go!" elements are still off center in multiplayer mode, even in a really low widescreen resolution where your code works. :V

Spoiler


This is just another passing observation but I think however you calculate a few things must be very slightly off, I wouldn't know how exactly, but- running this code on the game in a 4:3 resolution causes some distinct mispositioning.
Spoiler


Regular Sonic R in 4:3 doesn't show the edges of the background, and everything is squished very slightly to the left.

Ideally, if your code is running while the game is in 4:3, it should be indistinguishable from when running without your code at all.
If you do that, even things like the pause menu will be properly positioned in widescreen, I'd imagine, though it definitely helps to check anyway.

The goal for implementation is for this to always work similar to SADX Mod Loader, this way your widescreen code can always run and everything will just fall into place automatically, that way you don't even need to have a toggle in the GUI for it- it'll just always run because there won't be a reason to have it not run.

Again, sorry if it seems like I'm nitpicking but I figure this feedback would maybe help this implementation get even better. :P
This post has been edited by CheatFreak: 20 November 2017 - 11:14 AM

#236 User is offline InvisibleUp 

Posted 24 November 2017 - 12:52 AM

  • Posts: 97
  • Joined: 10-November 12
  • Gender:Not Telling
  • Project:Sonic Redux (Sonic R hack)
Fixed it all. It turns out the big issue was that I had the wrong value the aspect ratio variable. Really, it's just supposed to be the window height. ...multiplied by 15/16. That fixes all the centering. The 2P not working was due to a comparison error and the right side elements being off was a side effect of me overcompensating for the incorrect aspect ratio.

The only thing that I know is broken is that the 2P HUD elements don't appear when the aspect ratio is less than 4:3. That has to do with the comparison to determine which side of the screen I'm supposed to render to, and I'm not super sure how to fix that. But I'd imagine if you're playing with an aspect ratio less than 4:3 you'd be playing it with vertical split anyways, so I'm not too concerned.

---

To avoid a double post, here's my quick and dirty plan moving forwards. I want to port Redux (well, Redux's character loader specifically) over to the mod loader, but with a little more polish. (And new models, I guess, because my custom models seemed to be the most criticized part about that hack.) Here's how I want to go about doing that.

- Create a character exporter for Blender that includes shading and animations. (The OBJ exporter I used didn't, and that's probably the biggest reason the models looked so bad, beyond my lack of 3D modeling skill.)
- Rewrite all the menus in Sonic R to be handled by a function that loads the menu data from a JSON file (or something like that) and that can be extended by other mods. (Hear me out...)
- Create a "fastlaunch" console command for Sonic R that I can feed menu options (as defined in those JSON files) and make the game instantly start up in a race or whatever.
- Make a new screen in the game that ONLY displays a character model, and add it to the menu. (This should be really simple, as it's just one function call to display the model.)
- Actually port the character loader itself (including changing the fixed-size array to a malloc'd one and a standardized character directory format, as was done in Redux)
- Put a button in the Blender addon that exports the model and launches it in the game's model viewer OR in a Time Trial race for instant feedback.
- Let the game load sound effects, textures, animation timing data, custom code, icons, attributes, etc. from the directory and remove anything hardcoded to a specific character (probably the hardest part)
- Do whatever needs to be done to let game handle an arbitrary number of characters
- Repeat for courses

I know I'm shooting super duper high here with my ambitions, but I feel the payoff would be worth it.
First off, I want to be able to distribute a character (or a course) as a mod and have it just get nicely slotted into the character select menu and work out of the box, without having to deal with replacing existing characters or anything like that.
Secondly, I want a sort of IDE-like thing where I can just press a button and instantly test out my character or course in game, without having to copy files and slog through menus.
Thirdly, having custom menus would be super useful if I wanted to add new Time Attack/Grand Prix/Multiplayer modes, the networking mode, or custom debugging screens.

If anyone's got a less insane solution, don't hesitate to speak up.
Also, for my way far off end game I want to ditch the idea of racing entirely and just make a traditional Sonic game in the Sonic R engine, with badniks and bosses and checkpoints and stuff. It would take an absolutely stupid amount of effort, but it would be fun to try.

#237 User is offline Strife 

Posted 24 November 2017 - 02:59 AM

  • Posts: 1775
  • Joined: 19-October 11
  • Gender:Male
  • Location:United States
  • Project:Freedom Planet 2
That sounds like a really cool and ambitious way to open up modding potential. I've always wondered what this game would be like with just a few more courses and features.

Would it be possible to add vehicle sounds to characters besides Amy? Imagine recreating Mario Kart or Sonic Drift through modding.

#238 User is offline McAleeCh 

Posted 24 November 2017 - 05:38 AM

  • Posts: 733
  • Joined: 12-January 03
  • Gender:Male
  • Wiki edits:27
This is amazing. My computer's out of commission at the moment and my disc drives packed up long ago, but as soon as I'm back in the game with a functioning PC and a drive that can read the disc I'm busting out my old '98 release of Sonic R (and grabbing the patch to turn it into the '04 version so that it's compatible) and checking some of this out. Proper widescreen Sonic R looks great - hoping modding for this will take off and we'll eventually see new characters/courses too! = D

Out of interest - from skimming the topic I'm sure we're not at this point yet, but in future, would it theoretically be possible to add new characters/courses in addition to those that are already there? Would be awesome to retain the base Sonic R characters/features but be able to add more user-developed characters/courses on top to expand it into a much fuller game. = )
This post has been edited by McAleeCh: 24 November 2017 - 05:38 AM

#239 User is offline MainMemory 

Posted 24 November 2017 - 11:45 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4001
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I always say, anything is possible, if you're willing to put in enough effort.

As for InvisibleUp's suggestions, I generally tend to just use a structure filled with function pointers sent as a parameter on the mod's Init function whenever I want mods to be able to modify lists cooperatively, but I'm willing to try something different.
This post has been edited by MainMemory: 24 November 2017 - 11:45 AM

#240 User is offline CheatFreak 

Posted 24 November 2017 - 11:29 PM

  • Everything or Nothing.
  • Posts: 52
  • Joined: 22-May 13
  • Gender:Male
  • Location:Michigan
  • Project:BetterSADX Patch
For those that may be interested, I've also made a cheat engine cheat table for Sonic R 2004, feel free to use it as the basis for your own stuff if you want.
Download

The codes included in Sonic R Mod Loader were found with Cheat Engine of course, so almost everything in that table is in here somehow, but as raw addresses and values with descriptions.
This post has been edited by CheatFreak: 24 November 2017 - 11:30 PM

  • 18 Pages +
  • ◄ First
  • 14
  • 15
  • 16
  • 17
  • 18
    Locked
    Locked Forum

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users

  1. Yandex