Add: Setting to uniformly slow the acceleration and braking of realistic trains
[openttd-jgr.git] / CONTRIBUTING.md
blob668d73d70091fa8d08e422ece8b003bcd7e90dad
2 # Contributing to OpenTTD
4 Looking to contribute something to OpenTTD? **Here's how you can help.**
6 Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.
8 Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project.
9 In return, they should reciprocate that respect in addressing your issue or assessing patches and features.
12 ## Using the issue tracker
14 The [issue tracker](https://github.com/OpenTTD/OpenTTD/issues) is the preferred channel for [bug reports](#bug-reports), but please respect the following restrictions:
16 * Please **do not** use the issue tracker for help playing or using OpenTTD.
17 Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel), [Discord](https://discord.gg/openttd), or the [forums](https://www.tt-forums.net/)
19 * Please **do not** derail or troll issues. Keep the discussion on topic and respect the opinions of others.
21 * Please **do not** post comments consisting solely of "+1" or ":thumbsup:".
22 Use [GitHub's "reactions" feature](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) instead.
23 We reserve the right to delete comments which violate this rule.
25 * Please **do not** open issues or pull requests regarding add-on content in NewGRF, GameScripts, AIs, etc.
26 These are created by third-parties.  Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel), [Discord](https://discord.gg/openttd), or the [forums](https://www.tt-forums.net/) to discuss these.
28 * Please use [the web translator](https://translator.openttd.org/) to submit corrections and improvements to translations of the game.
31 ## Bug reports
33 A bug is a _demonstrable problem_ that is caused by the code in the repository.
34 Good bug reports are extremely helpful, so thanks!
36 Guidelines for bug reports:
38 0. Please don't report issues with games where you changed NewGRFs mid-game. (This can be verified with the `gamelog` console command in-game.)
40 1. Please don't report issues with modified versions of OpenTTD (patchpacks, unofficial ports, and similar).
42 2. **Use the GitHub issue search** — check if the issue has already been
43 reported.
45 3. **Check if the issue has been fixed** — try to reproduce it using the latest `nightly` build of OpenTTD, available from https://www.openttd.org
47 4. **Isolate the problem** — ideally create reproducible steps with an attached savegame and screenshots. Try to use few or no NewGRFs, AIs etc if possible.
49 A good bug report shouldn't leave others needing to chase you up for more information.
50 Please try to be as detailed as possible in your report.
52 * What is your environment?
53 * What steps will reproduce the issue?
54 * Which operating system(s) experience the problem?
55 * What would you expect to be the outcome?
57 All these details will help people to fix any potential bugs.
59 Example:
61 > Short and descriptive example bug report title
63 > A summary of the issue and the OS environment in which it occurs. If
64 > suitable, include the steps required to reproduce the bug.
66 > 1. This is the first step
67 > 2. This is the second step
68 > 3. Further steps, etc.
70 > Attached savegame
71 > Attached screenshots showing the issue
72 > Crashlogs if the bug causes a crash
74 > Any other information you want to share that is relevant to the issue being
75 > reported. This might include the lines of code that you have identified as
76 > causing the bug, and potential solutions (and your opinions on their
77 > merits).
80 ## Feature requests
82 Before opening a feature request, please take a moment to find out whether your idea fits with the [scope and goals](./CONTRIBUTING.md#project-goals) of the project.
84 It's up to *you* to make a strong case to convince the project's developers of the merits of this feature.
86 Please provide as much detail and context as possible.
87 This means don't request for a solution, but describe the problem you see and how/why you think it should be fixed.
89 For feature request we have a strict policy.
91 Keeping issues around with "a good idea" or "not really a bug but we should maybe fix it" turns out to have the reversed effect: nobody looks at it anymore.
93 Although we really appreciate feedback and ideas, we will close feature requests that we don't expect to fulfill in the next year.
95 Many of those ideas etc do have a place on the [forums](https://www.tt-forums.net); and if enough people like it, someone will stand up and make it.
97 It's usually best to discuss on [Discord](https://discord.gg/openttd) before opening a feature request or working on a large feature in a fork.
98 Discussion can take time, but it can be productive and avoid disappointment. :)
101 ## Pull requests
103 Good pull requests—patches, improvements, new features—are a fantastic help.
105 Pull requests should fit with the [goals of the project](./CONTRIBUTING.md#project-goals).
107 **Please do ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code, porting to a different language), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.
109 Every pull request should have a clear scope, with no unrelated commits.
111 [Code style](./CODINGSTYLE.md) must be complied with for pull requests to be accepted; this also includes [commit message format](./CODINGSTYLE.md#commit-message).
113 Adhering to the following process is the best way to get your work included in the project:
115 1. [Fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) the project, clone your fork, and configure the remotes:
117 ```bash
118 git clone https://github.com/<your-username>/OpenTTD.git openttd
119 git clone https://github.com/OpenTTD/OpenTTD-git-hooks.git openttd_hooks
120 cd openttd
121 git remote add upstream https://github.com/OpenTTD/OpenTTD.git
122 cd .git/hooks
123 ln -s ../../../openttd_hooks/hooks/* .
126 2. If you cloned a while ago, get the latest changes from upstream:
128 ```bash
129 git fetch upstream
132 3. Create a new topic branch (off the main project development branch) to
133 contain your feature, change, or fix:
135 ```bash
136 git checkout upstream/master -b <topic-branch-name>
139 4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](./CODINGSTYLE.md#commit-message) or your code is unlikely to be merged into the main project.
140 Use Git's [interactive rebase](https://docs.github.com/en/get-started/using-git/about-git-rebase) feature to tidy up your commits before making them public.
142 5. Locally rebase the upstream development branch into your topic branch:
144 ```bash
145 git fetch upstream
146 git rebase upstream/master
149 6. Push your topic branch up to your fork the first time:
151 ```bash
152 git push --set-upstream origin <topic-branch-name>
155 And any time after that:
157 ```bash
158 git push
161 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description against the `master` branch.
163 **IMPORTANT**: By submitting a pull request or patch, you agree to the [License](#license) and the [Privacy Notice](CONTRIBUTING.md#privacy-notice).
166 ### Pull request validation
168 Continuous integration (CI) tools monitor pull requests, and help us identify build and code quality issues.
170 The results of the CI tests will show on your pull request.
172 By clicking on Details you can further zoom in; in case of a failure it will show you why it failed.
173 In case of success it will report how awesome you were.
175 Tip: [commit message format](./CODINGSTYLE.md#commit-message) is a common reason for pull requests to fail validation.
178 ### Are there any development docs?
180 There is no single source for OpenTTD development docs. It's a complex project with a long history, and multiple APIs.
182 A good entry point is [Development](https://wiki.openttd.org/en/Development/) on the OpenTTD wiki; this provides links to wiki documentation and other sources.
184 The GitHub repo also includes some non-comprehensive documentation in [/docs](./docs).
185 These include:
186 - When to [change other languages and when not to](./docs/eints.md).
187 - The [savegame format](./docs/savegame_format.md).
188 - The [release process](./docs/releasing_openttd.md).
189 - Some [notes on the link graph algorithm](./docs/linkgraph.md).
190 - The [network game coordinator](./docs/game_coordinator.md).
191 - How to use [the admin port for network games](./docs/admin_network.md), also useful for multiplayer server hosts.
192 - The [performance metrics and logging features](./docs/logging_and_performance_metrics.md), also useful for add-on developers.
193 - How [symbol server and analysis works](./docs/symbol_server.md).
194 - And several miscellaneous files detailing internal data structures and graphics measurements and palettes.
196 You may also want the guide to [compiling OpenTTD](./COMPILING.md).
199 ## Project goals
201 ### What are the goals of the official branch?
203 The main goals of the official branch are:
205 - Stay faithful to the original gameplay from Transport Tycoon Deluxe
206 - Improve the user interface
207 - Allow extending the gameplay with add-ons / mods via supported content APIs
208 - Provide a (relatively) stable core for both players of the official branch, and for authors of add-ons and maintainers of patchpacks
210 In contrast, extending or altering the gameplay of the base game is not encouraged.
212 The rationale behind these goals is that people have different opinions about what OpenTTD is and what it should be.
213 When it comes to gameplay, there are at least these groups of people:
215 - *Model railway (mostly singleplayer)*: build "realistic" landscapes, roleplay a world, or even replicate historical scenarios
216 - *Economical challenge (mostly singleplayer)*: run a business with economical challenges
217 - *Transport challenge (singleplayer or cooperative multiplayer)*: build efficient track layouts with high cargo throughput and tons of vehicles
218 - *Competitive speed run (competitive multiplayer)*: maximize some goal in some limited amount of time
220 When it comes to gameplay features there are at least these groups of interests:
222 - *Control freak:* micromanagement like conditional orders, refitting and loading etc.
223 - *Casual:* automatisation like cargodist, path based signalling etc.
225 To please everyone, the official branch tries to stay close to the original gameplay; after all, that is what brought everyone here.
226 The preferred method to alter and extend the gameplay is via add-ons like NewGRF and GameScripts.
228 For a long time, the official branch was also open to features which could be enabled/disabled, but the corner-cases that came with some configurations have rendered some parts of the code very complicated.
229 Today, new features have to work with all the already existing features, which is not only challenging in corner cases, but also requires spending considerable more work than just "making it work in the game mode that I play".
231 The preferred method to introduce new gameplay features is to extend the content APIs, supporting ever more add-on content / mods.
233 This moves conflict-solving away from the codebase to content authors / players.
234 It is more accepted for add-ons not working together than the base game not working with certain setting combinations.
236 In general the game should allow anything that doesn't violate basic rules, but it should warn players if they take potentially dangerous or "stupid" actions.
238 For example, players are not prevented from starting vehicles without orders, but will receive a warning about vehicles having too few orders.
239 This lack of limitation has led to players challenging themselves to create networks where all vehicles have no orders, increasing gameplay possibilities.
241 ### I do not agree with the goals of the official branch, what can I do instead?
243 Fork!  There is a rich history of experimental patches for OpenTTD.
245 Many of these will never be accepted for core, but are creative and interesting ways to modify OpenTTD.
247 Sometimes patches are combined into long-running patchpacks, modified OpenTTD versions which can be downloaded by anyone, or modified OpenTTD clients for dedicated multiplayer servers.
249 One of the reasons to keep core relatively stable is to make life easier for patch authors and patchpack maintainers where possible.
251 Patchpack discussions and related topics may be found in community sites such as [TT-Forums development section](https://www.tt-forums.net/viewforum.php?f=33).
254 ## Legal stuff
256 ### License
258 By contributing your code, you agree to license your contribution under the [GPL v2](https://github.com/OpenTTD/OpenTTD/blob/master/COPYING.md).
261 ### Privacy Notice
263 We would like to make you aware that contributing to OpenTTD via git will permanently store the name and email address you provide as well as the actual changes and the time and date you made it inside git's version history.
265 This is inevitable, because it is a main feature of git.
266 If you are concerned about your privacy, we strongly recommend to use "Anonymous &lt;anonymous@openttd.org&gt;" as the git commit author. We might refuse anonymous contributions if malicious intent is suspected.
268 Please note that the contributor identity, once given, is used for copyright verification and to provide proof should a malicious commit be made.
269 As such, the [EU GDPR](https://gdpr.eu) "right to be forgotten" does not apply, as this is an overriding legitimate interest.
271 Please also note that your commit is public and as such will potentially be processed by many third-parties.
272 Git's distributed nature makes it impossible to track where exactly your commit, and thus your personal data, will be stored and be processed.
273 If you would not like to accept this risk, please do either commit anonymously or refrain from contributing to the OpenTTD project.
276 ### Attribution of this Contributing Guide
278 This contributing guide is adapted from [Bootstrap](https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md) under the [Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/) terms for Bootstrap documentation.
279 The GDPR notice is adapted from [rsyslog](https://github.com/rsyslog/rsyslog/blob/master/CONTRIBUTING.md) under the [GNU General Public License](https://github.com/rsyslog/rsyslog/blob/master/COPYING).