Jump to content
Sign in to follow this  
Shenmue

Tutorial: Solve patch conflicts with Visual Studio

Recommended Posts

Solve patch conflicts with Visual Studio

 

Patches can be hard to deal with when they have conflicts. Here is a tutorial on how to use them with the merge operation of Visual Studio. First of all, if you don't know how to apply a patch, you should look the official AscensionGameDev tutorial about them by clicking the link below.

How to apply a patch

 

When applying a patch, conflicts can occur when:

1) Basically, you have modifications on your code that has conflicts with the patch. For example, you changed a line of code used by the patch, or you applied another one.

2) You are not on the correct branch or version of the branch to apply the patch. Is the patch working on master or development banch? What is the latest official working commit with the patch?

3) The patch is not up to date with your project version or code.


Context:

I have diagonal movement patch on a branch and I want to apply the running patch on the same branch, but I am having conflicts.

80231d1e2957b9eb7b62cc1c74970e8c.png


1. Create a branch where the patch is working (official AGD developper branch in this case).

01726842505379e9b4d0a53587211cda.gif


2. Apply the patch on that branch.

5c3bc528bf7cc1dd88df4b74c0a17b7e.png

 

3. Go on the branch you initially wanted to apply the patch.

4. Right click on the branch and click on "Merge From...".
5. Select the branch you applied the patch on the "Merge from branch" section.
6. Click on merge. There should be conflicts.
7. Click on the "Conflicts" action link.
8. Click on the file where there are conflicts.
9. Click on merge.

 

Step 3 to 9

15fe381bbb08a73f9c0917fd05dd050f.gif


Step 3 to 9 separated below

Spoiler

 

3. Go on the branch you initially wanted to apply the patch.

54789498c517d4a12381aed910a8a056.png


4. Right click on the branch and click on "Merge From...".

335462ab16318a83feae9cfdcf3e8f12.png

 

5. Select the branch you applied the patch on the "Merge from branch" section.

02376004fc94ace4045c0a6ad94ae742.png

 

6. Click on merge.

fda17a78ee8f7e743b04fc50ecb9da8a.png

 

7. There should be conflicts. Click on the "Conflicts" action link.

79789bf5b98fb79f00d3f00ada501866.png

 

8. Click on a file where there are conflicts.

4567fb53b32fc2bc3acb278c5654cdb9.png

 

9. Click on merge.

1d60cb639f13ebde08347194c9f878a1.png

 

 

10. A page with conflicts information should appear. Select the checkbox with the code you want to keep. In this case we want both since one is related to the running patch and the other the diagonal move patch (final version is shown on the bottom window. You can edit code on that window).
11. Check all the other conflicts (in this case there was just one).
12. Once there is "0 Remaining" conflicts, click "Accept Merge"


Step 10 to 12

f08db6ab8c7de136e239256576207315.gif

 

Step 10 to 12 separated below

Spoiler

 

10. A page with conflicts information should appear. Select the checkbox with the code you want to keep. In this case we want both since one is related to the running patch and the other the diagonal move patch (Final version is shown on the bottom window. You can edit code on that window).

1f61d808c95ab5ed0ff6aa15830dac0c.png

 

Spoiler

After9d612848449b0018d727412572134155.png

 

11. Check all the other conflicts (in this case there was just one).

 

12. Once there is "0 Remaining" conflicts, click "Accept Merge"

31ad843f99b1c796a5dc911eb800e599.png

 

 

13. Do the same for all the other file on the "Resolve Conflicts" section (in this case there was just one).

 

14. Once every conflicts have been solved, build your solution to check if there are still errors. Click on "Build", then "Build Solution". You should also do some tests in game to be sure everything is fine.

da89ada7e49d71ce51a1381c8b9d8987.png88f0d0576afad5159509635fef454d6c.png

 

15. Everything should be fine now. You can commit changes and play with your new mod.

c930992a8d1686ac34e8f5cf752c98c7.gif0895fb776681e02ada1415bf09581946.gif

 

Note:

You can also download the official Kash Shop tutorial about patch conflicts on the link below.

Download Kash Shop tutorial

Or manually edit your project code with the patch one using diffy.org. Click on the link below for more information.

About diffy.org

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...