-
-
Notifications
You must be signed in to change notification settings - Fork 875
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
Feature: [NewGRF] Allow higher max speeds for ships #10734
Conversation
Not sure that how this was done for Road Vehicles is a good example... nor do I know why it was done that way. Just adding a uint16 to set max_speed seems to make more sense to me. |
2414ab4
to
aa33bec
Compare
I agree that setting the maximum speed as a new uint16 property, just like the long format introduction (1A vs 00 for ships), would be better for the future. Similarly, why not expose the acceleration of the vehicle to NewGRFs as well? Aircraft has such a thing, though maybe use a more sensible unit? |
aa33bec
to
681ef0a
Compare
@PeterN @rubidium42 The property is now an uint16, and the acceleration is also added as a property. The acceleration is 0.5 km/h per tick, which is still not a really sensible unit. These numbers are basically dictated by the integer math that control ships, not much I can do about it without more high-impact changes. |
I'd be interested in seeing this in 14.0 alongside the new ship pathfinder, if we have a qualified reviewer (which I am not) to sign off on it. |
681ef0a
to
afc7643
Compare
I've resolved the merge conflict and reverted the change in the value of |
Yeah, of course. I'll have to do some digging though. The code may have been lost to an openttdcoop hole in the cloud, but I should have all original sprites and reverse engineering the code should be easy enough. I've just moved house, so no Internet right now, feel free to remind me in a week or so if no progress. |
|
Ok, I've got my ekranoplan grf essentially revived. I haven't got a nice I've also grabbed the sprites and set them up for a nicer |
Another day, another bump. I've finished NML recode of the ekranoplan newGRF, available here: https://github.com/zephyris/openttd-newgrfs/tree/main/ekranoplan Currently, their speeds are all 127 km/h, but there are comments with the correct speed for each vehicle. |
ekranoplan.zip |
afc7643
to
60da72d
Compare
The NewGRF works! Only caveat is that it needs almost 256 tiles to get up to speed with the slow acceleration it got now (not configured). Ship 1 is the "slow" one, Ship 2 is the "fast" one. |
Awesome. This is a test newGRF with three variants, one now with Assuming this works as expected, this looks decent from a newGRF author perspective. Just one query: What's the default acceleration? ie. default value for |
The super-high acceleration is really noticeable. For slower acceleration we would need to get fractional speeds for ships. That's going to be a huge hassle, so I do not think making acceleration any slower would be a good idea. |
60da72d
to
f0aac56
Compare
f0aac56
to
ad0d3af
Compare
The default acceleration is indeed 1 unit per tick, in some kind of bizarre unit that I can't remember. IMO we don't need any slower than that, but we do need higher acceleration for fast ships to look a bit more realistic. @zephyris you might have overdone the acceleration in your newgrf a bit though :P . It is a lot of fun to play around with! |
That was deliberate! I wanted to check that a single byte for acceleration was appropriate. Back of the envelope calculation says yes, but seeing it in-game is the real test. Just need some nml support now, so I don't have to hack through decompiled nfo to get the high speeds set :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me, and Ekranoplan seems like an excellent stress-test to prove that it works for NewGRF authors. 😃
Motivation / Problem
I recently made this fix: #10695 . In the original bug report was a link to a forum thread about the Ekranoplans https://www.tt-forums.net/viewtopic.php?t=39188 . These are Soviet era ground effect ships that can go up to 500 km/h, but the max speed of ships in openttd is 128 km/h. This PR changes that.
Description
I added a new uint16 value that allows higher ship speeds to be set. I also added a byte to set the acceleration, because with the default acceleration fast ships take a very long time to accelerate, which looks a little odd.
Limitations
More a limitation of the dev: this is the first time I've worked on anything NewGRF-related. Please let me know if I forgot something.
I've never created a NewGRF and obviously there are no NewGRFs available that contain these new values. For testing I just hacked the code in newgrf.cpp:1596 to multiply the ship speed by e.g. 4, and set the acceleration value to a high value. It would be great if somebody with a bit of newgrf-making experience could verify if it works.
NOTE TO SELF: https://newgrf-specs.tt-wiki.net/wiki/Action0/Vehicles/Ships update this page when this PR is merged.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.