-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fake parts for filling vehicle gaps #56143
Conversation
eb62c42
to
dfa34ff
Compare
That's a lot of changes. Best of luck |
Ok two major changes:
I've hammered on the automated tests a ton (50 odd test suite invocations), and I'm pretty confident the errors I was seeing cropping up there periodically are resolved, but I haven't had a chance to do more than some light driving around and ramming stuff testing in-game for some more random testing. I'll be pushing fixes tot he things clang-tidy is complaining about as soon as I can, but this PR really does need some fairly heavy testing before it goes in. |
526c5f1
to
3a464b9
Compare
3a464b9
to
2abb28d
Compare
I need to flip to a tiles build to double check for the specific issues you're reporting, but I did find a critical error that is almost certainly related. |
I've finally had a chance to do a tiles build and test, and I'm working my way through the issues you reported.
|
2324bc7
to
8cdfd9c
Compare
…ing real_mount after it has been invalidated.
Summary
Features "Fill gaps in vehicle walls when necessary to maintain vehicle integrity."
Purpose of change
Completes #53722, which is a continuation of #42462, which is an extension of #41277
Fixes #5684
As vehicles turn, they skew and open gaps in previously aligned lines of obstacles. This creates a weird situation where a vehicle that is driving in a cardinal direction fully protects its occupants, but a vehicle driving at any other angle can get hitchhikers.
Describe the solution
On vehicle refresh, the outline of the vehicle is scanned for eligible obstacles and protuberances that have skewed away from their neighbors, when found these obstacles have fake parts added to the vehicle to fill the gaps.
Vehicle damage code forwards all damage instances to the real part instead of the fake part until the real part is destroyed, at which point the fake part is marked for removal as well. Updates to the state of the real part are echoed to the fake parts on vehicle refresh as the fake parts are stripped off of the vehicle and recreated.
Describe alternatives you've considered
Too many to count, but this approach was selected because it mostly contains the change to the vehicle code instead of sprawling across all of the codebase that has to interact with the map.
Testing
Multiple layers of tests were added to exercise this feature, and the propensity for the overmap_terrain_coverage test to trigger several problematic use cases in mapgen has also been extremely valuable.
src/vehicle.cpp:7390 [int vehicle::get_non_fake_part(int)] Returning -1 for get_non_fake_part on part_num -1.
errors.Turns out there was just a typo in the vehicle->vehicle collision code.
Additional context
When merging definitely do a merge even with the relatively messy history to preserve authorship.