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: Shortcut varaction chains for callbacks. #9289

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

@PeterN
Copy link
Member

@PeterN PeterN commented May 22, 2021

Motivation / Problem

By design, an unhandled callback often ends up following the default graphics chain. Depending on the variables accessed this could potentially be expensive.

Description

If a varaction chain does contain any callback results, do not continue evaluating the chain. This possibly avoids processing complex graphical chains which can never end in a callback result.

Limitations

This is not really benchmarked and is hypothetical at this point. It's not impossible that the additional test causes more work over all.

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')
@frosch123
Copy link
Member

@frosch123 frosch123 commented Jun 12, 2021

This looks like it need simliar checks as NML's switch optimisation.

  • Rerandomisation is already part of the diff.
  • Writing persistent storage is missing.

Loading

@PeterN
Copy link
Member Author

@PeterN PeterN commented Jun 13, 2021

Added what I think is the case for writing to persistent storage. Not really familiar with that system tbh.

Loading

PeterN added 2 commits Sep 27, 2021
If a varaction chain does contain any callback results, do not continue evaluating the chain. This possibly avoids processing complex graphical chains which can never end in a callback result.
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.

None yet

2 participants