Sonic and Sega Retro Message Board: CPKREDIR - loading and combining mods for Sonic Generations - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 6 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

CPKREDIR - loading and combining mods for Sonic Generations New version 0.5, now for Sonic Lost World?

#1 User is offline Korama 

Posted 09 May 2012 - 10:18 AM

  • Posts: 272
  • Joined: 18-May 04
Update:
Download CPKREDIR.

Bonus: ExtractCpkMod, can be used to "convert" modded CPKs (extract only new or changed files), or to just normally extract CPK files.

The current version supports Sonic Generations and Lost World. It might also work with some more games (like Sonic 4, but not terribly useful there).

The cpkredirInst.exe program included in the package can be used to "install" or "uninstall" CPKREDIR. Basically, it patches a game exe so that it will load cpkredir.dll.
It will try to patch any exe you provide as argument (e.g. drag & drop an exe onto cpkredirInst). If you don't provide an argument (e.g. just run the program), it'll look for SonicGenerations.exe or SLW.exe in the current folder.

If you don't want to patch the game exe, you have to use the included launcher, DllInjector32. It's a little program that can be used via command line / console, but it also has a simple GUI.
Its purpose is to launch another program while injecting (=loading) one or more DLLs for it (I.e. cpkredir.dll) into memory. Note that this will not work for games that must be started by their own specific launcher. Sonic Lost World is such a case, it must be launched by Steam or it won't run.
If you have questions, just ask.



Original post:

If you're reading the Sonic Generations Hacking topic, then you've probably already heard of CPKREDIR.
If not, then it's about time.

After having written a pretty lengthy documentation for the thing (included in the download), I'm going to be brief here.
CPKREDIR intercepts CPK file read operations by Sonic Generations and redirects them to external files. This makes it possible to have the game load modified data files without the need for unpacking and repacking those large CPK archives every time. Internally, CPKREDIR actually creates virtual CPKs on the fly, or rather their most important data structures (header and table of contents). Those virtual CPKs are presented to the game and when it tries to read from them, the requested data is fetched from the original CPKs or from external user files.

Download the latest version 0.41 here.
Download the latest version here.
It comes with some files that let you play Dario FF's "Classic Sonic Adventures", after downloading his fixed files. Dario, I hope you don't mind.

Some screenshots of the console logging window with CPKREDIR running a combination of Melpontro's Wave Ocean and Megamaniscrazy's Shadow mod:
Posted Image Posted Image

Feel free to ask any questions about it here, or let me know of bugs you encounter.
This post has been edited by Korama: 29 November 2015 - 05:30 PM

#2 User is offline Dario FF 

Posted 09 May 2012 - 10:27 AM

  • Tech Support Hotline
  • Posts: 1056
  • Joined: 03-April 10
  • Gender:Male
  • Location:Mar del Plata, Argentina
  • Project:SonicGLvl

Quote

It comes with some files that let you play Dario FF's "Classic Sonic Adventures", after downloading his fixed files. Dario, I hope you don't mind.

I don't. When you posted this I was like "lolwat" since the files need swapping. Then I check inside and it supports swapping? Niiiice. I've got no time right now, but I'll surely give this a try later today.

Here's a mirror if you want of the file you uploaded, for the sake that the file uploading service doesn't delete it. If you don't like it being hosted there I will delete it.

EDIT: Out of curiosity, I see your logger detects the Sound CPKs. Does that mean there's a way to override the files inside of them?
This post has been edited by Dario FF: 09 May 2012 - 10:29 AM

#3 User is offline Korama 

Posted 09 May 2012 - 10:30 AM

  • Posts: 272
  • Joined: 18-May 04

View PostDario FF, on 09 May 2012 - 10:27 AM, said:

I don't. When you posted this I was like "lolwat" since the files need swapping. Then I check inside and it supports swapping? Niiiice. I've got no time right now, but I'll surely give this a try later today.

Here's a mirror if you want of the file you uploaded, for the sake that the file uploading service doesn't delete it. If you don't like it being hosted there I will delete it.

Thanks, for the mirror, too.
Yes, I took some inspiration from your Sonic GMI. You can now add external files to (virtual) CPKs, delete them, copy/move them and swap them.

Quote

EDIT: Out of curiosity, I see your logger detects the Sound CPKs. Does that mean there's a way to override the files inside of them?

Sure, CPKREDIR can handle all of the game's CPKs, not just the big three (bb, bb2, bb3).
This post has been edited by Korama: 09 May 2012 - 10:32 AM

#4 User is offline Turbohog 

Posted 09 May 2012 - 01:43 PM

  • Posts: 527
  • Joined: 25-June 08
  • Gender:Male
  • Wiki edits:22
This is so great and incredibly helpful. CPKREDIR makes it so much easier to mod generations and it takes so much hassle away. I love the improvements you've made and look forward to any further improvements you might make. Kudos on this Korama!

#5 User is offline Yarharhar 

Posted 09 May 2012 - 01:46 PM

  • Posts: 54
  • Joined: 20-November 06
I have a tiny suggestion. Why not use a more friendly app name?

Most of the heavily modded games out there have apps that are "<Game Name> Mod Manager" or "<Game Name> script Extender".

CPKREDIR might not fall into either of those categories, but it's already apparent to me that it is going to be a defacto requirement for people wanting to use Sonic Generation Mods. Choose a name that reflects that!

#6 User is offline Dario FF 

Posted 09 May 2012 - 03:04 PM

  • Tech Support Hotline
  • Posts: 1056
  • Joined: 03-April 10
  • Gender:Male
  • Location:Mar del Plata, Argentina
  • Project:SonicGLvl

View PostYarharhar, on 09 May 2012 - 01:46 PM, said:

I have a tiny suggestion. Why not use a more friendly app name?

Most of the heavily modded games out there have apps that are "<Game Name> Mod Manager" or "<Game Name> script Extender".

CPKREDIR might not fall into either of those categories, but it's already apparent to me that it is going to be a defacto requirement for people wanting to use Sonic Generation Mods. Choose a name that reflects that!

I was planning on rehauling SonicGMI(Sonic Generations Mod Installer) to use this instead. It would have a GUI for selecting mod order, enabling/disabling, etc. Unless you have a better idea for a name, but it would essentially be a GUI over CPKREDIR to edit the INI and easy to use for end-users.
This post has been edited by Dario FF: 09 May 2012 - 03:04 PM

#7 User is offline Korama 

Posted 09 May 2012 - 03:15 PM

  • Posts: 272
  • Joined: 18-May 04

View PostTurbohog, on 09 May 2012 - 01:43 PM, said:

This is so great and incredibly helpful.

Thank you. :)


View PostYarharhar, on 09 May 2012 - 01:46 PM, said:

I have a tiny suggestion. Why not use a more friendly app name?

Most of the heavily modded games out there have apps that are "<Game Name> Mod Manager" or "<Game Name> script Extender".

CPKREDIR might not fall into either of those categories, but it's already apparent to me that it is going to be a defacto requirement for people wanting to use Sonic Generation Mods. Choose a name that reflects that!

Good point. I'm not that happy with the name myself, I simply chose it because it has 8 letters like "imagehlp" (the DLL it replaces in Sonic Generations' import list) and still describes what it basically does.
Anyway, Dario was offering from the start to make a GUI, so I leave it to him or any other GUI programmer to come up with a more catchy name.

#8 User is offline Azu 

Posted 09 May 2012 - 03:22 PM

  • I must be stupid.
  • Posts: 1527
  • Joined: 23-February 08
  • Gender:Male
  • Location:Home
Well, for GTA4, you have OpenIV, and SparksIV for modding and replacing GTA4 files. So, maybe something like the following:

SonicTools
GenerationsTools
SonicModInstaller (SMI)
Sonic Generations Mod Installer (SonicGMI/SGMI)

#9 User is offline Caniad Bach 

Posted 09 May 2012 - 03:25 PM

  • is a peanut
  • Posts: 1853
  • Joined: 18-March 10
  • Gender:Not Telling
  • Location:Cymru
I think SonicGMI sounds like a good choice.

#10 User is offline iGamr 

Posted 09 May 2012 - 05:46 PM

  • Posts: 547
  • Joined: 16-April 12
  • Gender:Male
This is AMAZING! Great job, man!

#11 User is offline Dark Sonic 

Posted 09 May 2012 - 06:43 PM

  • Posts: 11328
  • Joined: 21-April 06
  • Gender:Male
  • Project:Working on my art!
  • Wiki edits:10
Oh god this is a thing? That's fantastic now I can start throwing in mods all over the place. Metal Sonic in (eventual) unleashed levels? Yes. Very yes.

#12 User is offline Lobotomy 

Posted 09 May 2012 - 09:48 PM

  • 35% Cognac
  • Posts: 4397
  • Joined: 22-March 06
  • Gender:Male
  • Location:Traverse City
  • Project:Project: Matter/Energy
  • Wiki edits:94
<3333333333333333333333

#13 User is offline Josh 

Posted 09 May 2012 - 11:17 PM

  • TGC Warrior
  • Posts: 1364
  • Joined: 22-January 08
  • Gender:Male
  • Location:USA
  • Wiki edits:1
With tools like this becoming available and the game getting cracked open more and more, we really should set up a database for Generations mods that are compatible with this. I'd love to try some of the character swaps and whatnot, and having 'em all in one place would be really nice.

#14 User is offline DinnerSonic 

Posted 11 May 2012 - 03:48 AM

  • Never Posting Since 2004!
  • Posts: 178
  • Joined: 11-April 04
  • Gender:Male
  • Location:West Virginia, United States of America
First of all, well done on CPKREDIR, I've already managed to toy around and test tiny experimental things that would be quite a pain if I had to actually repack the files each time. I'm far from a pro or anything(I mostly tried to fool with Sonic's XML file to see if I could get any crazy wall running trickery by changing slope detection, but I couldn't get it to work. I also got Classic Sonic into the Wave Ocean mod, which didn't really let him go far) but it's much more encouraging to try to toy around now.

Might I suggest though that you try to have the game redirect to an alternate save file when using it? This would likely tend to be one with everything unlocked for easier access and help keep players from overwriting things like their best scores and times with ones done on modified stages with modified character stats, but it could also help if you load an eventual full game mod that replaces Red Ring locations and the like, so you could recollect those in the mod even if you have a 100% save file.

I guess this could be done simply by renaming save files or such in Windows directly, though.

#15 User is offline Korama 

Posted 11 May 2012 - 08:54 AM

  • Posts: 272
  • Joined: 18-May 04

View PostDark Sonic, on 09 May 2012 - 06:43 PM, said:

Oh god this is a thing? That's fantastic now I can start throwing in mods all over the place. Metal Sonic in (eventual) unleashed levels? Yes. Very yes.

Yes, that should be easily possible. Great signature pic, by the way.


View PostJosh, on 09 May 2012 - 11:17 PM, said:

With tools like this becoming available and the game getting cracked open more and more, we really should set up a database for Generations mods that are compatible with this. I'd love to try some of the character swaps and whatnot, and having 'em all in one place would be really nice.

Indeed, somebody with some time on their hands could make a website or at least a new thread with links to mods. There are a couple of download links on youtube and on a few forums here and there, but that's much too unorganized.

View PostDinnerSonic, on 11 May 2012 - 03:48 AM, said:

First of all, well done on CPKREDIR, I've already managed to toy around and test tiny experimental things that would be quite a pain if I had to actually repack the files each time. I'm far from a pro or anything(I mostly tried to fool with Sonic's XML file to see if I could get any crazy wall running trickery by changing slope detection, but I couldn't get it to work. I also got Classic Sonic into the Wave Ocean mod, which didn't really let him go far) but it's much more encouraging to try to toy around now.

That's nice to hear, as it was one of my main reasons for starting CPKREDIR. I like to try mods or even toy around with some files myself, but the need for backing up gigabytes of original CPKs and rebuilding new ones all the time really turned me off.

Quote

Might I suggest though that you try to have the game redirect to an alternate save file when using it? This would likely tend to be one with everything unlocked for easier access and help keep players from overwriting things like their best scores and times with ones done on modified stages with modified character stats, but it could also help if you load an eventual full game mod that replaces Red Ring locations and the like, so you could recollect those in the mod even if you have a 100% save file.

That's actually a good idea. When I was recently playing around with modern Sonic in classic Sonic levels, I noticed the issue when "ruining" some of my fastest classic Sonic times.
As far as I know, Sonic Generations doesn't do the save file access itself, but uses the Steam API for that. I'm not sure if I should mess around with that. It should be possible, though.
This post has been edited by Korama: 11 May 2012 - 08:56 AM

  • 6 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

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