Divinity: Original Sin (Classic)

Divinity: Original Sin (Classic)

120 ratings
4-Player Co-op Campaign Modification
By Big Snuffa
Modify the main campaign for 4-player co-op without The Divinity Engine or mods

This short noob-proof guide illustrates the modification of the main campaign of Divinity: Original Sin to support 4 player co-operation without the use of The Divinity Engine or mods.

The campaign was (probably) originally planned to support 4 players, but this was later changed to only 2-player co-op. The reason for this was that the two extra players would only control the henchmen that have no influence to the story or the co-operative dialogue and they would probably feel left out of the game and the story. Larian said, however, that the main campaign could be modified to support 4-player co-operation, but the Divinity Engine doesn't allow the modification of the main campaign (at least in its current state) and doesn't support packing or unpacking of the game files. This is the main reason I'm doing this guide, to instruct how to modify the files without the use of The Divinity Engine or any mods.

Feature list:

- Very economical modification: no need to use mods of any kind!

- Clients (the people joining the game) don't have to do any modifications or use any mods whatsoever!

- All vanilla save games are compatible!

- No mod related crashing or compatibility errors!

EDIT: The guide has been modified to reflect the changes after the update 1.0.169. Because the amount of data the main campaign contains has been increased, it is now divided among 3 pak files. The NumPlayers text string is now located in Main_1.pak! The rest of the guide remains unedited. From now on, open the Main_1.pak file in the hex editor, instead of Main.pak.

EDIT2: The line to be edited is now located in the Main.pak file. For future record, if you can't find the line to be edited in the Main.pak file, try searching the other .pak files in the folder that begin with 'Main'. The whole campaign data is divided between these multiple .pak files, so between game versions, the location of the string may change.


- If a game patch replaces the Main.pak file (the file to be modded)(just about every patch does this), obviously the editing has to be done again!

- You have to have characters (henchmen) to assign to all the players on the server. If you have not recruited henchmen for the third and the fourth player to play as, they will get a black screen after joining the game and then disconnect from the server soon after! Also, don't attack the henchmen (outside of battles); even when player controlled, when attacked, they can turn hostile and leave the party.

- If you try to make the main.pak file into its own module by moving it into My Documents\Larian Studios\Divinity Original Sin\Mods folder or if you have any other modifications to the main campaign, the game may crash on startup!

- If you have any backed up .pak files in the Data-folder (or indeed any .pak files in addition to the ones already there) that begin with 'main' or 'main.pak', ie. "Main.pak.original" or "main.pakbackup", the game will crash!
Step 1. Required software
The only piece of software you need is a hex editor. There are dozens of these on the internet and they're all fine.

If you don't have a hex editor, you can download the freeware hex editor XVI32 here: http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm
Step 2. Opening the file with a hex editor
First of all, open the hex editor from a shortcut or the main .exe file (remember to Run as Administrator!) and keep it open in the background.
Next, locate Divinity: Original Sin's game directory. Go to Steam's library -> right-click on Divinity: Original Sin -> Properties... -> Local Files -tab -> Browse Local Files...

(The following instructions are specifically for XVI32, but probably work just as well for other hex editors)

Open the folder named Data and drag-and-drop 'Main.pak' -file into the hex editor window. The hex editor starts to read the file. Main.pak file is a big one, so it may take a while.

The file in the hex editor looks like this.
Step 3. Finding the data to edit
Press Ctrl + F. The search window should open. Click on the Text string -radio button to search by text. Copy and paste the following text into the search box: attribute id="NumPlayers" (the search is case sensitive!). Click OK.

This search should bring you to the point where the main campaign's meta.lsx -file is located in the .pak file. Since the .pak files are unencrypted, they can be easily modified with a hex editor.

Note: If the search returns nothing, it may be that the string isn't there. Between game versions the location of the string may change, so in that case, look for it in other .pak files in the Data-folder that begin with 'Main'.

The location should look like this. Note that the hex address can be different!
Step 4. The actual modification
Following the found string, in the right-hand side, you should see a text like this: value="2" .
This is the player count of the campaign. Change the value by clicking on the '2' and replacing it with '4'. The value can really be anything from 1 to 100, but 4 is the optimal player count for the campaign.
Be careful not to overwrite or delete any other characters, such as the quotes around the number.

Like so.

Save the file, close the hex editor and you're done! The main campaign is now enabled for jolly 4 player co-operation!

You can find the in-game multiplayer connections menu by clicking on the diamond icon above the minimap. If you did everything correctly, the menu should look like this. Note the three player slots on the bottom.
< >
[ANIME-SQUAD] Bon1X Jul 8, 2017 @ 12:17pm 
attribute id="NumPlayers" string not found
LAROmega Nov 1, 2015 @ 4:41pm 
@Dumb "Le Doré" I suggest keeping up with with thread on the Larian forums. Lots of good stuff coming out of there, but ya so far the address seems to be changing slightly with each patch. Though Norbyte says it's easy to figure out the new one. Just makes writing a guide a bit difficult. =)
Big Snuffa  [author] Oct 29, 2015 @ 11:31pm 
@LAROmega Gah, really? That sounds like a lot of .exe disassembly to be done, for the game is still a bit buggy and I assume there are gonna be a ton of patches and there is probably no guarantee that the .exe and the appcall stay the same. Making a table of addresses to mod for each version sounds more intricate than I was hoping for. I'll try this hex editing with as many versions as I can find.

I was actually more interested in the triggering message's conditions. For example, only the two main characters get an isPlayer(); attribute, though I'm not sure if that's the condition being checked. It could be one (or more) of the numerous companion attributes in the code. By fulfilling the conditions (or just making them null) we might make this mod easier to build and manage between versions. I'll see to it later today and in the weekend. You guys are welcome to extrapolate and experiment on this.
LAROmega Oct 29, 2015 @ 4:11pm 
Though, that matters more for GoG users than Steam users. =)
LAROmega Oct 29, 2015 @ 4:11pm 
Good job! Worth pointing out that this is for version of the game. The hex address doesn't exist in the release version of the exe.
Nazar Oct 29, 2015 @ 1:47pm 
Go for it. I wasn't really planning on posting a guide, I was mostly just bouncing my ideas and tests around to see if anyone else could elaborate on them. It proved successful in the end. Your original guide is great and beginner friendly, so I'm looking forward for an updated Enhanced Edition guide from you.

Big Snuffa  [author] Oct 29, 2015 @ 1:39pm 
Haha, I was just looking for the very same appcall in the .exe. Might make a new guide later, if you're okay with me stealing your and Norbytes thunder
Nazar Oct 29, 2015 @ 12:57pm 
Alright, with the help of a larian forum user Norbyte, I was able to get the modification working. Read this thread for how to: http://larian.com/forums/ubbthreads.php?ubb=showflat&Number=572844&#Post572844

You'll need to hex edit the main.lsx file to increase server size to 4 people, and you will have to edit the main game exe (just make a copy of the exe) to remove the call for the "must have main character" error. Only the person hosting needs to do these things. People connecting don't have to make any modifications.

Short demo of it in action: https://www.youtube.com/watch?v=iCVdpCkUWwg

Good luck all.
Too Fast for Polizia Oct 29, 2015 @ 9:49am 
Hey, first off I'd like to thank you for your work and the time put into this when you could simply work it out for yourself and not waste time helping everyone else! Me and a couple friends had the old version on GoG so we got the game there, do you think it's gonna be an issue for any possible solution you might be able to find?
Btw, how long do you guys think it will take for the official modding tool to be released?
Serenity Now... Oct 29, 2015 @ 8:12am 
Thanks for all the time you've committed thus far Dumb "Le Dore". Hopefully we get this working by the weekend :).