-
-
Notifications
You must be signed in to change notification settings - Fork 945
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: Synchronize randomness in vehicle introduction… #7147
Conversation
I don't quite follow what the purpose of this is. Why the change? |
There are (for trains) newgrf vehicles that make no sense without other vehicles. E.g. Some engines need specific wagons, but current randomisation can't force them to be introduced simultaneously. Not a showstopper, but common enough that many train grf authors seem to run into it. |
A side effect of this is that intro dates won't be rerandomized when using "resetengines" or "reload_newgrfs" commands |
Can we get a consensus from set authors as to whether this change is desirable across the board? |
Set authors apparently don't follow GitHub. I like it anyway. |
that's why we should put stuff like this in the dev diary, it'll hopefully get more feedback that way |
As a side effect you are also influencing the base reliability values by this, as they are inside the changed random seeds. It would be easy to switch the order around to restore the current behaviour. |
I'm not convinced this is a bad thing, though |
@andythenorth mentioned exclusive engine previews. Do they need to be taken into account? |
I haven't changed anything about previews, so what probably happens when several non-wagon vehicles get introduced is:
changing this behavior is IMHO out of scope for this PR, and requires more sophisticated methods e.g. to combine several vehicles into one single purchase menu entry |
Yes, reliability will still be random, at least per game seed. Could be put back by moving the RestoreRandomSeeds after the first Random(), I suppose. |
I have tested this with Iron Horse 2 Alpha 7 (from bananas). Works as expected. Test examples:
|
I've now mangled the seed with the GRFID, so it should not synchronize between different GRFs anymore (maybe addon-GRFs need special treatment?) |
The synchronization should also show with the default vehicles (trucks, mostly) |
…s introduced simultaneously will stay at the same date
Also decoupled the synchronization between different vehicle types |
…ss vehicles with the same base introduction date (OpenTTD#7147)
…ss vehicles with the same base introduction date (OpenTTD#7147)
...so all vehicles introduced simultaneously will stay at the same date
we could add a NewGRF flag somewhere to toggle old vs. new behaviour, but for trains misc_flags (prop 27) is already full. the others have a few "reserved, do not use" bits.