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

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
I'm interested in knowing how you guys are modding the PoE UI because i want to do the same for a completely different game - i want to add the capability for a 3rd drone in Dragonfall directors cut, and i got far enough by injecting code with Reflexil to make the game crash because the DronePanel i injected into the dronePanelList had its 'gameobject' field to null.

Now, i searched for all instances of 'DronePanel' in the assemblies of the game and i couldn't find where they are being instantiated and added to the list (this is the reason i had to hack adding new instance), so i kinda suspect some unity dependency injection tricky business. How do you do it in PoE land? Is the UI defined on the 'resource.assets' file and friends and how can i mod them and their layout; i can inject and modify the code for actually putting 3 drones in weapon slots fine i think, it's just the karma (for the ability explanation) and the drone panel - and likely layout problems - ruining my mojo. And how can i recompress after modifying too?

edit: looks like it might be in the 1.8 gb file (ofc).
 
Last edited:
Vatnik
Joined
Sep 28, 2014
Messages
12,296
Location
USSR
the game crash because the DronePanel i injected into the dronePanelList had its 'gameobject' field to null.
Now, i searched for all instances of 'DronePanel' in the assemblies of the game and i couldn't find where they are being instantiated and added to the list

1) They're being instantiated by being part of the scene, so it's nowhere in the code.
2) They're assigned in Unity Editor visually, so it's nowhere in the code.

This is absolutely not a problem, though.

And how can i recompress after modifying too?
I don't understand exactly what you're trying to do, cause I only played Dragonfall for like 2 days. Could you perhaps provide a screenshot of what you want to accomplish? Also, does Dragonfall use Ngui? What version? It'd be easier for you to download that old ngui version that they're using from a certain torrent tracker, create a virgin Unity project and try your code in there first to familiarize yourself with Unity and Ngui.

Also, if you want to inject some custom textures, you don't need to put them into the resource.assets, you just read them in your injected code whenever the game is loaded, like this:
Code:
string path = Path.Combine(Path.Combine(Application.dataPath, "Managed/iemod"), "test.png");
Texture2D SolidUFrame = newTexture2D(1920, 1080, TextureFormat.RGB24, false);
byte[]bytes = File.ReadAllBytes(path);
SolidUFrame.LoadImage(bytes);
You need to find the right region in the code to squeeze it in, and if you're using Ngui - create a UIPanel, then create a child UITexture and assing the Texture2D to UITexture.mainTexture. Something along these lines, anyway.

But if you want to use existing textures, it's got nothing to do with resources.assets at all. So in both cases, don't worry about resources.assets.

Is the UI defined on the 'resource.assets' file and friends and how can i mod them and their layout;
It's defined in the scene. You can modify its layout whenever the game is loaded.

Also, curiously enough, the modding framework for PoE can also be used for any Unity based game. It's a bit tricky to set up, but once you've done it, it's really powerful and easy to use afterwards.
 
Last edited:

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
Drones are those machines that rigger characters (characters with drone combat skill > 0) control. They take up a weapon inventory slot. There is a specialization that gives a extra inventory slot to make 3. So i modified the code to allow 3 drones (instead of 2 max), only the panel to control them crashed obviously (because the inventory slots had drones without a panel for the last).

I have no idea if the game uses NGUI or not. There isn't any glaring stuff like a assembly named NGUI and
"strings resources.assets | grep "NGUI"" doesn't report anything so probably not? My hope was that the gui related code of that panel autoadjusted the size of the panels (there are some really outlandish resolutions supposedly supported for DF: DC like 640x480 but they just crash wine for me even with the unmodified dll).
For now I just need to add the definition to the dependency injection machinary to add a new DronePanel. With disunity and grep i found files that seem likely candidates but at a guess just modifying some shit and putting it in again will not work because i see stuff like a unique id there, and besides this looks semi-compiled already, probably a serialization format:
Code:
GameObject
  vector m_Component = pair[2]
  pair data
  int first = 4
  PPtr<Component> second
  int m_FileID = 0
  int m_PathID = 51087
  pair data
  int first = 114
  PPtr<Component> second
  int m_FileID = 0
  int m_PathID = 69845
  unsigned int m_Layer = 12
  string m_Name = "DroneName"
  UInt16 m_Tag = 0
  bool m_IsActive = true
Code:
GameObject
  vector m_Component = pair[2]
  pair data
  int first = 4
  PPtr<Component> second
  int m_FileID = 0
  int m_PathID = 53186
  pair data
  int first = 114
  PPtr<Component> second
  int m_FileID = 0
  int m_PathID = 69884
  unsigned int m_Layer = 12
  string m_Name = "DroneButton"
  UInt16 m_Tag = 0
  bool m_IsActive = true
Code:
GameObject
  vector m_Component = pair[2]
  pair data
  int first = 4
  PPtr<Component> second
  int m_FileID = 0
  int m_PathID = 46883
  pair data
  int first = 114
  PPtr<Component> second
  int m_FileID = 0
  int m_PathID = 69838
  unsigned int m_Layer = 0
  string m_Name = "DronePanel"
  UInt16 m_Tag = 0
  bool m_IsActive = true

(those 3 are the only references to 'drone' in 'gameobjects' according to disunity - i only cared about gameobjects because that was what the crash was bitching about but that may be a mistake). Since there are at least 2 dronepanels in the normal game this is either cloned in a obfuscated form in the game or maybe change from pair (the pair[2] to pair[3] or someshit).

The fact that if i want to distribute this shit i will have to use a xdelta or similar patcher has me cooled down throughly.

1.8 gigabytes UI definition files...
 
Last edited:
Vatnik
Joined
Sep 28, 2014
Messages
12,296
Location
USSR
It's really all in the Assembly-CSharp.dll and not in resources.assets. You should really let this file go, lol.

As to whether it uses ngui or not is easy to check - you open Assembly-CSharp.dll in .Net Reflector (or Ilspy) and see if there's a class like NGUIMath, NGUITools, etc...

Bottom line is, you'll have to learn Unity and Ngui to pull your idea off.
 

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
I was both right and wrong, it is using a serialization dependency injection system for fields of the classes but it does use NGUI.

I found the drone panel definitions inside one of the assets file with that serialization format you see above, so it's either your editor or bust to edit these at a guess.
 
Last edited:
Vatnik
Joined
Sep 28, 2014
Messages
12,296
Location
USSR
Fixed the last known bug, so here's the v4.0 for all platforms: http://rien-ici.com/iemod/
Custom frames included in the mod are only available for 1920*1080 resolution at this point. Karkarov said he's going to adapt his frames for other resolutions. As for my own U-frames, you can adapt them yourself if you want from this psd.
There's a known bug when the custom buttons appear to be "sticky" and can't be pressed. Doesn't happen often, but it's hard to track down this bug, as it doesn't throw any errors in the debug log. If it happens to you, just quit the game and reload.

Recorded a short vid to showcase all latest functionality, but there's almost nothing new if you watched Sensuki's last video about the mod.

https://www.youtube.com/watch?v=64w3is_ts0I
 
Vatnik
Joined
Sep 28, 2014
Messages
12,296
Location
USSR
Karkarov's two frames, by the way:

Cmee8Qn.jpg


BJm6c31.jpg
 

Seari

Arcane
Patron
Joined
Nov 25, 2014
Messages
849
Pathfinder: Wrath
That looks rly fucking good, I might use it instead of the U shaped UI.
 

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
Forget about amateurs making quality 2d maps. Hasn't happened in IE, won't happen in PoE. This is not only a question of 'tools' - which have existed for IE since before near infinity - but raw artistic bullheadedness and commitment to emulate the original art design. That PoE fake and data driven custom lightening is used only makes it worse.

The one thing that could balloon the game modding community to BG levels would be a tool to compose mods without pre-arranged agreement, like WEIDU. My understanding is that bester implemented most of this but is hoping to keep a single source repository to resolve conflicts himself - i think this will quickly become unmaintainable, especially if people sign in in droves. My opinion is that conflicts and mod dependencies are inevitable, and a modding community is much better served by a data driven tool dedicated to resolving incompatibilities - by forbidding simultaneous install or by deducing compatible orders of player mod selections and installing them, like mlox.

At least it's not as as bad as megamods, like what happens in bloodlines where every mod must be incorporated into a megamod and those are all incompatible (not as bad because from what i can tell bester is using AOP for it, which is somewhat composable, within the limits of the more complex jumps that C# can make compared to IE scripts).

I think there might be need for some style guide stuff common sense things for C# modders like 'don't use state you idiot', 'if you must cache, use the common caches provided idiot' and 'don't use exceptions for flow control on purpose idiot'
One very important style guide thing that comes naturally in WEIDU and that will not come naturaly in C# code: WEIDU seperates different parts of a mod in components, which can be selected separately per mod added functionality - it does this by making the console user interface for mod function install naturally flow into the different functional code. I know bester is doing the same thing in his mods because he knows his stuff, but the temptation for a non-coder person with C# state at his fingertips is to implement all the stuff in one function or as much as it can be putting the selection booleans at the start, and this will probably bitrot the code to be full of hidden dependencies (by adding new, required variables at the start again and reusing). This is a terrible idea for more than the obvious reasons, because it might prevent compatible parts of your mod to be used in conjunction with other mods. Until bester doesn't refactor it anyway
:troll:

That has far as i can tell, the mod framework doesn't have the concept of a 'install time' function is problematic too. Most of the work in WEIDU mods is done at install time, not runtime, and this probably saved alot of game CPU time (at the cost of enormous mod install time and harddrive space anyway) and probably more than a few data conflicts (imagine someone using the same portraits vs someone adding a new one), or copying the originals and modifications to add bloom, for a new 'have you come seeking the light' status whatever. Data modification was THE way to mod IE - it was also the way mods could alter the code of other mods in general (before install), the way that a mod added 'go back to inn' function to dialogs even if mods added party npcs for example.
 
Last edited:

dukeofwhales

Cipher
Joined
Nov 13, 2013
Messages
423
If anyone knows off the top of their head, how did weidu come to be? I always thought it was remarkable that 99% of IE mods used this one installer which seemingly solved all (resolvable) incompatibilities on its all. Much better than the stupid nexusmods piece of shit for Gamebryo.
 
Vatnik
Joined
Sep 28, 2014
Messages
12,296
Location
USSR
Forget about amateurs making quality 2d maps. Hasn't happened in IE, won't happen in PoE. This is not only a question of 'tools' - which have existed for IE since before near infinity - but raw artistic bullheadedness and commitment to emulate the original art design. That PoE fake and data driven custom lightening is used only makes it worse.

The one thing that could balloon the game modding community to BG levels would be a tool to compose mods without pre-arranged agreement, like WEIDU. My understanding is that bester implemented most of this but is hoping to keep a single source repository to resolve conflicts himself - i think this will quickly become unmaintainable, especially if people sign in in droves. My opinion is that conflicts and mod dependencies are inevitable, and a modding community is much better served by a data driven tool dedicated to resolving incompatibilities (by forbidding simultaneous install) orders of player mod selections and installing them, like mlox.

At least it's not as as bad as megamods, like what happens in bloodlines where every mod must be incorporated into a megamod and they're all incompatible (not as bad because from what i can tell bester is using AOP for it, which is somewhat composable, within the limits of the more complex jumps that C# can make compared to IE scripts).

Now, let's not confuse assembly patches with content mods. Content mods can be made weidu-like, all we need is the right tools. I would've written them myself... not tools for creating custom maps, but for including additional content into existing maps... that's quite easy, just very effort demanding and I kinda exhausted myself.

When somebody makes them, anyone can just put a few lines of code into OnLevelLoaded to read content produced by these tools and add it into the map.
 

tuluse

Arcane
Joined
Jul 20, 2008
Messages
11,400
Serpent in the Staglands Divinity: Original Sin Project: Eternity Torment: Tides of Numenera Shadorwun: Hong Kong
Now, let's not confuse assembly patches with content mods. Content mods can be made weidu-like, all we need is the right tools. I would've written them myself... not tools for creating custom maps, but for including additional content into existing maps... that's quite easy, just very effort demanding and I kinda exhausted myself.
Excellent I can't wait for Saerileth to get ported to PoE :bounce:
 

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
Maybe it's for the best that install time modding and code self-modification will go way probably forever on second thought. It complicates mod uninstallation beyond the 'savegame problem' - WEIDU kept copies of the modified files for uninstall. But it does make mods slow down the game by preventing data baking - if every data modification that everyone will want to do will need to be runtime i expect that with a 100 mods, most dialogs (for a minor example) will have a slight pause to check the mod dialog cache for that npc and the modifications it did to the dialog - if we're lucky and there is a cache that is. Mod configuration shouldn't go away - but that can be made a extension of mod component activation - i still remember the silly morrowind 'configuration items' that the more complex mods came with.

I'm pessimistic that a 'OnMapLoad' is enough. Very pessimistic actually as the dialog cache example shows. Consider: map entrances, new maps entries, new npcs, dialogs, new items on npcs, modifying items on npcs, waypoints, hotspots, trigger zones (traps, ambushes, map modifications etc), AI modifications (if not pure code i guess), music selection, sound effects selection, caches for that... this is probably minimal.

edit: ok, i realized i've been charging a strawman and you realize that data modding will be a necessity for more complex mods that don't suck - i still think you're underestimating the effort of it, even at runtime integration (much less the work that the poor fool implementing / adapting a WEIDU like will have).

I'm also worried that modders nowadays are spoiled by graphical editors and that will make even basic 'total conversion' PoE mods (like shadowrun dragonfall ) stillborn (even the less complex ones that try to mod original game campaigns with other mods by code modification, since both will require actual code and apis for it - which don't exist atm anyway).
 
Last edited:

Apexeon

Arcane
Joined
Nov 10, 2012
Messages
864
Forget about amateurs making quality 2d maps. Hasn't happened in IE, won't happen in PoE. This is not only a question of 'tools' - which have existed for IE since before near infinity - but raw artistic bullheadedness and commitment to emulate the original art design. That PoE fake and data driven custom lightening is used only makes it worse.

.

Am I allowed to spam a map ?

I am trying but IE art is insanely hard to make :).
 

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
Am I allowed to spam a map ?

I am trying but IE art is insanely hard to make :).
You're allowed everything you can get away with but by their nature, putting another game map in PoE will probably be really jarring because of the lightning and little animations like the trees and rivers, never mind even the art direction, never mind that there aren't even tools for the item occlusion and navmeshes yet.

I wish dragonfall had a code modification tool for the AssemblyC-sharp file like bester did for poe too, at least binary mods (i did one recently for that game) would be composable. Though to be honest for my mod to be usable by players and not just campaign creators (it adds a item) i'd need a data modification tool too, for adding the item to vendors composably (adding the item even to vendors added in other campaigns, even not installed ones yet), besides that code support that allows it to work. Both are necessary.

It's very annoying that all professional game studios that advertise the game as having 'modding support' punt on this (except Bethesda i guess probably because they skip the hard problem of dialog trees and fans did all the hard work of mod compatibility tools). They mean 'have modding support... as long as it's one megamod in one campaign'.
 
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
Apexeon

This is from Paul Fish who did "Additional Environment Art" on Pillars of Eternity and now works on Torment

I know you guys are just trying to figure out a basic workflow for this right now, but I want to give you a heads up. If and when Obsidian releases the export tools for PoE, you will need to use Maya to make your scenes. The Streamtile tool was written for Maya and utilizes the MIA_X_Passes materials for Mental Ray to export the various render passes.

Edit: You can build the scenes using whatever 3d application you want but it will need to be rendered in Maya using Mental Ray and MIA_X_Passes materials.

IIRC the tool is a plugin for Maya that was written by Obsidian specifically for the project (don't quote me on that though).
 

Apexeon

Arcane
Joined
Nov 10, 2012
Messages
864
Apexeon

This is from Paul Fish who did "Additional Environment Art" on Pillars of Eternity and now works on Torment

I know you guys are just trying to figure out a basic workflow for this right now, but I want to give you a heads up. If and when Obsidian releases the export tools for PoE, you will need to use Maya to make your scenes. The Streamtile tool was written for Maya and utilizes the MIA_X_Passes materials for Mental Ray to export the various render passes.

Edit: You can build the scenes using whatever 3d application you want but it will need to be rendered in Maya using Mental Ray and MIA_X_Passes materials.

IIRC the tool is a plugin for Maya that was written by Obsidian specifically for the project (don't quote me on that though).


Looks like I am out for I am a lightwave 3D man like Baldur's gate was built with.
All IE games were made with lightwave (I am a super lightwave fanboy).

Video Games designed with LightWave[edit]
Ace Combat 5: The Unsung War , Baldur's Gate: Dark Alliance II , Baldur's Gate II: Shadows of Amn , Black (video game) , Blood Omen 2 , Broken Sword: The Sleeping Dragon , Brute Force

HOLLY hell Maya 3D is ---- >>>> AUD 5,175.00

No wonder OE was going to go under blowing all there money on those tools.
 

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
Looks like I am out for I am a lightwave 3D man like Baldur's gate was built with.
All IE games were made with lightwave (I am a super lightwave fanboy).

My understanding is that you'll be able to build with Lightwave 3D and then render in Maya. You can probably just pirate it, btw.

I believe Hector Espinoza (the Environment Art lead) uses Softimage to develop his maps.
 

Apexeon

Arcane
Joined
Nov 10, 2012
Messages
864
Am I allowed to spam a map ?

I am trying but IE art is insanely hard to make :).
You're allowed everything you can get away with but by their nature, putting another game map in PoE will probably be really jarring because of the lightning and little animations like the trees and rivers, never mind even the art direction, never mind that there aren't even tools for the item occlusion and navmeshes yet.

I wish dragonfall had a code modification tool for the AssemblyC-sharp file like bester did for poe too, at least binary mods (i did one recently for that game) would be composable. Though to be honest for my mod to be usable by players and not just campaign creators (it adds a item) i'd need a data modification tool too, for adding the item to vendors composably (adding the item even to vendors added in other campaigns, even not installed ones yet), besides that code support that allows it to work. Both are necessary.

It's very annoying that all professional game studios that advertise the game as having 'modding support' punt on this (except Bethesda i guess probably because they skip the hard problem of dialog trees and fans did all the hard work of mod compatibility tools). They mean 'have modding support... as long as it's one megamod in one campaign'.

I might be the first IE indie (art style) to hit kickstarter this year.

Built on a AMD PII X6 3.2 ghz, ATI 5700 with only 8 gig of ram in my shed.
Currently massing maps in the sullust system..

38-Meta-Atx-2-Dark.jpg


52-City-1A-test-B.jpg


37-Castle-Apexeon-A1.jpg
 
Last edited:

Apexeon

Arcane
Joined
Nov 10, 2012
Messages
864
Looks like I am out for I am a lightwave 3D man like Baldur's gate was built with.
All IE games were made with lightwave (I am a super lightwave fanboy).

My understanding is that you'll be able to build with Lightwave 3D and then render in Maya. You can probably just pirate it, btw.

I believe Hector Espinoza (the Environment Art lead) uses Softimage to develop his maps.

I am legit now my pirate ship got sunk off the coast of New Zuland.
 

Merlkir

Arcane
Developer
Joined
Oct 12, 2008
Messages
1,216
Forget about amateurs making quality 2d maps. Hasn't happened in IE, won't happen in PoE. This is not only a question of 'tools' - which have existed for IE since before near infinity - but raw artistic bullheadedness and commitment to emulate the original art design.

Ah well, people are dumb. I wouldn't say "never". I spent over 6 years on a LOTR total conversion mod and worked with many dedicated people on it. Or look at the guy (sorry, can't recall the name) here on Codex, who's making Silkworm.

edit: Haha, sorry! Hi there Apexeon!
 

Grunker

RPG Codex Ghost
Patron
Joined
Oct 19, 2009
Messages
27,814
Location
Copenhagen
Forget about amateurs making quality 2d maps.

Glory of Istar didn't end up being finished, but the demo they released had motherfucking glorious 2d maps. Highest res I could find on the web was this:

f89e2a84eea90c60fd882bfb108591f88461d004.jpg


It looked spectacular in game (I played the demo when I was a kid and again a couple of years ago). I believe this was also a GoI map?:

4731477857cf44d5619ef5df31f998fd2243a8f3.jpg
 
Vatnik
Joined
Sep 28, 2014
Messages
12,296
Location
USSR
I'm pessimistic that a 'OnMapLoad' is enough. Very pessimistic actually as the dialog cache example shows. Consider: map entrances, new maps entries, new npcs, dialogs, new items on npcs, modifying items on npcs, waypoints, hotspots, trigger zones (traps, ambushes, map modifications etc), AI modifications (if not pure code i guess), music selection, sound effects selection, caches for that... this is probably minimal.

I don't know what exactly you mean by this. Here's how it would work in PoE.

For NPCs:
OnLevelLoaded, the game would do something like this:
- name of the loading map is "AR_Dyrford_01", so let's go into AR_Dyrford_01_Creatures.txt and see what we need to add.
- In the text file there are three mentions of creatures to add with a few numerical variables variables for appearance, a few numerical variables for stats, a variable for loot type, and an int for the first dialogue string. A gameobject is created and a few variables are assigned, end of story. It's instantaneous.

Same thing for map entrances, it's a text file with a few purely numerical values.
Same thing for modifying items on npcs.
Etc...

Another scenario would be to load an npc with a custom mesh for instance. In this case the game will read a .unity3d file, but this will increase level loading time only by the time it takes to read the file.
Same thing with weapons - if they use custom textures/sounds/meshes - they will have to be read as a .unity3d file, but most items are what... 200kb in size?

As for dialogues, they are fully externalized, so you just edit them as much as you want.

In short, worst case scenario, content mods will increase map loading times by a few seconds. (only those maps that are heavily filled with new content)
 
Last edited:

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