[Idea] Unofficial Witcher 3 SDK

+

[Idea] Unofficial Witcher 3 SDK

  • I support this idea.

    Votes: 33 94.3%
  • It's a waste of time.

    Votes: 2 5.7%

  • Total voters
    35
[Idea] Unofficial Witcher 3 SDK

Hey guys!

Lately I've been trying to analyze how much The Witcher 3 can be modded using the official mod kit and community tools.
I managed to bring the old AsWing AS3 components into the game and wanted to generate a property sheet for every Witcher Script class so they can be modified from inside the game.
But realized many crucial classes are not available to the scripting engine. I came to the conclusion that the available tools are not just *enough*. Witcher Script is limited in the number of classes available, and modifying game content requires too much time and countless [ build the content > run the game > check if it's working > fail ] loops.

Also there isn't any cue that we're going to get the complete REDKit for The Witcher 3.
Now I want to start something big (so big that somehow feels unreachable, at least for me), so before I spend countless hours on it, I want your opinions about it.

The Proposal
The idea is to create an unofficial C++ SDK for the game. A library of c++ classes than can be used to create mods (and maybe editors/tools) for the game.
As many of you might know, there is the ScriptHookV mod for GTA V that allows developers to call in-game functions, and there are countless mods that leverage that to modify the game workings. Hooking functions is not enough for The Witcher 3 and hooking complete class information is something completely different.

Here is the process:
  1. We extract a definitions of classes, functions, and maybe other things from the game assembly. The engine can export an RTTI xml file that can be used as a base. We use the RTTI information and some reverse engineering to determine the classes, their properties and their methods. Writing some hooks to dump such information is also possible. The greatest problem here is finding out the number and types of inputs/outputs for the functions. My idea is to find and hook the constructors, then have a big hash table of address of every object created by the engine, and match register/stack info of the called functions with these addresses to determine the object types. I don't really know how feasible this thing really is.
  2. We generate a c++ shadow copy of each and every class that we have found. Maybe we can map the constructors to some factory functions. This part is mostly done with code generation, and it's probably the *easiest* part of the whole process.
  3. At game's startup we hook some functions, and using information collected with the hooks, we update our shadow classes and constructors to point to the actual game objects.


There's a great deal of reverse engineering to be done here. I have good enough experience in dealing with assembly code in x64dbg, hooking game functions in c++, and using frida toolkit for creating foreign interfaces for binary code.
I believe with collaboration, and given enough time, we can pull this thing off.

So here are my questions from the community:
  1. Is it worth the effort? At the time it is done (hopefully), are there many keen modders who are going to use this SDK thingy?
  2. What are your opinions about the process overall? Does it miss a very important detail that is going to make this whole thing a failure?
  3. Do you think there is an alternative to get what we want from the game? Maybe hacking the Witcher Script compiler to allow more modifications, or something else?
  4. Is there any chance that CDPR would take down this project legally?
 
Last edited:
1. I dunno about you all, but this game is looking pretty timeless for me. The only thing that would guarantee its timelessness would be the capacity to tweak it fairly freely without being gone so long I almost forget how to play it. PLEASE do this
 
I absolutely support this. I have a very trivial amount of knowledge and experience to contribute to the modding community, but I love programming. Since I just finished my PC yesterday, I will be playing through all of the Witcher games and, post-playthrough, I will end up modding them myself and possibly creating my own tweaks/mods. In time I hope to learn enough to contribute to this lovely community.
 
I am definitely in favour and sure hope CD Project RED won't disband such a project.
I have extremely little knowledge when it comes to coding, but better mod tools will always help.

I agree with the previous comment that this game is so good it is basically timeless. More and better mods would always be a great thing, so an unofficial SDK is a great idea!
Whether it's feasible or not I really can't say. Seems like a huge amount of work, that's for sure, so I'd try to get a good team together if I were you.
 
Hart95;n8359660 said:
Since I just finished my PC yesterday, I will be playing through all of the Witcher games and, post-playthrough, I will end up modding them myself and possibly creating my own tweaks/mods. In time I hope to learn enough to contribute to this lovely community.

Ayye! Congrats! And welcome!!
 
alialidoust;n8357470 said:
Hey guys!

Lately I've been trying to analyze how much The Witcher 3 can be modded using the official mod kit and community tools.
I managed to bring the old AsWing AS3 components into the game and wanted to generate a property sheet for every Witcher Script class so they can be modified from inside the game.
But realized many crucial classes are not available to the scripting engine. I came to the conclusion that the available tools are not just *enough*. Witcher Script is limited in the number of classes available, and modifying game content requires too much time and countless [ build the content > run the game > check if it's working > fail ] loops.

Also there isn't any cue that we're going to get the complete REDKit for The Witcher 3.
Now I want to start something big (so big that somehow feels unreachable, at least for me), so before I spend countless hours on it, I want your opinions about it.

The Proposal
The idea is to create an unofficial C++ SDK for the game. A library of c++ classes than can be used to create mods (and maybe editors/tools) for the game.
As many of you might know, there is the ScriptHookV mod for GTA V that allows developers to call in-game functions, and there are countless mods that leverage that to modify the game workings. Hooking functions is not enough for The Witcher 3 and hooking complete class information is something completely different.

Here is the process:
  1. We extract a definitions of classes, functions, and maybe other things from the game assembly. The engine can export an RTTI xml file that can be used as a base. We use the RTTI information and some reverse engineering to determine the classes, their properties and their methods. Writing some hooks to dump such information is also possible. The greatest problem here is finding out the number and types of inputs/outputs for the functions. My idea is to find and hook the constructors, then have a big hash table of address of every object created by the engine, and match register/stack info of the called functions with these addresses to determine the object types. I don't really know how feasible this thing really is.
  2. We generate a c++ shadow copy of each and every class that we have found. Maybe we can map the constructors to some factory functions. This part is mostly done with code generation, and it's probably the *easiest* part of the whole process.
  3. At game's startup we hook some functions, and using information collected with the hooks, we update our shadow classes and constructors to point to the actual game objects.


There's a great deal of reverse engineering to be done here. I have good enough experience in dealing with assembly code in x64dbg, hooking game functions in c++, and using frida toolkit for creating foreign interfaces for binary code.
I believe with collaboration, and given enough time, we can pull this thing off.

So here are my questions from the community:
  1. Is it worth the effort? At the time it is done (hopefully), are there many keen modders who are going to use this SDK thingy?
  2. What are your opinions about the process overall? Does it miss a very important detail that is going to make this whole thing a failure?
  3. Do you think there is an alternative to get what we want from the game? Maybe hacking the Witcher Script compiler to allow more modifications, or something else?
  4. Is there any chance that CDPR would take down this project legally?

What would you do? I mean, are you suggesting create like a Red Kit? (I know it wouldn't be the same but similar). If that's the case, I can assure you that many people will really appreciate your effort but i'm not sure how many people are still modding given the difficulty of doing any kind of mod without proper tools

PS: If you finally do it, consider create something with elves please :p
 
well, keep in mind that you probably wont get the amount of recognition you (guys) would deserve, because the majority of the playerbase enjoy the game as is, or just cant install mods...

But, good luck if you do it :)
 
Hi,
By calling functions, you would be able to manipulate world in game, but not like you can see technical things like areas, spawn points,... and so on ?
There won't be any "not in game"/editor UI, right ?
Still a great deal, wish you luck :)
 
Last edited:
So to clear out some confusions. Currently for someone to make any tool for this game you need to have a good reverse engineering knowledge but if we would have an sdk you wouldn't need that. Which means that this would allow creating something like EnvUI moderately easy. Also an SDK means software development kit so this is not a fancy gui like creation kit rather something like script hook for GTA V.
 
Top Bottom