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

Bester

⚰️☠️⚱️
Patron
Vatnik
Joined
Sep 28, 2014
Messages
11,006
Location
USSR
So I finished the creature spawning console command even though the prefab names for most creatures in game aren't known yet. I'll see about it tomorrow, there should be a way to export them. For now, the only names known are the file names starting with "cre_" in assetbundles\prefabs\objectbundle

It's not really useful atm, but IE games had such commands to unblock bugged quests etc, so it may become useful some day. You can spawn an NPC and then make him join your party for example. The usual "console fun".

Anyway, the command spawns a creature, places it on the ground under your cursor, then the creature gets the same rotation that your main character has at the moment. Then it either makes the creature hostile or friendly depending on the parameter that you pass. If it's hostile, it'll start fighting you. Then it'll center the camera on the creature. It'll also spam your console with some info that may come in handy once modding really takes off (if ever). The code may serve as a sort of modding tutorial/example, I suppose.

BSC creaturename bool (0 for friendly, 1 for hostile)

So for example to spawn a friendly "Obsidian Wurm" (it's an animal companion), you type:
BSC cre_wurm_obsidian_pet 0

For a hostile druid cat:
BSC cre_druid_cat01 1

Code:
Code:
//INJECT THIS METHOD INTO THE "SCRIPTS" CLASS

static void BSC(string param1, string param2)
{
   if (GameState.s_playerCharacter.IsMouseOnWalkMesh()) // checks if mouse cursor is on the navmesh
   {
     if (param2 == "1")
       Console.AddMessage("Attempting to spawn a hostile: " + param1, UnityEngine.Color.yellow);
     else
       Console.AddMessage("Attempting to spawn a friendly: " + param1, UnityEngine.Color.yellow);
     UnityEngine.GameObject besterCreature; // creates an empty game object
     besterCreature = GameResources.LoadPrefab<UnityEngine.GameObject>(param1, true); // instantiates a prefab
     if (besterCreature != null)
     {
       Console.AddMessage("Spawned successfully: "+besterCreature.name, UnityEngine.Color.green);
       besterCreature.transform.position = GameInput.WorldMousePosition; //it's a raycast (it gives you the coordinates of the ground under your cursor)
       besterCreature.transform.rotation = GameState.s_playerCharacter.transform.rotation; // takes the rotation from the player and assigns it to the creature... can do the same with position if you want
       Console.AddMessage("Coordinates: X = "+besterCreature.transform.position.x+" Z = "+besterCreature.transform.position.z);
       if (besterCreature.GetComponent<Faction>() != null){
         Console.AddMessage("Default relationship to player: "+besterCreature.GetComponent<Faction>().RelationshipToPlayer);
         Console.AddMessage("Default team: "+besterCreature.GetComponent<Faction>().CurrentTeamInstance);
       }
       if (besterCreature.GetComponent<AIPackageController>() != null)
         Console.AddMessage("Default AI: "+besterCreature.GetComponent<AIPackageController>().AIPackage);
       if (besterCreature.GetComponent<InstanceID>() != null)
         Console.AddMessage("GUID: "+besterCreature.GetComponent<InstanceID>().Guid);
       Console.AddMessage("Now transforming the creature.", UnityEngine.Color.cyan);

       bool isHostile = false;
       if (param2 == "1")
         isHostile = true;

       if (isHostile == false)
       {
         if (besterCreature.GetComponent<Faction>() != null)
         {
           besterCreature.GetComponent<Faction>().RelationshipToPlayer = Faction.Relationship.Neutral; // simply modifying the relationshipToPlayer isn't enough, you need to change the team as well
           besterCreature.GetComponent<Faction>().CurrentTeamInstance = Team.GetTeamByTag("player"); // it's just the first friendly team I found... if you want to see other teams, you can write a method to print them all, cause they're in a private field
         }
         if (besterCreature.GetComponent<AIPackageController>() != null)
         {
           besterCreature.GetComponent<AIPackageController>().ChangeBehavior(AIPackageController.PackageType.DefaultAI); // some creatures might come without AI, which would make them always stand idly.
           besterCreature.GetComponent<AIPackageController>().InitAI(); // the creature might have already started attacking the player if it was initially hostile, so we relaunch its AI
         }
       }
       else
       {
         if (besterCreature.GetComponent<Faction>() != null)
         {
           besterCreature.GetComponent<Faction>().CurrentTeamInstance = Team.GetTeamByTag("monster");
           besterCreature.GetComponent<Faction>().RelationshipToPlayer = Faction.Relationship.Hostile;
         }
         if (besterCreature.GetComponent<AIPackageController>() != null)
         {
           besterCreature.GetComponent<AIPackageController>().ChangeBehavior(AIPackageController.PackageType.DefaultAI);
           besterCreature.GetComponent<AIPackageController>().InitAI();
         }
       }

       if (besterCreature.GetComponent<Faction>() != null)
       {
         Console.AddMessage("New relationship to player: "+besterCreature.GetComponent<Faction>().RelationshipToPlayer);
         Console.AddMessage("New Team: "+besterCreature.GetComponent<Faction>().CurrentTeamInstance);
       }
       if (besterCreature.GetComponent<AIPackageController>() != null)
         Console.AddMessage("New AI: "+besterCreature.GetComponent<AIPackageController>().AIPackage);
       CameraControl.Instance.FocusOnPoint(besterCreature.transform.position); // centers the camera on the creature
     }
     else
       Console.AddMessage("Failed to spawn "+param1+" - probably bad naming.", UnityEngine.Color.red);
   }
   else
       Console.AddMessage("Mouse is not on walkmesh, move mouse elsewhere and try again.", UnityEngine.Color.red);
}

2014-10-27_00003.jpg


If you wanna play with it, here's the patched dll: https://dl.dropboxusercontent.com/u/62420848/patch4.zip
 
Last edited:

Bester

⚰️☠️⚱️
Patron
Vatnik
Joined
Sep 28, 2014
Messages
11,006
Location
USSR
Meh, not much to play around with, I'm afraid. There's the dragon of course (player_sky_dragon), but you can't have an honest fight with it, and it's also unkillable for low level characters. The dragon a little bugged. In a sense. It has some internal scripts that don't allow you to just summon it and fight it like a regular monster, because that particular dragon is supposed to be you. I don't know, maybe you gain the ability to shapeshift into a dragon late in the game, or you become a dragon in a dream, or whatever, but when this particular dragon is summoned, he replaces your main character in the party. And even if you make it hostile, you can still control it, so it doesn't have its own AI. Well, it has something, but it's a basic one. It starts to fight back if hit, that's all.

You can summon two of them, but they keep missing each other.
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,799
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
In the game, to upgrade a weapon to a Superb Weapon, you need a Sky Dragon eye. So I wouldn't be too surprised if you get the choice to fight one or something.
 

Bester

⚰️☠️⚱️
Patron
Vatnik
Joined
Sep 28, 2014
Messages
11,006
Location
USSR
So, on the subject of modifying the assets. Last time I only managed to modify a really small item asset and that method didn't work with other types of assets like spells.

This time I think I found a way to modify all types of assets, apparently. Modified an item, then modified a spell, and everything went very smooth. Didn't test further yet.

Renamed the "fan of flames" spell and changed its base minDamage and maxDamage. It shows properly on the tooltip and it damages the dwarf warrior accordingly. Yeah, bright day for the modding community that doesn't exist. I'll probably be writing a guide in a few days, I suppose. I also think I found a way of creating new assets for the game, like weapons and stuff.

2014-10-28_00001.jpg
 
Last edited:

Ninjerk

Arcane
Joined
Jul 10, 2013
Messages
14,323
At what point do you guys get into C&D territory with this? Is there a "reverse engineering clause" in any kind of license agreement for the beta?
 

Bester

⚰️☠️⚱️
Patron
Vatnik
Joined
Sep 28, 2014
Messages
11,006
Location
USSR
(I don't know how to tag people on the forum, so I'm just gonna quote you.)

I have a question. You know the .assetbundle area files in PillarsOfEternity_Data\assetbundles... Do you know if any of these areas are unreachable in the game? If so, I might be able to hook them up to the game which may be interesting. I just don't know whether to explore this possibility or not, since I don't if any of them are unreachable.

At what point do you guys get into C&D territory with this?
Lol, never? It's modding, nobody's making a commercial product based on theirs.
 
Last edited:

Ninjerk

Arcane
Joined
Jul 10, 2013
Messages
14,323
(I don't know how to tag people on the forum, so I'm just gonna quote you.)

I have a question. You know the .assetbundle area files in PillarsOfEternity_Data\assetbundles... Do you know if any of these areas unreachable in the game? If so, I might be able to hook them up to the game which may be interesting. I just don't know whether to explore this possibility or not, since I don't if any of them are unreachable.

At what point do you guys get into C&D territory with this?
Lol, never? It's modding, nobody's making a commercial product based on theirs.
You can tag people by typing @ and then their name. A list should pop up once you get a few letters in.
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,799
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
Bester No, none of the area files in the assetbundles are external to the beta. They're all accessible in game.

Good work on the modding assets, looking forward to delving into that in the future.
 

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
At what point do you guys get into C&D territory with this? Is there a "reverse engineering clause" in any kind of license agreement for the beta?

It's not illegal to modify binary files that exist on your own system no matter what any TOSA says. Posting mods online is a bit more of a grey area when you are providing distribution of something you don't own but generally this is 90% of the time totally fine. Most publishers and developers waive any potential copy right infringement issues they might have over you because mods help game sales, especially if the mods require a legitimate copy to work (For example the Script Extender plugins for Elder Scrolls games).

FYI I have documented screenshots of Obsidian waiving the protection of PoE against modding, they have stated you can break open the game as much as you want.


Off topic But Still Relevant:
This is why selling trainers / aimbots and other malicious multilayer cheating tools has become so popular.. and also why Anti-Cheating systems like Warden, Punkbuster and VAC are so complex and have so much money invested in them. It's very hard to justify taking these developers to court because of the complexity of what they are doing flies over most people's heads. Even Glider was basically attacked by Blizzard's army of lawyers under the guise of copyright infringement and damages.. They don't give a crap about that.. but it was the only law they could use to go after the creator because it's not illegal to create a client that can use Battle.Net in an automated way if you have valid login credentials.

Glider didn't do anything illegal, It broke the terms of Service but that is Blizzards job to moderate. It just means Blizzard can ban you without refunding your money. You aren't breaking the law by operating a bot on a video game.

Game Hacking and Reverse Engineering Games is harmful to a brand if it causes companies to lose business but that is also a tough sale and often times seems to not be worth pursuing. Gabe Newell's business strategy thus far has been to use VAC to starve aimbot companies of money and customers. If he can ban wave your user base, you lose subscriptions to your service as an aimbot creator. It is also very expensive to develop new heuristically 'clean' methods of subverting VAC which often means dipping into kernal layer coding which requires very intelligent software developers to not fuck it up.

The people running the show are generally not developers and have to pay fairly high wages to get people with the right skill set.. I have had the opportunity to be involved with some really intelligent people that did this kind of stuff.. I know at least one guy who worked for IBM doing some real low level stuff and was doing this stuff on the side on his own time for quite a bit of money. I never predicted 10 years ago that cheating in online games would become a multi-million dollar industry..
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,799
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
OT: I was the Head Anti-Cheat Admin of the Cybergamer Call of Duty Leagues and Ladders. Call of Duty used Punkbuster, but anyone buying paid cheats could bypass it, PB seemed to only be able to stop the free ones. We didn't pay too much attention to the Open League because it was essentially a free league that teams didn't pay any money for and there was usually no prize money involved. People probably got away with subtly wall hacking in Open, but it was pretty easy to tell when people were boting or blatantly walling because of CoD's inbuilt demo feature. It was a requirement for players to record demos of their match and keep them for up to 2 weeks after the match. Anyone failing to upload received 1-2 week ban.

We focused our attention on cheaters in the paid leagues instead. I know that we still failed to catch some people. There was a guy in the #1 team that wallhacked all of their matches, including the grand final against my team. He would sit at the back of the map and try to be the last person left alive all the time, and then do just enough for their team to win certain rounds. I knew he cheated and could tell just by watching his demos and on LAN he was fucking horrible - nowhere near as good as online, but it wasn't enough to prove it because I couldn't prove "beyond reasonable doubt". His cheating earned their team thousands of dollars over the years, we did manage to beat them in one tournament though, we smashed them so hard that his cheating would have been too obvious most likely. So yep - I can definitely see why cheating, especially in competitive games is a multi-million dollar industry.

The guy I was talking about made a public post on the forums after he quit the game / the leagues were dead that he cheated every game and laughed at everyone for not catching him ... and hasn't been seen since.
 

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
Punk buster had a huge bug in their infrastructure that allowed malicious users to fake submit red flags on other users they were in a game with.. They could even submit fabricated screenshots. The result was people having their hardware serials banned and being unable to dispute the charge because there would be a fake screenshot with their 'hack' running.

Eventually when this exploit became too well known and too many people were using it for Shits and Giggles EA came down on PB to fix it. (This was most notable on Battle Field 3 but affected many games at the time)

I am not sure how well known this is.. EA reported there was an issue with legitimate users being banned but they never told the full story about how Punk Buster was exploited in this way.
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,799
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
It was my understanding in CoD4 that PB screenshots could not be doctored, because the hash code for the screenshot was different. Cheats could block PB screenshots on their PC though, often cheaters would either have completely clean or black PB serverside screenshots.
 

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
It was my understanding in CoD4 that PB screenshots could not be doctored, because the hash code for the screenshot was different. Cheats could block PB screenshots on their PC though, often cheaters would either have completely clean or black PB serverside screenshots.

Kinda..? This was a man in the middle attack. It wasn't perfectly spoofing bans, I believe everyone that was banned was also unbanned again after the exploit was found..

This wasn't the first time either. Punk Buster has a very embarrassing track record of being exploited to falsely banned users. It has very weak heuristic / analysis skills when looking for application signatures or memory patterns.

http://en.wikipedia.org/wiki/PunkBuster#Attacks_on_PunkBuster


EDIT:

There is a reason that Warden and VAC do not take screen shots to validate hacking.. There is no such thing as a server side screen shot in the way that you are thinking.

You can take a screen shot of a client's FoV but you can't take a screen shot of what that client is actually rendering to the screen without asking the client for that information. The minute you make that request you can no longer guarantee a legitimate response.
 

Bester

⚰️☠️⚱️
Patron
Vatnik
Joined
Sep 28, 2014
Messages
11,006
Location
USSR
So. After attempting to convert unity3d files into assets/prefabs in order to be able to edit the thing in Unity visually with no coding involved (right now I can edit it, but it requires some basic programming skills, which is not a good thing for modding) and failing to do it, I'm starting to think about writing a full blown custom editor for unity3d files. Except what bothers me is the possibility of Obsidian releasing a similar modding tool of their own eventually, and I'd hate wasting time on something so useless.

I wonder if anyone here has a way of contacting somebody who is sort of responsive at Obsidian who would have a concrete answer to that question? I don't know, did they even promise modding tools at some point?
 
Last edited:

Zed

Codex Staff
Patron
Staff Member
Joined
Oct 21, 2002
Messages
17,068
Codex USB, 2014
Obsidian never promised modding support, so there's no way in hell they'll develop any post-launch mod tools. They're not that kind of company.
 

Bester

⚰️☠️⚱️
Patron
Vatnik
Joined
Sep 28, 2014
Messages
11,006
Location
USSR
Ok then. Fargo did promise some kind of modding tools, but I guess Obs aren't like that then.
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,799
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
Hey Bester are you able to help me with the code that adds an option to the graphics options menu?

I'm trying to locate the code that governs those. Want to make one that has the option to disable unit highlighting and then I'll post it on the Obs forums and say here use this code, so it has a chance of geting into the next build because it's PISSING ME OFF.

Relevant info:

http://www.rpgcodex.net/forums/inde...ding-hacking-thread.94183/page-3#post-3509336

Another one is changing NPC selection circle color to blue when Colorblind mode is disabled.

I think it would involve editing the GetFriendlyColor() and GetFriendlyHighlightColor() methods

May need to add a check for isPartyMember or something if that's possible.

Something like this?

In the InGameHUD class ...

public static Color GetFriendlyColor()
{
if (InGameHUD.s_instance.UseColorBlindSettings)
return InGameHUD.s_instance.FriendlyColorColorBlind;
else if (<whatever checks for unit> isPartyMember == 1)
return InGameHUD.s_instance.FriendlyColor;
}

public static Color GetFriendlyHighlightColor()
{
if (InGameHUD.s_instance.UseColorBlindSettings)
return InGameHUD.s_instance.HighlightFriendColorblind;
else if (<whatever checks for unit> isPartyMember == 1)
return InGameHUD.s_instance.HighlightFriend;
}

You get the idea

Another one would be changing the colors themselves, but I think they are external? Would be cool if I could change the colorblind blue to a lighter blue like the IE games.
 
Last edited:

Bester

⚰️☠️⚱️
Patron
Vatnik
Joined
Sep 28, 2014
Messages
11,006
Location
USSR
Yeah sure, I'll look into it when I get up in 10 hours or so. Those circles are a material, so changing their color/transparency to WHATEVER should to be quite easy. As should be removing unit highlight. Removing stuff is always easy. The graphics menu option - that might be a little bit more complicated, especially since they use NGUI and I never even touched that stuff before. Still, they do have working examples, so I think it's gonna be ok.
 

set

Cipher
Joined
Oct 21, 2013
Messages
940
Don't have time to read the whole thread but I'm kind of confused... wasn't PoE made with Unity? There's no actual C# is there? I thought Unity used C#-like scripting language alternative, that was assembled into some kind of in-engine callbacks -- or is Unity itself built with C#? Or am I missing a step that lets Unity be written in language X while PoE can be written in C# (wouldn't in theory this cause huge performance problems?)?

If this is true bare-bones C#, can't you use reflection like Java to extend the game?
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,799
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
Unity has 3 scripting languages - UnityScript, which is based off JavaScript IIRC, Boo, and C#. Obsidian use C# for nearly everything in Pillars of Eternity.
 

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