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

NewGRF Town Names no longer compile after unknown changes #184

Closed
Gadg8eer opened this issue Jan 18, 2021 · 7 comments
Closed

NewGRF Town Names no longer compile after unknown changes #184

Gadg8eer opened this issue Jan 18, 2021 · 7 comments

Comments

@Gadg8eer
Copy link

@Gadg8eer Gadg8eer commented Jan 18, 2021

I am unable to compile FicTownNames Reloaded, and various other town name NewGRFs have been tested to also fail to compile under similar circumstances under nmlc 5.3...

ERROR: "src/FicTownNames_R.nml", line 28: Not enough random bits for the town name generation (40 needed, 32 available)

...but compile with no issues in nmlc 4.5, therefore I seem to have discovered an undocumented bug. If it's not a bug, and the bits are not meant to be used more than once, then I'm afraid you have made every sufficiently large town name GRF obsolete. Hopefully there's an easy fix for this?

I can provide my source code if needed, but it's a universal issue affecting all GRFs.

@Gadg8eer Gadg8eer closed this Jan 18, 2021
@Gadg8eer Gadg8eer reopened this Jan 18, 2021
@Gadg8eer
Copy link
Author

@Gadg8eer Gadg8eer commented Jan 18, 2021

Oops, mistakenly clicked the close issue button.

@FLHerne
Copy link
Contributor

@FLHerne FLHerne commented Jan 18, 2021

The change responsible is #117, a fix for bug #116, introduced in 0.5.1.

nmlc definitely wasn't using enough random bits before in some cases, so it might not be possible to correctly compile this grf.

@Gadg8eer
Copy link
Author

@Gadg8eer Gadg8eer commented Jan 20, 2021

The change responsible is #117, a fix for bug #116, introduced in 0.5.1.

nmlc definitely wasn't using enough random bits before in some cases, so it might not be possible to correctly compile this grf.

So then what's the idea? People have to compile town names with old versions of nmlc?

@glx22
Copy link
Contributor

@glx22 glx22 commented Jan 20, 2021

It just means the grf compiled with older version were actually broken and couldn't generate all expected names.

@FLHerne
Copy link
Contributor

@FLHerne FLHerne commented Jan 20, 2021

That said, the example here has 1600 or so single-part names. I know we need some magic to split those into ActionFs, but naïvely it seems 32 bits should be more than enough...

@glx22
Copy link
Contributor

@glx22 glx22 commented Jan 20, 2021

I could try to implement splitting, but I need a nml file to analyse and test.

@glx22
Copy link
Contributor

@glx22 glx22 commented Jan 20, 2021

I modified townames regression nml to do some tests and it seems nmlc wastes bits. I think it would save 6 bits if it could determine that all options for main can share the same bit range. So I can easily imagine that being worse for huge grf.

glx22 added a commit to glx22/nml that referenced this issue Jan 21, 2021
glx22 added a commit to glx22/nml that referenced this issue Jan 21, 2021
@glx22 glx22 closed this in 833cf39 Jan 21, 2021
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 pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants