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

Change: Treat extended waypoint classes as 'WAYP' class. #12618

Open
wants to merge 1 commit into
base: release/14
Choose a base branch
from

Conversation

PeterN
Copy link
Member

@PeterN PeterN commented May 3, 2024

Motivation / Problem

Authors have asked for more custom waypoint classes, as lumping all waypoints into just one class gives a very big list.

My plan on the easiest way to achieve this is to treat all classes with the MSB as 0xFF as a waypoint class.

WIth #12595, this is almost implemented. However, to use the feature requires support from NewGRFs, and if they add this support then they will not work properly in 14.x

Description

So this PR is intended to provide a little "forward-compatibility" for 14.x, by translating new waypoint classes to the standard 'WAYP' class.

This maps the extended custom waypoint clases (where the first byte of the label is 0xFF) to the standard 'WAYP' label, allowing use of them before the feature exists.

Limitations

This also assumes that more-waypoint-classes plan with 0xFF as MSB is reasonable.

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 touches english.txt or translations? Check the guidelines
  • 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, game_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@PeterN PeterN added backport requested This PR should be backport to current release (RC / stable) needs review: NewGRF Review requested from a NewGRF expert labels May 3, 2024
@bootmii

This comment was marked as off-topic.

@2TallTyler
Copy link
Member

To clarify the "why" a bit from our Discord discussion:

The purpose of this future-proofing is to allow GRF authors to make waypoints that have classes, which show up in classes in nightlies (and eventually 15.0+), but also work in older versions of OpenTTD like 14.1. That way, they can make classes without having to wait a whole year for the next release.

I very much like the idea, but let's not hold up 14.1 while we decide on this. We can ship a 14.2 if we decide to do this.

@rubidium42
Copy link
Contributor

I guess this requires retargetting the 14 branch now.

@PeterN
Copy link
Member Author

PeterN commented May 22, 2024

Probably, a backport from master would need 1) changing for 14.x and 2) reverting again.

This maps the extended custom waypoint clases (where the first byte of the label is 0xFF)
to the standard 'WAYP' label, allowing use of them before the feature
exists.
@PeterN PeterN changed the base branch from master to release/14 May 23, 2024 07:52
@PeterN PeterN removed the backport requested This PR should be backport to current release (RC / stable) label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review: NewGRF Review requested from a NewGRF expert
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants