Yes, I did read the source code. I'm not trying to belittle your efforts or anything (no, seriously, that mod is really impressive). I made a mistake. I fucked up.
I'm glad it happened with something petty like Sonic hacking. I've learned that I should probably ask people how their code works when I'm not sure. I've learned, from making that mod loader, how a larger project is structured, how a GUI is programmed, and a lot of stuff about programming in general. I did not have that experience when I started. It was dumb of me to not build off of existing work, but I honestly tried to understand MainMemory's mod loader, and a lot of what I saw flew over my head.
I came to the conclusion I did with MM's loader from the Wiki article and trying to read the source code. I didn't have the 2004 version of SADX or the PC version of SA2, so I couldn't test out these features myself. I came to the conclusions I did from the Wiki page and the source on GitHub. I was aware that it touted features like "Data Patching" and "Call Insertion", which sounded like things I wanted, but I couldn't figure out to what extent they worked. Looking at the source code. I looked at the "SADXModLoader.h" file, which is the public API for mods. In sadx-mod-loader
for instance, I see a lot of specialized functions like "PlaySound" or "GiveLives". That seemed to be a list of internal functions within SADX that I could call from my DLL. Fine, but not what I need. I can see that sadx-mod-loader
did include a WriteCall() and WriteJump(). In hindsight, I should have noticed that.
But looking at all the functions above, I came to the incorrect
conclusion that only dealt with memory stuff. I'm not sure why I came to this conclusion. I made a really dumb mistake.
I apologize for it. I came to the "it acts like a debugger" conclusion because debuggers do exactly what this mod loader is doing. It writes memory in running processes. It can even rewrite code. (That's a feature of the Cheat Engine I've used extensively during file format research.) I'm pretty sure it even uses the Win32 debugging API for hooks and WriteProcessMemory and the like. My only guess as to how I missed this blatantly obvious thing
was that, when I started working on my mod loader, I had no idea how large code bases worked. I had no idea how to read
a large code base. I had no idea where to even start looking. Even if I wanted to use a debugger, it wasn't like I could test it with anything. Not understanding what I was looking at was a bad reason to draw these conclusions.
I should have looked at the source code of other mods
. I did not follow the SADX mod community closely, because I didn't own SADX. I had no idea how much wonderful effort they were pouring into that game.
As far as your SA2 multiplayer mod, yes, obviously I'm aware that it supports 2 players. I am not diminishing the effort you put into your work at all.
That is an amazing technical achievement. I just assumed you went around doing it a different way. I read from the mod's GitHub page that it used to be a separate program, and then it used the mod loader to leverage player input values for synchronization. I assumed
, from this, that it did all the networking stuff in it's DLL and it used the mod loader's (and previously just raw memory writing through the Win32 API) abilities to update it's position, animation, and rotation values of the 2P object when the game was in 2P mode. (Not sure why I said "inject a new object".) From the YouTube video on your forum thread, it didn't seem to present any new UI features or otherwise appear to be modifying the game's original code in any way. I will admit I did not look closely at the mod's source code. This was a mistake.
I was not aware of the fact that it needed to hook in calls. I assumed that it was using the memory writing function calls I was aware of to do it's work. I was also not aware of the existence of your palette lighting mod. I apologize for dragging you into this mess, Morph.
I had no way of testing either the mod loader or any mods, so I did not know what MM's mod loader was capable of. It was dumb of me to not trust the Wiki article. It was dumb of me to not even see what was capable by checking out other mods.
I assumed that my weird solution would have been more capable and simpler to implement. At it turns out, none of those things were true. I underestimated the effort that my mod loader would require. Look, I messed up. I sucked at reading source code. There is absolutely no defense for everything I've overlooked
and I apologize because of it.
But before doing this, I had never written a program longer than 500 lines or so. I think, even if I knew that MainMemory's mod loader would have worked perfectly, that I would have tried my own way anyways. At the time, I had no idea where to even start
hacking on a large code base. I had no clue how to port MM's mod loader to a new game. The code base was daunting to me. I even tried compiling it, but for some reason I couldn't get that to work. Even if I really wanted to use MainMemory's mod loader, I don't think I had the ability to do so. (I mean, look, I somehow managed to consistently overlook exactly what I was looking for.) I'm doing this Sonic R hacking stuff as a learning exercise, as recreation. Even if I'm doing this in the dumbest way humanly possible, I'm learning from it. I'm not trying to insult anyone here. I'm not intentionally making it sound like these things aren't impressive, or capable. I just made some really, really dumb assumptions, but I've learned from my mistakes.
This mod loader has taught me how GUI programming works, how to track bugs, how to use version control, how to use a debugger, how to manage projects with multiple files... I needed do something like this.
I'll try to keep you guys more in the loop with what I'm doing in the future. I'll research my options before jumping onto the not-invented-here bandwagon. I'll ask if need help understanding somebody's code. And, probably most importantly, I won't fabricate dumb assumptions that put down other people's work. I feel incredibly sorry for my actions. I will, however, keep working on this Sonic R stuff. ...mostly because I'm too deep into it to quit now. Also, apologies for causing a drama storm. I just want to move on.
EDIT: Cut out some text, rephrased, etc.
This post has been edited by InvisibleUp: 20 February 2017 - 02:06 PM