The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Is Decomp hacking a lost cause without proficiency in C?

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old August 2nd, 2021 (6:52 PM). Edited August 2nd, 2021 by Metaright.
Metaright Metaright is offline
 
Join Date: Apr 2021
Posts: 4
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.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old August 3rd, 2021 (8:24 AM).
hjk321's Avatar
hjk321 hjk321 is offline
 
Join Date: Sep 2017
Posts: 219
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.
__________________
Binary is dead.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old August 5th, 2021 (5:48 AM).
trikop's Avatar
trikop trikop is offline
 
Join Date: Jun 2020
Location: Planet Earth
Nature: Lonely
Posts: 28
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
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:22 AM.