Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Pillars of Eternity Coding/Hacking Thread

fanta

Arcane
Joined
May 3, 2012
Messages
509
BTW I fixed the bug with my inventory mod, I changed the BaseInventory max size to 96 and I changed the method I used to push the bytecode onto the stack

http://www.upload.ee/files/4265054/Assembly-CSharp.rar.html

If you don't want to code in IL, you can use Reflector with Reflexil plugin and write snippets in C# which will then be injected into the assembly.

EDIT: Reading the branched coding thread, the suggestion has already been made.
 
Last edited:

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,859
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
Yeah I will do that when I want to make bigger changes, the reason I did it in IL was because Reflexil was giving me an error. Now I know why though.
 

mutonizer

Arcane
Patron
Joined
Sep 4, 2014
Messages
1,041
Interesting stuff though, overall, way beyond my ability to comprehend :)

Had some good fun changing couple things for personal use however: Gdrive link
  • 16 slots inventory per actor (like Sensuki, and had the maxsize changed already)
  • 3 weapon set (4 if Aumaua)
  • Party manager enabled, can be accessed via console (open it and type it: manageparty), make sure you do it one by one and accept, or it bugs easily. Also breaks easily with save/load since it's all fucked up for now.
  • Rest anytime, anywhere, even without supplies
  • Recruit adventurers up to your level for insignificant cost
  • Can zone while in combat (won't reset area so when you zone back in, stuff will still be there and aggro)
  • Edit, forgot to add: Take items from stash at will, anytime, anywhere (LOVE that one!)
Finally able to make my full paladin party and whatnot :)
 

SymbolicFrank

Magister
Joined
Mar 24, 2010
Messages
1,674
This game will be highly moddable.. new content though? That's gonna be rough with those Isometric texture backgrounds..
Mods won't be compatible with one another, though. Pick one, and only one, or roll your own.
 

SymbolicFrank

Magister
Joined
Mar 24, 2010
Messages
1,674
So a couple things here.. Not sure what you mean by composability but your definitely right that we will not have a modular way of patching in AI code unless we write our own environment bed.. We could construct an interface or generic loader that allows us to supply AI objects that can be external to the code and we just patch over those external objects..

Like the difference between PoE and those other examples is that we have direct access to the source code.. So we can do whatever we want. How much time and work it will take.. is a different story.

Already I see the problem coming up where mods will be shitting on each other. All the code changes being made currently by Sensuki and friends are just using reflex to hot patch code changes into the assembly-CSharp .dll. This is the wrong way to release mods so we are going to need a Weidu type hook / patcher that supports modular code swaps instead of just swapping entire .dll's..

Bearing in mind that.. I am not in the beta so I haven't seen the code yet and I don't believe their AI system has even been implemented so we have no idea how it will work yet. The current AI could just be hacked in or filler code until they finished that framework.
What we need is an API, but that only works if the existing code uses that as well. Which it doesn't.
 

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,070
Location
Safe Space - Don't Bulli
So a couple things here.. Not sure what you mean by composability but your definitely right that we will not have a modular way of patching in AI code unless we write our own environment bed.. We could construct an interface or generic loader that allows us to supply AI objects that can be external to the code and we just patch over those external objects..

Like the difference between PoE and those other examples is that we have direct access to the source code.. So we can do whatever we want. How much time and work it will take.. is a different story.

Already I see the problem coming up where mods will be shitting on each other. All the code changes being made currently by Sensuki and friends are just using reflex to hot patch code changes into the assembly-CSharp .dll. This is the wrong way to release mods so we are going to need a Weidu type hook / patcher that supports modular code swaps instead of just swapping entire .dll's..

Bearing in mind that.. I am not in the beta so I haven't seen the code yet and I don't believe their AI system has even been implemented so we have no idea how it will work yet. The current AI could just be hacked in or filler code until they finished that framework.
What we need is an API, but that only works if the existing code uses that as well. Which it doesn't.

But we have the source code.. we can patch in any hooks we want.. Also you can always do code injections even if that wasn't the case to hook your code into the existing methods..

None of this stuff is new or difficult. For C# or Java you can simply inject classes or methods into the IL/Bytecode and add a @Before and @After call to your code blocks.. or just subsitute the method call completely.. it's all fully decompilable.

For C++ you just need to hook in a few detours and from there you can write a .dll file that has callable methods.. This is how D2Hackit and many code injections work.


This game will be highly moddable.. new content though? That's gonna be rough with those Isometric texture backgrounds..
Mods won't be compatible with one another, though. Pick one, and only one, or roll your own.

Again this isn't fully correct.. Mods will step on each other if we are just patching in code to the CSharp Assembly.. which is what i was currently working on.. it's a heuristic nightmare trying to get a proper changeset that compiles in the same method though so I have abandoned that idea (Although it did work if the mods never touched the same code)..

As I said before the best way is going to be creating hooks into the code you want and allowing a user to easily define new objects that get generated through reflection or dataloaders and passed into the main game, so you can regulate and moderate all the mods with a patcher tool.
 

SymbolicFrank

Magister
Joined
Mar 24, 2010
Messages
1,674
But we have the source code.. we can patch in any hooks we want..
Sure, bar new assets we can do whatever we want. No limits.

Also you can always do code injections even if that wasn't the case to hook your code into the existing methods..
Hm, let's see...

Yes, you're totally right. It only requires the target runtime to be exactly the same as the one you used to build your new code to be injected. Or, in other words: without any other mods.

None of this stuff is new or difficult. For C# or Java you can simply inject classes or methods into the IL/Bytecode and add a @Before and @After call to your code blocks.. or just subsitute the method call completely.. it's all fully decompilable.

For C++ you just need to hook in a few detours and from there you can write a .dll file that has callable methods.. This is how D2Hackit and many code injections work.
I agree, no problems there, as long as your target code stays the same. No updates, no other mods.


Mods won't be compatible with one another, though. Pick one, and only one, or roll your own.
Again this isn't fully correct.. Mods will step on each other if we are just patching in code to the CSharp Assembly.. which is what i was currently working on.. it's a heuristic nightmare trying to get a proper changeset that compiles in the same method though so I have abandoned that idea (Although it did work if the mods never touched the same code).
Exactly.

As I said before the best way is going to be creating hooks into the code you want and allowing a user to easily define new objects that get generated through reflection or dataloaders and passed into the main game, so you can regulate and moderate all the mods with a patcher tool.
What you're proposing is writing a generic API. No problem there. Can be done.

Then again, how are you going to get every other modder on this planet to use your API, instead of just modding whatever code of the base game?


Thinking of a solution? Easy. Implementing that solution? A bit harder. Selling it to everyone involved? Only the very best are to have some hope of succeeding.
 

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,070
Location
Safe Space - Don't Bulli
But we have the source code.. we can patch in any hooks we want..
Sure, bar new assets we can do whatever we want. No limits.

Also you can always do code injections even if that wasn't the case to hook your code into the existing methods..
Hm, let's see...

Yes, you're totally right. It only requires the target runtime to be exactly the same as the one you used to build your new code to be injected. Or, in other words: without any other mods.

None of this stuff is new or difficult. For C# or Java you can simply inject classes or methods into the IL/Bytecode and add a @Before and @After call to your code blocks.. or just subsitute the method call completely.. it's all fully decompilable.

For C++ you just need to hook in a few detours and from there you can write a .dll file that has callable methods.. This is how D2Hackit and many code injections work.
I agree, no problems there, as long as your target code stays the same. No updates, no other mods.


Mods won't be compatible with one another, though. Pick one, and only one, or roll your own.
Again this isn't fully correct.. Mods will step on each other if we are just patching in code to the CSharp Assembly.. which is what i was currently working on.. it's a heuristic nightmare trying to get a proper changeset that compiles in the same method though so I have abandoned that idea (Although it did work if the mods never touched the same code).
Exactly.

As I said before the best way is going to be creating hooks into the code you want and allowing a user to easily define new objects that get generated through reflection or dataloaders and passed into the main game, so you can regulate and moderate all the mods with a patcher tool.
What you're proposing is writing a generic API. No problem there. Can be done.

Then again, how are you going to get every other modder on this planet to use your API, instead of just modding whatever code of the base game?


Thinking of a solution? Easy. Implementing that solution? A bit harder. Selling it to everyone involved? Only the very best are to have some hope of succeeding.

No I don't think so.. Anyone competent enough to write mods will see this issue instantly and naturally want a solution to it.. I agree the best api / hooking program will live and the half assed ones will die.. It's just like the IE modding scene.. WeiDu had plenty of comeptition.. The popular one is gonna depend on who supports their code the most and who keeps things open source and accessible.

Every game that has an active modding community almost universally develops a standard way of managing multiple mods in the same sand box. It will happen for PoE if people want to mod this game. Who actually codes it really doesn't matter.

Also, we can add new assets too.. how hard or easy it will be depends on how they package it.. (I am not in the beta so I can't comment on this yet)

Also the target runtime does not have to be the same as long as you are smart about how you heuristically patch methods and classes.. again the IL supplies the class and method signatures.. you just have to be smart about how you choose to hook things.

(I can supply source code or supporting material for this when I get home if you want..)
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,859
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
I'm trying to change the run speed, I've edited the runspeed value in Mover.cs but it didn't do anything, from what I can tell that should set the default run speed of all units in the game.

As far as I know I haven't seen anything invoke setRunSpeed to alter the default ?
 

mutonizer

Arcane
Patron
Joined
Sep 4, 2014
Messages
1,041

Ok so yea, changing the highlighting is pretty simple if you go broadstroke, just turn the alpha value to 0. instead of 1. in HighlightCharacter::ChangeColor, but that will remove also neutral and enemy highlighting.
Tuning down alpha to something like 0.25 or something makes it easier to the eyes though, barely noticeable, and yet noticeable for it's purpose.

The colors themselves are on the Prefabs I think, not sure. I managed to make Friendly look Greyish instead of Green/Blue, like neutrals, but that's not really the point is it?
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,859
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
Works like a charm :)

HAHA.jpg
 

mutonizer

Arcane
Patron
Joined
Sep 4, 2014
Messages
1,041
Don't care much personally, just found the huge "hey, I'm a backer NPC, come look at me!" very..intrusive.
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,859
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
mutonizer are you able to help me find what governs the right click code? I downloaded a cracked version of PE v257 bb to get the code that has working right click cancel. If you can help me find where it is I'll restore it :)
 

mutonizer

Arcane
Patron
Joined
Sep 4, 2014
Messages
1,041
No idea what you're talking about, never understood the issue you mentioned really. Cancel action always worked as I think it should (as in, press bound cancel key = it cancels current action).

Can you explain it more? So I understand?
 

Shadenuat

Arcane
Joined
Dec 9, 2011
Messages
11,977
Location
Russia
It's funny how I never noticed or even knew right mouse cancel existed or targeting circles, but only after playing PoE beta I realised that I used them in IE all the time and now can't.
Says something about Grunker's opinion that so much great stuff in IE games was the under the hood stuff.
 
Last edited:

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,859
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
I was pretty sure that right mouse button cancelled your action in v257 like in the Infinity Engine games, when you move when a character is mid animation, it cancels the action and moves instead.

In the version I downloaded it doesn't appear to be working though, but I'm positive that it was
 

mutonizer

Arcane
Patron
Joined
Sep 4, 2014
Messages
1,041
Make sure you delete your registry entries for PoE before you try that v257 though, if you changed your keybinds. Maybe it was some key configuration or something?
Tried putting move AND cancel action on the same bind?

edit: yea, with them keybinds, works just like you want I think...

To be honest though, first thing I did was remap right button to pan camera so.....never noticed :)
 
Last edited:

mutonizer

Arcane
Patron
Joined
Sep 4, 2014
Messages
1,041
Registry, but if you don't know too much about it, be careful in there.

Path is HKEY_CURRENT_USER\Software\Obsidian Entertainment\Pillars of Eternity

As for RMB binds, just you can:
1) Left click on the box you want to rebind, should put the box to "SET" or something like that
2) Hold down mouse button you want to bind, then move a couple pixel left or right and release, that should mark the bind proper.

You can also bind MB3 and MB4 but you need to edit the registry directly for that, using UNICODE equivalent (325 and 326)
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,859
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
Oh good it works now, it must have been because of the thing they did where they disabled party attack or something.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom