Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codechange: split settings.ini over several files #9421

Merged
merged 1 commit into from Jul 9, 2021

Conversation

@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Jul 8, 2021

Fixes #9386.

Motivation / Problem

MacOS build currently fails because our setting tables are too big. But we have been willing to split the settings table up for a while now. So a good enough reason to make that happen.

Description

This reduced the load on compilers, as currently for example MacOS
doesn't like the huge settings-tables.

Additionally, nobody can find settings, as the list is massive and
unordered. By splitting it, it becomes a little bit more sensible.

I split the settings based on the group they are in the settings. There is a lot more to do here, but I wanted to keep an easy-to-review PR. If you use a coloured-diff, you will see that things are only moved:

git fetch https://github.com/TrueBrain/OpenTTD settings-split-table
git show FETCH_HEAD --color-moved=zebra

settings.ini is removed completely, meaning patches will have a nice conflict on it, making it more clear for patches they should be moving their settings.

Future-PRs can address stuff like:

  • Make flags default per settings-file and reduce the amount of things being repeated
  • Force settings-files to read/write into a given struct (instead of repeating that every time)
  • Move some settings around; there are some strange choices currently, for example I am not sure pf.reverse_at_signal should be a pathfinding setting. And there are more similar weird ones.
  • Many more small things.

But, this PR is just to get that car moving. I will not be addressing these things above any time soon, so if you want to, feel free to go for it :)

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')
@TrueBrain TrueBrain force-pushed the settings-split-table branch 3 times, most recently from 106121b to 9e2bf93 Jul 8, 2021
src/table/settings/driver_settings.ini Outdated Show resolved Hide resolved
Loading
src/table/settings/pathfinding_settings.ini Show resolved Hide resolved
Loading
src/table/settings/pathfinding_settings.ini Show resolved Hide resolved
Loading
src/table/settings/world_settings.ini Show resolved Hide resolved
Loading
@TrueBrain TrueBrain force-pushed the settings-split-table branch from 9e2bf93 to 3f37f7b Jul 8, 2021
This reduced the load on compilers, as currently for example MacOS
doesn't like the huge settings-tables.

Additionally, nobody can find settings, as the list is massive and
unordered. By splitting it, it becomes a little bit more sensible.
glx22
glx22 approved these changes Jul 9, 2021
@TrueBrain TrueBrain merged commit 8f5d0ec into OpenTTD:master Jul 9, 2021
15 checks passed
Loading
@TrueBrain TrueBrain deleted the settings-split-table branch Jul 9, 2021
Taschi120 added a commit to Taschi120/OpenTTD that referenced this issue Jul 11, 2021
This reduced the load on compilers, as currently for example MacOS
doesn't like the huge settings-tables.

Additionally, nobody can find settings, as the list is massive and
unordered. By splitting it, it becomes a little bit more sensible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants