• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Is Decomp hacking a lost cause without proficiency in C?

3
Posts
3
Years
    • Seen Apr 9, 2023
    I successfully completed Lunos's guide on installing the DizzyEgg works, but attempting to add another repo to my project just led to more merge conflicts. My first instinct was to resolve the merge conflicts by always replacing the old code with the new code, but I can't imagine that's how you're supposed to do it. I'm getting worried that this is something I can't even do unless I spend a couple years slowly learning even more C first.

    I guess a related question would be whether there's a definite rule of thumb for dealing with merge conflicts. I assume it wouldn't be sustainable to contact the author of every repo for precise instructions on how to manage every conflict, so if there's no simple, generalized solution, I may have to admit defeat and come back in however many years in takes to learn coding well enough.

    Edit: I see there's a subforum that would be more appropriate for this question. I see no way to delete or move this thread, so my apologies for the improper location.
     
    Last edited:
    222
    Posts
    6
    Years
    • Seen Nov 18, 2023
    Git tries its best to merge everything automatically, but let's talk about why a merge conflict happens. Basically if more than one branch edits the same part of the base code, it cannot figure out what to do, and tells you, the user, to resolve it. In other words, there cannot be a "rule of thumb" for merge conflicts because if there was, the computer would have just done it automatically. Every situation is a little different and requires you to look at the actual contents of the conflicting code before making an informed decision.

    Sometimes just replacing the old code with new one works. Other times, you can just include both, like if two different branches added new sprites and there's a conflict where they both defined those files in the code. Most of the time, however, you will need to intelligently combine the two snippets of code. Take a look at the two individual snippets. What are they each trying to accomplish? A lot of the functions have names. Do you generally know what is happening in the place you are trying to merge? What is the new code doing that the old code isn't? What is the old code doing that the new code isn't? Where are they differing? Does it just look like a function got renamed, or is the actual flow of the code different?

    It cannot be avoided. You have to ask yourself these questions in order to solve merge conflicts. You don't need to know the exact details of the entire code, but enough that you can generally understand the pieces of the puzzle. The pret discord is there to help with these sort of things. While learning C will definitely help, it goes beyond that. Merge conflicts are a thing in pretty much every programming language in existence. It's more about understanding why the two pieces of code are incompatible with each other, and what you need to do to make a single, merged function to where they both work.

    So unfortunately, there is no generalized solution for merge conflicts, simply because the very nature of a merge conflict is that it couldn't be solved automatically. You need to understand the code in order to be able to merge it.
     
    28
    Posts
    3
    Years
  • trying to add other repo's ontop of the pokeemerald-expansion causes alot of merge conflicts. Doing the changes manually is also an option if the merge conflicts you get are in the houndreds
     
    Back
    Top