Skip to content
Permalink
master
Switch branches/tags
Go to file
11 contributors

Users who have contributed to this file

@ppoelzl @Wires77 @SaloEater @dbjorge @norepro @LocalIdentity @Openarl @summ1else @eps1lon @PJacek @Peechey

Contributing to Path of Building

Table of contents

  1. Reporting bugs
  2. Requesting features
  3. Contributing code
  4. Setting up a development installation
  5. Setting up a development environment
  6. Keeping your fork up to date
  7. Path of Building development tutorials
  8. Exporting GGPK data from Path of Exile

Reporting bugs

Before creating an issue:

  • Check that the bug hasn't been reported in an existing issue. View similar issues to the left of the submit button.
  • Make sure you are running the latest version of the program. Click "Check for Update" in the bottom left corner.
  • If you've found an issue with offence or defence calculations, make sure you check the breakdown for that calculation in the Calcs tab to see how it is being performed, as this may help you find the cause.

When creating an issue:

  • Select the "Bug Report" issue template and fill out all fields.
  • Please provide detailed instructions on how to reproduce the bug, if possible.
  • Provide a build share code for a build that is affected by the bug, if possible. In the "Import/Export Build" tab, click "Generate", then "Share" and add the link to your post.

Build share codes allow us to reproduce bugs much more quickly.

Requesting features

Feature requests are always welcome. Note that not all requests will receive an immediate response.

Before submitting a feature request:

  • Check that the feature hasn't already been requested. Look at all issues with titles that might be related to the feature.
  • Make sure you are running the latest version of the program, as the feature may already have been added. Click "Check for Update" in the bottom left corner.

When submitting a feature request:

  • Select the "Feature Request" issue template and fill out all fields.
  • Be specific! The more details, the better.
  • Small requests are fine, even if it's just adding support for a minor modifier on a rarely-used unique.

Contributing code

Before submitting a pull request:

  • Familiarise yourself with the code base here to get you started.
  • There is a Discord server for active development on the fork and members are happy to answer your questions there. If you are interested in joining, send a private message to any of Cinnabarit#1341, LocalIdentity#9871, Yamin#5575 and we'll send you an invitation.

When submitting a pull request:

  • Pull requests must be created against the dev branch, as all changes to the code are staged there before merging to master.
  • Make sure that the changes have been thoroughly tested!
  • Make sure not to commit ./src/Data/ModCache.lua. This is a very large, automatically generated file that is updated in the repository for releases only.
  • There are many more files in the ./src/Data directory that are automatically generated. This is indicated by the header -- This file is automatically generated, do not edit!. To change these, instead change the scripts in the ./src/Export directory and rerun the exporter. For your PR, please include all relevant changes to both the scripts and data files.

Setting up a development installation

Note: This tutorial assumes that you are already familiar with Git.

The easiest way to make and test changes is by setting up a development installation, in which the program runs directly from a local copy of the repository:

  1. Clone the repository using this command:

    git clone -b dev https://github.com/PathOfBuildingCommunity/PathOfBuilding.git
    
  2. Start Path of Building from the repository by running ./runtime/Path{space}of{space}Building.exe.

You can now use the shortcut to run the program from the repository. Running the program in this manner automatically enables "Dev Mode", which has some handy debugging feature:

  • F5 restarts the program in-place (this is what usually happens when an update is applied).
  • Ctrl + ~ toggles the console (Note that this does not work with all keyboard layouts. US layout is a safe bet though).
  • ConPrintf() can be used to output to the console. Search for "===" in the project files if you want to get rid of the default debugging strings.
  • Holding Alt adds additional debugging information to tooltips:
    • Items and passives show all internal modifiers that they are granting.
    • Stats that aren't parsed correctly will show any unrecognised parts of the stat description.
    • Passives also show node ID and node power values.
    • Conditional options in the Configuration tab show the list of dependent modifiers.
  • While in the Tree tab, holding Alt also highlights nodes that have unrecognised modifiers.
  • Holding Ctrl while launching the program will rebuild the mod cache.

Note that automatic updates are disabled in Dev Mode, so you must update manually.

Setting up a development environment

Note: This tutorial assumes that you are already familiar with the development tool of your choice.

If you want to use a text editor, Visual Studio Code (proprietary) is recommended. If you want to use an IDE instead, PyCharm Community or IntelliJ Idea Community (open source) are recommended. They are all free and support EmmyLua, a Lua plugin that comes with a language server, debugger and many pleasant features. It is recommended to use it over the built-in Lua plugins.

Please note that EmmyLua is not available for other editors based on Visual Studio Code, such as VSCodium or Eclipse Theia.

Visual Studio Code

  1. Create a new "Debug Configuration" of type "EmmyLua New Debug"
  2. Open the Visual Studio Code extensions folder. On Windows, this defaults to %USERPROFILE%/.vscode/extensions.
  3. Find the sub-folder that contains emmy_core.dll. You should find both x86 and x64; pick x86. For example, C:/Users/someuser/.vscode/extensions/tangzx.emmylua-0.3.28/debugger/emmy/windows/x86.
  4. Paste the following code snippet directly below function launch:OnInit() in ./src/Launch.lua:
-- This is the path to emmy_core.dll. The ?.dll at the end is intentional.
package.cpath = package.cpath .. ";C:/Users/someuser/.vscode/extensions/tangzx.emmylua-0.3.28/debugger/emmy/windows/x86/?.dll"
local dbg = require("emmy_core")
-- This port must match the Visual Studio Code configuration. Default is 9966.
dbg.tcpListen("localhost", 9966)
-- Uncomment the next line if you want Path of Building to block until the debugger is attached
--dbg.waitIDE()
  1. Start Path of Building Community
  2. Attach the debugger

PyCharm Community / IntelliJ Idea Community

  1. Create a new "Debug Configuration" of type "Emmy Debugger(NEW)".
  2. Select "x86" version.
  3. Select if you want the program to block (checkbox) until you attached the debugger (useful if you have to debug the startup process).
  4. Copy the generated code snippet directly below function launch:OnInit() in ./src/Launch.lua.
  5. Start Path of Building Community
  6. Attach the debugger

Testing

PoB uses the Busted framework to run its tests. Tests are stored under spec/System and run automatically when a PR is modified. More tests can be added to this folder to test specific functionality, or new test builds can be added to ensure nothing changed that wasn't intended.

Running tests

  1. Install LuaRocks
  2. Run luarocks install busted
  3. Run busted --lua=luajit from the command line. You may need to add luajit to your PATH

Docker alternative:

  1. Install Docker
  2. Run docker-compose up -d from the command line
  3. View last results in spec/test_results.log

Creating new test builds or fixing an existing build

Sometimes a change will be made that intends to change the stats garnered by PoB, which will break our tests.

  1. Add the new build XML (if applicable) to the TestBuilds folder
  2. Run busted --lua=luajit -r generate to generate a LUA file that contains the current stats of that build
  3. Run busted --lua=luajit and the tests should pass

Docker alternative:

  1. Add the new build XML (if applicable) to the TestBuilds folder
  2. Run docker-compose up -d to generate a LUA file that contains the current stats of that build and run the tests

Keeping your fork up to date

Note: This tutorial assumes that you are already familiar with Git and basic command line tools.

Note: If you've configured a remote already, you can skip ahead to step 3.

  1. Add a new remote repository and name it upstream.

    git remote add upstream https://github.com/PathOfBuildingCommunity/PathOfBuilding.git
    
  2. Verify that adding the remote worked.

    git remote -v
    
  3. Fetch all branches and their commits from upstream.

    git fetch upstream
    
  4. Check out your local dev branch if you haven't already.

    git checkout dev
    
  5. Merge all changes from upstream/dev into your local dev branch.

    git rebase upstream/dev
    
  6. Push your updated branch to GitHub.

    git push -f origin dev
    

Path of Building development tutorials

Exporting GGPK data from Path of Exile

Note: This tutorial assumes that you are already familiar with the GGPK and its structure. poe-tool-dev/ggpk.discussion is a good starting point.

The ./src/Data folder contains generated files which are created using the scripts in the ./src/Export/Scripts folder based on Path of Exile game data. If you change any logic/configuration in ./src/Export, you will need to regenerate the appropriate ./src/Data files. You can do so by running the ./src/Export scripts using the .dat viewer at ./src/Export/Launch.lua:

Obtain an Oodle extractor

Note: For this tutorial, you will need a working installation of Visual Studio Community as well as some familiarity with build tools such as CMake.

  1. In Visual Studio, clone the following repository using this command:

     git clone -b master https://github.com/zao/ooz
    
  2. Configure CMake.

  3. Build bun_extract_file.exe, libbun.dll and libooz.dll.

Set up the exporter

  1. Copy bun_extract_file.exe, libbun.dll and libooz.dll to ./src/Export/ggpk/.
  2. Create a shortcut to ./runtime/Path{space}of{space}Building.exe with the path to ./src/Export/Launch.lua as first argument. You should end up with something like: "<path to repo>\runtime\Path{space}of{space}Building.exe" "<path to repo>\src\Export\Launch.lua".
  3. Run the shortcut, and the GGPK data viewer UI will appear. If you get an error, be sure you're using the latest release of Path of Building Community.
  4. Paste the path to Content.ggpk (or, for Steam users, C:\Program Files (x86)\Steam\steamapps\common\Path of Exile) into the text box in the top left, and hit Enter to read the GGPK. If successful, you will see a list of the data tables in the GGPK file. Note: This will not work on the GGPK from the torrent file released before league launches, as it contains no Data section.
  5. Click Scripts >> to show the list of available export scripts. Double-clicking a script will run it, and the box to the right will show any output from the script.
  6. If you run into any errors, update the code in ./src/Export as necessary and try again.