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

Scale oil refinery edge distance up by map size #7514

Merged
merged 1 commit into from Aug 17, 2019

Conversation

nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Apr 15, 2019

I was playing on a huge map and got annoyed at how relatively close to the edges oil refineries had to be built. I think it makes sense to scale the distance up on larger maps.

@SamuXarick
Copy link
Contributor

The setting description is misleading. It also applies to Oil Rigs.

@nielsmh
Copy link
Contributor Author

nielsmh commented Apr 24, 2019

Hm true, the setting value is also used for oil rigs, but I did not change that check to use the same scaling. I should do that too.

@PeterN
Copy link
Member

PeterN commented Apr 24, 2019

Should ScaleByMapSize be involved here?

@nielsmh
Copy link
Contributor Author

nielsmh commented Apr 24, 2019

I looked at that function and decided it's not going to do what I want. ScaleByMapSize scales by the area of the map compared to 256x256, and ScaleByMapSize1D scales by circumference of the map. The scaling I'm going for here is independent in each axis so the setting value effectively acts as numerator in a fraction with denominator 256.

With a setting value of 32, if MapSizeX is 512 the threshold should be doubled in X axis independent of the Y axis dimension.

src/industry_cmd.cpp Outdated Show resolved Hide resolved
Also scales oil rig distance up, since they use the same algorithm.
@LordAro LordAro merged commit 5feb06e into OpenTTD:master Aug 17, 2019
@nielsmh nielsmh deleted the ind-mapedge-check branch August 18, 2019 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants