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.

@nielsmh nielsmh force-pushed the ind-mapedge-check branch from 82796cb to 4ed36eb Compare April 24, 2019 16:31
@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.

@nielsmh nielsmh force-pushed the ind-mapedge-check branch from 4ed36eb to 28b8ab7 Compare June 9, 2019 09:31
Also scales oil rig distance up, since they use the same algorithm.
@nielsmh nielsmh force-pushed the ind-mapedge-check branch from 28b8ab7 to 78fc910 Compare June 9, 2019 09:32
@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