http://atom0s.com
Posts: 154
|
Post by atom0s on Jan 26, 2015 4:55:38 GMT 10
REHDHook is now released, check the new thread here: residentevilmodding.boards.net/thread/3269/rehdhook-direct3d-hook-plugins-addonsHello everyone, I have been working on a Direct3D hook for the Resident Evil remaster for about two days now. Which I plan to release a beta of soon but I still want to fine-tune some parts and a few more things are left to code. I hope that something like this can make modding a bit more fun and interesting for the game since I enjoy making stuff like this. What is REHDHook?REHDHook is an injected Direct3D wrapper that hooks onto the games rendering engine. REHDHook includes the following features: - In-game Console
- Scripts
- Key Bindings
- Plugins
- Addons
- Moveble Font Objects
In-Game Console
The in-game console allows users to easily and quickly interact with the game and the hook. Users can hit a predefined hotkey to cause the console to open allowing them to type in commands. While the console is open the game is no longer able to handle the keyboard messages preventing the user from accidentally doing something in-game they did not want to do while typing into the console. The console is the central hub for communicating with the hook and any loaded plugins / addons. Users can load and unload plugins and addons via the console, create or remove key binds, as well as interact with plugins/addons, the hook, and the game. Scripts
Scripts are simple text files that allow users to execute a collection of commands at a single time. Whether it be setting a handful of useful key binds at once, loading your favorite plugins / addons, or setting some configuration options. Scripts are a quick and easy way to do a lot of things all at once. Key Bindings
Key bindings let you bind a series of keys to execute a specific action. For example, in the beta version I have currently deemed 'F2' as the console key. (This will change later though.) Anytime F2 is pressed the console is toggled with the command: toggleconsole Key binds can be grouped with multiple keys, making use of the CTRL, ALT, Windows, Apps, and Shift keys. So you could bind a command to CTRL+ALT+F if you wanted to. When a key bind is pressed, REHDHook blocks the game from ever receiving the key presses so that there is no conflict with the game. Plugins / Addons
REHDHook offers a full plugin interface to communicate with the hook. Plugins are loaded directly into the game allowing users direct access to the games memory. With plugins, you have full access to the hooks various interfaces allowing you to interact with the hook as well, even other plugins. Addons are through a plugin called 'Addons'. Addons expose the hooks plugin interface to Lua scripts allowing people whom do not know C/C++ (or any other language that can use a C interface) to create extensions for the game as well. Pretty much everything that a plugin can do can be done inside of a Lua addon. Movable Font Objects
REHDHook comes with a unique font engine that allows you to create objects that are highly customizable. The font objects can act as buttons with callbacks as well allowing users to create more in-depth objects that can be used to interact with the game. The font objects can be parented with another object allowing them to move together, as well as be anchored to another ensuring they stay together in the exact location you want them to. Beta Screenshots
Here are some beta screenshots / vids of the hook currently. i.imgur.com/KxxaycT.jpg - Font object stress test. 1000+ font objects with no slow-down. i.imgur.com/1GfT1QU.png - Example of the console. i.imgur.com/jfTz40D.png - Attempting to close the game window shows this popup just in case you closed by accident. www.dropbox.com/s/anrju4cvisi3xlw/rehdhook_v1.mp4?dl=0 - A short video showing the movable font objects. I will continue to post here with progress reports and more beta information as I go along. Today is going to be a non-development day since weekends are typically time with my partner.
Feel free to leave some feedback, comments, questions, suggestions, etc. that you may have.
|
|
SetMode : Enraged Mad Dog ---> SetMode : Ok
Posts: 367
|
Post by CodeMan02Fr on Jan 26, 2015 5:16:45 GMT 10
nice idea you have there, good luck on this tool !!!
|
|
http://atom0s.com
Posts: 154
|
Post by atom0s on Jan 26, 2015 17:17:11 GMT 10
Another update for tonight, got plugins working and created the 'Addons' plugin that exposes Lua to REHDHook. Beta screenshot: i.imgur.com/IQpn6mh.pngNext up is creating some various bindings for Lua to use to interact with the game and the hook. Afterward, a bit of code-cleanup then I will be posting a beta release for people to use out.
|
|
Posts: 111
|
Post by 80t on Jan 26, 2015 17:53:25 GMT 10
Is it possible with this tool to somehow alter game's control layouts ? For example game defaults the "Cancel" action to "B" button on the XBOX360 Controller no matter the layout... I would like to make "X" (run) to also be "Cancel" command for example. Or to swap LB/RB (Change Aim/Map) commands but without also changing LB/RB (Zoom In/Zoom Out)... Those are just 2 examples. I would like to know if there's possible to do a full controller layout customization using this tool along with some plugins/scripts. Also would it be possible to alter the UI to fit the user made changes ?
Hmm... just seen that screenshot and made me remember a topic where someone asked if that's possible to make a Map Marking Mod... Would that be possible... ? I'd imagine that it would go like this: Player finds a "sweet spot" on the map, opens the map, brings up the console, take his location (the player arrow coords on the map) and add a UI element (Text or chose from a collection of small Icons or something) on that location to always be visible when the Map is accessed at future times. Maybe these user created elements could also be categorized and shown/hidden all/category through again some custom made UI elements... ? So for the start, this mod would have some UI elements that would Allow the player to add/delete elements and show/hide all/categories... also lock/unlock elements position on screen. Just an idea...
|
|
http://atom0s.com
Posts: 154
|
Post by atom0s on Jan 26, 2015 18:45:30 GMT 10
Is it possible with this tool to somehow alter game's control layouts ? For example game defaults the "Cancel" action to "B" button on the XBOX360 Controller no matter the layout... I would like to make "X" (run) to also be "Cancel" command for example. Or to swap LB/RB (Change Aim/Map) commands but without also changing LB/RB (Zoom In/Zoom Out)... Those are just 2 examples. I would like to know if there's possible to do a full controller layout customization using this tool along with some plugins/scripts. Also would it be possible to alter the UI to fit the user made changes ? Hmm... just seen that screenshot and made me remember a topic where someone asked if that's possible to make a Map Marking Mod... Would that be possible... ? I'd imagine that it would go like this: Player finds a "sweet spot" on the map, opens the map, brings up the console, take his location (the player arrow coords on the map) and add a UI element (Text or chose from a collection of small Icons or something) on that location to always be visible when the Map is accessed at future times. Maybe these user created elements could also be categorized and shown/hidden all/category through again some custom made UI elements... ? So for the start, this mod would have some UI elements that would Allow the player to add/delete elements and show/hide all/categories... also lock/unlock elements position on screen. Just an idea... Yes both are possible, just not something I have planned personally. But with the plugin system being exposed, the map idea should be doable from a plugin or addon. The controller mapping thing I can look into at a later time but for now it is not a focus. Another beta update; plugins and addons are working. Here is an example of an addon script displaying the players current health on screen and updating live: i.imgur.com/bjUjtG4.pngThe script doing this is: pastebin.com/yfqLdd9D
|
|
Posts: 111
|
Post by 80t on Jan 26, 2015 21:15:57 GMT 10
Is it possible with this tool to somehow alter game's control layouts ? For example game defaults the "Cancel" action to "B" button on the XBOX360 Controller no matter the layout... I would like to make "X" (run) to also be "Cancel" command for example. Or to swap LB/RB (Change Aim/Map) commands but without also changing LB/RB (Zoom In/Zoom Out)... Those are just 2 examples. I would like to know if there's possible to do a full controller layout customization using this tool along with some plugins/scripts. Also would it be possible to alter the UI to fit the user made changes ? Hmm... just seen that screenshot and made me remember a topic where someone asked if that's possible to make a Map Marking Mod... Would that be possible... ? I'd imagine that it would go like this: Player finds a "sweet spot" on the map, opens the map, brings up the console, take his location (the player arrow coords on the map) and add a UI element (Text or chose from a collection of small Icons or something) on that location to always be visible when the Map is accessed at future times. Maybe these user created elements could also be categorized and shown/hidden all/category through again some custom made UI elements... ? So for the start, this mod would have some UI elements that would Allow the player to add/delete elements and show/hide all/categories... also lock/unlock elements position on screen. Just an idea... Yes both are possible, just not something I have planned personally. But with the plugin system being exposed, the map idea should be doable from a plugin or addon. The controller mapping thing I can look into at a later time but for now it is not a focus. Another beta update; plugins and addons are working. Here is an example of an addon script displaying the players current health on screen and updating live: i.imgur.com/bjUjtG4.pngThe script doing this is: pastebin.com/yfqLdd9DThat's great news. About the health display script... few questions... Can it be done with custom fonts ? Not only fonts from the game itself but also system fonts or custom user made fonts... ? Can the script be altered so it will scale whatever max health particular characters have (1400 Chris for ex.) to the 0 - 100 HP percentage ? So no matter if Jill has ex. 900 and Chris has ex. 1400, the max health value will be 100% (HP) This means that Jill's 450 will be 50HP while Chris's 350 will be 25HP
|
|
SetMode : Enraged Mad Dog ---> SetMode : Ok
Posts: 367
|
Post by CodeMan02Fr on Jan 26, 2015 23:59:58 GMT 10
another question on health and lua script : can it also write memory value like a trainer ? for example to allow infinite health ? if so it is an awasome idea!
|
|
http://atom0s.com
Posts: 154
|
Post by atom0s on Jan 27, 2015 3:48:02 GMT 10
That's great news. About the health display script... few questions... Can it be done with custom fonts ? Not only fonts from the game itself but also system fonts or custom user made fonts... ? Can the script be altered so it will scale whatever max health particular characters have (1400 Chris for ex.) to the 0 - 100 HP percentage ? So no matter if Jill has ex. 900 and Chris has ex. 1400, the max health value will be 100% (HP) This means that Jill's 450 will be 50HP while Chris's 350 will be 25HP Yes, any font on the system can be used. However, in-game fonts cannot be used since it does not work that way. There is a method 'SetFont' that allows you to make use of any system font though. (As well as any size.) Also yes, you can convert the raw value to a percentage. You just have to know which character is currently being played and do the math from that. another question on health and lua script : can it also write memory value like a trainer ? for example to allow infinite health ? if so it is an awasome idea! Yes, scripts have full access to the games memory. Reading, writing, as well as scanning for signatures/patterns.
|
|
Website Founder
Posts: 7,798
Original Join Date: Sep 28, 2007
|
Post by Wizard on Jan 27, 2015 4:23:12 GMT 10
This is an awesome idea, I can't wait to see what experienced scripts / coders can manage to pull off with this!
|
|
Posts: 111
|
Post by 80t on Jan 27, 2015 5:45:54 GMT 10
More questions Does this tool also allow image files to be inserted in the game, or only text ? Something like small icons, text frame, text background... Will it be possible to open/edit/save/close/reload a script from within the console while ingame ? Ex. open mapmark.lua, do your editing, save, reload...
|
|
http://atom0s.com
Posts: 154
|
Post by atom0s on Jan 27, 2015 11:20:57 GMT 10
More questions Does this tool also allow image files to be inserted in the game, or only text ? Something like small icons, text frame, text background... Will it be possible to open/edit/save/close/reload a script from within the console while ingame ? Ex. open mapmark.lua, do your editing, save, reload... Yes, you can use an image with a font object. The font objects I wrote are comprised of two parts: - The font itself. - A "primitive" object that sits behind it. Typically the primitive object is used to have a background for the font, however you can use an image instead of a raw color allowing you to create a more detailed object. This is code from another project of mine, here are a few examples of what can be done with the font objects if you take the time to do a bit of work with them: i.imgur.com/IdWRKQF.png - A plugin called 'Greed', Shows a party in a grid fashion, similar to the Grid addon for WoW. From a plugin called Deeps that tracks party members DPS similar to Recount for WoW. i.imgur.com/ERMm0GZ.pngi.imgur.com/Rscg6Iy.pngi.imgur.com/JYanw3U.pngThese were written as plugins and not addons though since the addons do have 1 limitation with the fonts currently. Callbacks for click events are not sent to addons since the bridge between Lua and C++ has some issues. I am working on a method to fix that though so addons can get callbacks too. But addons have full access to every other function for font objects otherwise. As for open/edit/save/close/reloading scripts, yes as well. There are commands to do all of what you mentioned. - /addon load [addon name] -- Loads the given addon. - /addon unload [addon name] -- Unloads the given addon. - /addon reload [addon name] -- Reloads the given addon. - /addon unloadall -- Unloads all currently loaded addons. - /addon list -- Lists all currently loaded addons. (Also displays useful info like their current state and their memory usage.) - /addon exec [addon name] [what to execute] -- Executes a given string of Lua code inside of the given addons Lua state. Addons are all ran in their own Lua state. There is no communication between addons directly unless you pass commands between them that the hook is told to parse. This is done to prevent 1 addon from causing others from breaking. Plugins are setup in the similar fashion. They can be loaded and unloaded freely. There is currently no reload function but the ability to do similar is there. A full list of features, commands and so on will be included in the release though to cover everything.
|
|
Posts: 111
|
Post by 80t on Jan 27, 2015 17:14:48 GMT 10
More questions Does this tool also allow image files to be inserted in the game, or only text ? Something like small icons, text frame, text background... Will it be possible to open/edit/save/close/reload a script from within the console while ingame ? Ex. open mapmark.lua, do your editing, save, reload... Yes, you can use an image with a font object. The font objects I wrote are comprised of two parts: - The font itself. - A "primitive" object that sits behind it. Typically the primitive object is used to have a background for the font, however you can use an image instead of a raw color allowing you to create a more detailed object. This is code from another project of mine, here are a few examples of what can be done with the font objects if you take the time to do a bit of work with them: i.imgur.com/IdWRKQF.png - A plugin called 'Greed', Shows a party in a grid fashion, similar to the Grid addon for WoW. From a plugin called Deeps that tracks party members DPS similar to Recount for WoW. i.imgur.com/ERMm0GZ.pngi.imgur.com/Rscg6Iy.pngi.imgur.com/JYanw3U.pngThese were written as plugins and not addons though since the addons do have 1 limitation with the fonts currently. Callbacks for click events are not sent to addons since the bridge between Lua and C++ has some issues. I am working on a method to fix that though so addons can get callbacks too. But addons have full access to every other function for font objects otherwise. As for open/edit/save/close/reloading scripts, yes as well. There are commands to do all of what you mentioned. - /addon load [addon name] -- Loads the given addon. - /addon unload [addon name] -- Unloads the given addon. - /addon reload [addon name] -- Reloads the given addon. - /addon unloadall -- Unloads all currently loaded addons. - /addon list -- Lists all currently loaded addons. (Also displays useful info like their current state and their memory usage.) - /addon exec [addon name] [what to execute] -- Executes a given string of Lua code inside of the given addons Lua state. Addons are all ran in their own Lua state. There is no communication between addons directly unless you pass commands between them that the hook is told to parse. This is done to prevent 1 addon from causing others from breaking. Plugins are setup in the similar fashion. They can be loaded and unloaded freely. There is currently no reload function but the ability to do similar is there. A full list of features, commands and so on will be included in the release though to cover everything. Sir, that is great stuff you're doing right there! I can't get a gripe of the plethora of possibilities this tool brings to this game This is the mother of awesome!
|
|
http://atom0s.com
Posts: 154
|
Post by atom0s on Jan 27, 2015 17:20:31 GMT 10
Next beta info update: i.imgur.com/JfWK7Es.png - Altered the look of the console. - Added border rendering for primitive objects. - Added exception handling to Addons plugin to prevent crashes on invalid memory read/writes from addons. - Added console history. You can now use the up/down arrows to scroll through previously entered commands. - Added various helper libraries for Lua addons to use. - Fixed a bug with the /windowtoggle function. - Added a Default.txt script that is executed automatically when the game loads. (This allows you to easily load your favorite plugins and addons automatically.) Known Issues - Trying to resize the game window via the options will cause the game to crash while REHDHook is running. (Not really a priority on fixing at the moment but will get to it sooner or later.) More to come soon. I should have a beta ready either sometime tonight or tomorrow if things go well. :: Edit :: Alright, got mouse events working inside of Lua so addons can now make fairly in depth little UIs from the font objects too.
|
|
http://atom0s.com
Posts: 154
|
Post by atom0s on Jan 27, 2015 19:54:25 GMT 10
Textures are now working properly since they were a little buggy before. Here is an example of anchoring 3 font objects together: www.privatepaste.com/8b27bb3f1e/fewgweg42www.dropbox.com/s/mg77lupau448yua/rehdhook_v2.mp4?dl=0This is to create a basic health bar. This addon shows off: - Loading a texture from disk as a background for a font object. - Anchoring multiple font objects together so they move as one. - Memory function usage. I think that covers all the last standing mini-bugs that I had found earlier.
|
|
Posts: 111
|
Post by 80t on Jan 27, 2015 19:56:50 GMT 10
Textures are now working properly since they were a little buggy before. Here is an example of anchoring 3 font objects together: www.privatepaste.com/8b27bb3f1e/fewgweg42www.dropbox.com/s/mg77lupau448yua/rehdhook_v2.mp4?dl=0This is to create a basic health bar. This addon shows off: - Loading a texture from disk as a background for a font object. - Anchoring multiple font objects together so they move as one. - Memory function usage. I think that covers all the last standing mini-bugs that I had found earlier. Oh, my... this project is on fast forward! Sweet! EDIT: Is it possible to alter the game's "native" (internal) resolution ? From what I've noticed up to this point, in it's current state the game it's rendered internally at 1920x1440 framebuffer and up/down-sampled to whatever resolution viewport you have set in your game settings... So, for ex. if you play at 1280x720 / original, you are effectively playing 1920x1440 down-sampled to 960x720, (2/1) which is both a good and bad thing depending on your "priorities"... The good part it's that is basically doing a 2xAA after already being FXAA processed, and the result looks really nice and smooth... The bad part it's that it hurts performance for lower end systems... Another thing I've noticed it's that the "Inventory Screen" is rendered at whatever resolution you have set in the game settings... which it's what I would call normal behavior... since it follows "normal rendering rules"... Again, this has an upside and few downsides. The upside it's the lower impact on system's resources (because of "normal behavior") and the downsides are poor antialiasing, and discrepancy with "the rest of the game"... Either rendering both in-game and inventory screen at native screen settings or at the same resolution as one another, would be good practices. Though the former would be more "universal system friendly"...
|
|