Skip to content

Git & Mapping

Spookerton edited this page Jun 5, 2016 · 1 revision

This is a direct copy of the ancient, ancient baystation git & mapping guide, and needs to be brought into the modern age; it is here as part of game wiki housekeeping, and will receive love at some unspecified future time.


This guide assumes you've already 'set up' your git. If you didn't, look at setting up git first.

If you are creating a new map entirely out of scratch, you don't need to follow this guide, as merge conflicts aren't possible if the map doesn't already exist.

===== The Issue ===== Merge conflicts occur when two people try to edit the same thing at the same time. This is a hassle for both of them and the maintainers, so techniques were developed to minimize the odds of this occurring. Unfortunately, due to how maps are saved, merge conflicts were basically guaranteed if someone edited the same map file.

Were.

There is a rather simple way to almost eliminate the odds of that occurring nowdays. The exception if if both parties are editing the same exact tile, but it requires some set-up.

===== Step 0 - Set Up Git ===== Go set up git, set up a GitHub account, fork the code, and (highly recommended) learn how to use TortiseGit. To figure out how to do this, see setting up git.

===== Step 1 - Before Mapping ===== YOU MUST DO THIS BEFORE YOU START CHANGING THE MAP!

Open the folder containing the source code, navigate to 'tools/mapmerge/', then run '1prepare_map.bat'. This 'prepares' all of the maps you have in your maps folder.

===== Step 2 - Mapping ===== Start adding your changes to whatever map you're editing.

===== Step 3 - Testing ===== Save and TEST YOUR CHANGES. Make sure it compiles. Run the game and ensure that no errors are present. Walk around in the area you changed and see if anything's missing or if something's just not right. If something's wrong, fix it and test again.

===== Step 4 - Cleaning The Map ===== First, make a backup of your map, if you're feeling paranoid.

If your map works, you're happy with it, and you think you're finished, you must do one more step before committing and pushing. Navigate to 'tools/mapmerge/' again, and run '2clean_map.bat'.

===== Step 5 - Commit & Push ===== After your map is cleaned, it is ready to be committed. Using TortiseGit/your git client of choice/git bash, commit your cleaned map to the branch you're working on, push to 'origin', and then make a pull request on GitHub, and hope the maintainers likes your changes.

Assuming you did everything correctly, the additions/deletions of your pull request shouldn't be a huge number, and conflicts shouldn't occur, as long as everyone else did what you did.

===== A Reminder ===== You must run prepare_map.bat every time you start a new branch or if you clean your map and you want to change it again.