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

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,800
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
Someone able to help me increase the inventory size? I've changed the InventoryMaxSlots in the Characterstats.cs to 16, just need to get the UI to show them now, trying to find the code in among the UIInventoryxxxx stuff
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,800
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
Do you think you could get a "big inventory" mod out before launch? :P

Liston said he's already done it (changed it to 16 slots), I paged him earlier to ask how, I can't seem to find the code that makes the second row show up.

This wasn't hard to do (someone posted a mockup of this earlier)

d0emxJx.jpg
 
Last edited:

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
If people start releasing mods.. you really need to write a patcher.. Releasing entire .dll's as "fixes" will just limit peoples ability to use multiple mods because they will overwrite eachother.

Someone should write a generic patcher for those files first..
Do you think you could get a "big inventory" mod out before launch? :P

Liston said he's already done it (changed it to 16 slots), I paged him earlier to ask how, I can't seem to find the code that makes the second row show up.

This wasn't hard to do (someone posted a mockup of this earlier)

d0emxJx.jpg

Congrats you learned about string tables.. something that any software that hopes to be localized does..
Is this your first look at C# or something? :lol:

I can't wait to see the mods that come out of this.. *sigh*
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,800
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign

Why do you think Sawyer prefers classless systems?

Congrats you learned about string tables.. something that any software that hopes to be localized does..
Is this your first look at C# or something? :lol:

What? I've changed heaps of shit in the text string tables before, I only just remembered that I could make a real version of the mock up someone posted about 50 pages ago of this.

I've done Object Oriented Java at uni, C# doesn't look too hard to understand, annotations such as @Serializable is [Serializable] and there are a bunch of other differences. Anyway at least I can understand most of what I'm reading.

Still can't find where the line that controls the second inventory row is though. I've changed the max size, but I think I have to enable it on one of the UI classes.

I couldn't write a patcher though, I'm pretty shit at programming as it is. Someone else will do one.
 
Last edited:

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
Unless the AI is externalized with composable scripts (even with decompiling) it won't ever reach BG levels by modding. C# like all the other complex languages is not composable at source code level unless the code is designed for it. Meaning it probably won't be.
 

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
Unless the AI is externalized with composable scripts (even with decompiling) it won't ever reach BG levels by modding.

The AI will be externalized / decoupled in some way.. whether that means a C# API or an actual script language is yet to be seen.. but it won't matter.

Even if they use a C# API.. it can be hooked and improved as long as they don't do anything to prevent that.. like obfuscating the code.. which based on Sensuki's 1337 Text String Manipulation seems to be the case.

This game will be highly moddable.. new content though? That's gonna be rough with those Isometric texture backgrounds..
 

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
The 'problem' is that the engine they're trying to emulate has a script api that was reverse engineered to the point when the scripts were decompiled, and by a very happy accident, all that they do is to follow a heartbeat every frame for all characters from top to bottom allowing the possibility to bail out.

Which means modders could add code to the file and as long as their trigger conditions were true only occasionally their new code didn't interfere with 'old' code. It is modular in the sense that to add functional code, you don't need to touch the previous code, which is almost never the case with more efficient, function oriented languages.
 

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
The 'problem' is that the engine they're trying to emulate has a script api that was reverse engineered to the point when the scripts were decompiled, and by a very happy accident, all that they do is to follow a heartbeat every frame for all characters from top to bottom allowing the possibility to bail out.

Which means modders could add code to the file and as long as their trigger conditions were true only occasionally their new code didn't interfere with 'old' code. It is modular in the sense that to add functional code, you don't need to touch the previous code, which is almost never the case with more efficient, function oriented languages.

Uhm.. What..?

EDIT
How is this a problem.
 
Last edited:

Jaesun

Fabulous Ex-Moderator
Patron
Joined
May 14, 2004
Messages
37,250
Location
Seattle, WA USA
MCA
The 'problem' is that the engine they're trying to emulate has a script api that was reverse engineered to the point when the scripts were decompiled, and by a very happy accident, all that they do is to follow a heartbeat every frame for all characters from top to bottom allowing the possibility to bail out.

Which means modders could add code to the file and as long as their trigger conditions were true only occasionally their new code didn't interfere with 'old' code. It is modular in the sense that to add functional code, you don't need to touch the previous code, which is almost never the case with more efficient, function oriented languages.

Uhm.. What..?

I thought you were an expert programmer Drog, what don't you understand? :M
 

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
The 'problem' is that the engine they're trying to emulate has a script api that was reverse engineered to the point when the scripts were decompiled, and by a very happy accident, all that they do is to follow a heartbeat every frame for all characters from top to bottom allowing the possibility to bail out.

Which means modders could add code to the file and as long as their trigger conditions were true only occasionally their new code didn't interfere with 'old' code. It is modular in the sense that to add functional code, you don't need to touch the previous code, which is almost never the case with more efficient, function oriented languages.

Uhm.. What..?

I thought you were an expert programmer Drog, what don't you understand? :M

I modified my post. I don't understand what the problem is.
 

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
EDIT
How is this a problem.
I'm doubting that composability will be preserved in this engine and a Infinity Engine type of moding environment will be prevented from arising. All of Tim Cain previous rpg engines weren't composable (bloodlines/ToEE, fallout) at the code level, such as in Weidu mods where one mod can alter all the scripts of all one handed weapons and another completely different one by another author add damage types and resistances to weapons and enemies (for instance) and you can install both without caring that the authors never coordinated. Of course there are incompatibilities, but notice that the games i mentioned all use 'megamods' (aka 'we can't figure out how not to conflict so we quit trying').

Just replacing files in a virtual directory structure is not enough for this kind of modding in general (also the mistake of D:OS btw).
 
Last edited:

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
EDIT
How is this a problem.
I'm doubting that composability will be preserved in this engine and a Infinity Engine type of moding environment will be prevented from arising. All of Tim Cain previous rpg engines weren't composable (bloodlines/ToEE, fallout) at the code level, such as in Weidu mods where one mod can alter all the scripts of all one handed weapons and another completely different one by another author add damage types and resistances to weapons and enemies (for instance) and you can install both without caring that the authors never coordinated.

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.
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,800
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
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.

There are a few class files that govern the behaviour, there's not much there at the moment but they have someone adding some more shit in for the next patch or the one after.
 

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
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.

There are a few class files that govern the behaviour, there's not much there at the moment but they have someone adding some more shit in for the next patch or the one after.

Can you provide their namespace heiarchy or give us some class names they are using? It could reveal how decoupled their AI will be.. which will dictate how hard it is to replace / modify intelligently.

Or is it all inLined in some AiManager class?
 

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
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.
It mostly depends on that scripting structure yes.

Outright mechanics change are probably out, due to needing to change the actual C# (things like Sensuki is doing).
Depending on the structure they end up using for the AI, if they use a sane interface for it, it may be possible to straight jacket the modders so their code is 'composable by design' although due to the complicated syntactic nature of C# the compiler will probably need to be restrictive and will not permit all language possibilities (and a good thing too, you probably want to prevent dumbfucks creating threads or reading IO in the AI engine).
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,800
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
Can you provide their namespace heiarchy or give us some class names they are using? It could reveal how decoupled their AI will be.. which will dictate how hard it is to replace / modify intelligently.

Or is it all inLined in some AiManager class?

can do better than that actually
 

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
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.
It mostly depends on that scripting structure yes.

Outright mechanics change are probably out, due to needing to change the actual C# (things like Sensuki is doing).
Depending on the structure they end up using for the AI, if they use a sane interface for it, it may be possible to straight jacket the modders so their code is 'composable by design' although due to the complicated syntactic nature of C# the compiler will probably need to be restrictive (and a good thing too, you probably want to prevent dumbfucks creating threads or reading IO in the AI engine).

I think most of those things are managed through Unity.. Again I think we are not fully on the same page SCO.. Why shouldn't we modify the source code if the goal is to create a WeiDu type environment that allows multiple mods to play nice together..
 

Liston

Augur
Joined
Mar 28, 2013
Messages
200
Liston what did you have to do to change the inventory slots to 16? I've changed the InventoryMaxSize, but that didn't seem to work, do you need to update something in the UI code as well ?

Such as on InventorySecondaryRow ?

I only changed CharacterStats.InventoryMaxSize, although I'm using BB v257. Look at what is assigning BaseInventory.MaxSize (BaseInventory.Update() probably).
 

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
Why shouldn't we modify the source code if the goal is to create a WeiDu type environment that allows multiple mods to play nice together..
No reason, except maybe legal ones which i hope obsidian waivers somehow. But i'd have hoped that when people promise a 'IE successor' that work is done for us. Not to mention that it might be that all AI needs to be replaced.

I looked at the code you gave Sensuki and although the scripting engine is not there yet, they're going for a tick model of AI updates (in the misnamed 'GameAIState' - more like NPCAIState).
 
Last edited:

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
Why shouldn't we modify the source code if the goal is to create a WeiDu type environment that allows multiple mods to play nice together..
No reason, except maybe legal ones which i hope obsidian waivers somehow. But i'd have hoped that when people promise a 'IE successor' that work is done for us. Not to mention that it might be that all AI needs to be replaced.

I don't really expect them to emulate the Infinity Engine.. Honestly our job will be easier then WeiDu's was.. He had to find those hooks and data without the source code.. (As did a friend of mine when we implemented the scripting system for Nox) It's much more difficult digging around in Assembly and hex to find information then reading the source code.

I doubt legal action will be an issue.. Obsidian's rules on modding is "if you can do it then your allowed to".. No publisher or team of lawyers to descend on us.. WeiDu is just as invasive.
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,800
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
Liston what did you have to do to change the inventory slots to 16? I've changed the InventoryMaxSize, but that didn't seem to work, do you need to update something in the UI code as well ?

Such as on InventorySecondaryRow ?

I only changed CharacterStats.InventoryMaxSize, although I'm using BB v257. Look at what is assigning BaseInventory.MaxSize (BaseInventory.Update() probably).

What program did you use? I tried Reflexil with NET Reflector
 

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
I don't really expect them to emulate the Infinity Engine.. Honestly our job will be easier then WeiDu's was..
It might be easier than WEIDU but the modders job will probably be much harder if this information/behavior is not centralized and restructed somehow into a domain specific language. Look at the AI/plan directory. CasterScanForTarget is a whole (complicated) file just for the AI choosing their target, checking for nulls (!!!), pushing waypoints, adding fidget animations etc, which in BGScript is just a selector over a list of nearest and a cast command.
 
Last edited:

Liston

Augur
Joined
Mar 28, 2013
Messages
200
Liston what did you have to do to change the inventory slots to 16? I've changed the InventoryMaxSize, but that didn't seem to work, do you need to update something in the UI code as well ?

Such as on InventorySecondaryRow ?

I only changed CharacterStats.InventoryMaxSize, although I'm using BB v257. Look at what is assigning BaseInventory.MaxSize (BaseInventory.Update() probably).

What program did you use? I tried Reflexil with NET Reflector

I decompiled dll with ildasm, made changes and recompiled with ilasm.

Edit: You have to make changes in MSIL this way, it's really easy when you use ilspy. Just find what you want to change in ilspy, look at ilspy il output, find the code in .il file (output of ildasm) and recompile
 

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
I don't really expect them to emulate the Infinity Engine.. Honestly our job will be easier then WeiDu's was..
It might be easier than WEIDU but the modders job will probably be much harder if this information/behavior is not centralized and restructed somehow into a domain specific language. Look at the AI/plan directory. CasterScanForTarget is a whole (complicated) file just for the AI choosing their target, checking for nulls, pushing waypoints, adding fidget animations etc, which in BGScript is just a selector over a list of nearest and a cast command.

I don't have time to dig in the source right now.. when I get home I will take a look .. Bearing in mind this code will most likely be changed before release.

Liston what did you have to do to change the inventory slots to 16? I've changed the InventoryMaxSize, but that didn't seem to work, do you need to update something in the UI code as well ?

Such as on InventorySecondaryRow ?

I only changed CharacterStats.InventoryMaxSize, although I'm using BB v257. Look at what is assigning BaseInventory.MaxSize (BaseInventory.Update() probably).

What program did you use? I tried Reflexil with NET Reflector

I decompiled dll with ildasm, made changes and recompiled with ilasm.

Oh Lawdy.. :D


EDIT: Liston Reflexil Modifies the MSIL and is capable of hot patching / code injecting and generating a modified assembly.. Similar tools exist for byte code manipulation as well.
 
Last edited:

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