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

Load vehicles before explosion + leaks at right map #79853

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

PatrikLundell
Copy link
Contributor

@PatrikLundell PatrikLundell commented Feb 25, 2025

Summary

None

Purpose of change

  • Make separate map explosions affect vehicles.
  • Make leaks from explosion touched vehicles spill on the correct map.
  • Handle division by zero when vehicle has no real parts left (all removed or fake)
  • Cause items to fall after explosions have generated them.

Describe the solution

  • Enable vehicle loading in "load".
  • Use the map aware version of spillage in the call chain used by explosions.
  • Check for total weight of vehicle being zero, indicating no parts contributed to the weight and set the mass center to zero.
  • add call to process_falling() after an explosion has generated them in the non reality bubble explosion case.

Describe alternatives you've considered

Continue to try to find why pivot_anchor[1] contains garbage. I will do that, but would appreciate help.

Testing

Prior to the load call change vehicles randomly weren't subjected to the effect of the explosion, while afterwards they are badly damaged.
Prior to the change to the spillage code acid from batteries occasionally (20%?) appeared in front of the PC rather than on the explosion site.
Tested until a zero vehicle failure occurred and looked through the debug output added to verify zero vehicle parts were processed. This code adjusted the generated position to (0, 0).
The code was then revised to the committed one, but I'm not going to test that due to the number of attempts it takes for this failure case to occur.

The explosion results:
Screenshot (653)

Done after the screenshot above:
Set off a barrel bomb, move away from it outside the reality bubble, return after the timer has expired so it explodes when entering the reality bubble, move to the crater, observe the debris is no longer hovering, but has fallen to the bottom of the crater.

Additional context

I've removed the text placed here during the draft phase as it no longer serves a purpose.

It can be noted that levitating explosion products still exist after the explosion. This was the case before these changes as well, so it's not a regression, but something that will have to be tracked down and fixed in a future PR. Now included in this PR, as it's another one liner.

@PatrikLundell PatrikLundell marked this pull request as draft February 25, 2025 17:22
@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 25, 2025
@github-actions github-actions bot added the Vehicles Vehicles, parts, mechanics & interactions label Feb 26, 2025
@PatrikLundell PatrikLundell marked this pull request as ready for review February 26, 2025 14:03
@PatrikLundell PatrikLundell mentioned this pull request Feb 27, 2025
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 27, 2025
@PatrikLundell
Copy link
Contributor Author

PatrikLundell commented Feb 27, 2025

Hm, this error is interesting: General build matrix / Basic Build and Test (Clang 10, Ubuntu, Curses) (pull_request)

As far as I can see from the error, a vehicle is generated right at the edge of the tinymap the map special is generating, causing parts of it to end up outside of the map. Then there's bashing going on, which might quite possibly go via the updated bashing route in this PR, causing the code to detect it happens outside of the map (rather than just obliviously use the reality bubble map).

I'm having trouble recreating the error, though, as rerunning this particular test case over and over doesn't seem successful when providing the rng seed fails (I've never had it actually work... Perhaps seeds are platform specific).

Furthermore, I've failed to find the 4x4 vehicle mentioned being generated by the mx_minefield code (humvee, FBI and mil cargo, but no 4x4). Could it be generated by the road before the map extra is applied?

I'd need help to track down why the mx_minefield map extra gets this vehicle, and why it's in a location where it extends outside of the overmap tile (that probably doesn't cause trouble unless you do something with the vehicle, like bashing it, or something is generated on the encroached upon map causing an overlap of vehicles or "terrain").

Edit: No, this bug isn't revealed by the changed code. The code used uses the RemovePartHandler stuff, and the check is against the (tiny) map provided by the handler. Thus, it seems to be a rare bug that can have been happening for quite some time, and either not encountered before now, or just ignored when a new roll of the test dice didn't result in a failure.

I've generated bug report #79889 for this failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant