-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
ensure critters are loaded around explosion #79291
Conversation
@GuardianDll: In case you're not notified and are anxious to continue with your PR: The relevant change is the addition of a single line that you can hack into your code during the testing phase and then remove when done. That would let you continue while this PR goes through the test and acceptance process. |
Don't we generate some of the terrains (craters?) via explostions? Would that mean there would be fresh critter corpses in those now? Or do those already have the critters loaded since they are close enough? |
This should actually repair a partially broken functionality, as the explosions are triggered by the reality bubble covering the explosion location, or covering the near side of the OMT the explosion on the remote side of the OMT resides on. Speculations about what might be possible in the future: I think it might be possible to "age" corpses generated by blasts by setting the corpse generation time to the time at which the blast is supposed to have gone off to get them to decay very rapidly. It might also be possible to locate the OM generation code and have it trigger the corresponding explosions at that time, which would produce pre-aged corpses and (usually) provide time for injuries to heal on survivors as well as ready to rise zombies, at the cost of early generation of some of the OMTs. |
To me, this sounds like a wrong coordinates conversion was used. I would guess mortaring the place loaded the critters and the loading loads them at the wrong coordinates. Just a hunch. I haven't looked at the code. |
Please provide a draft PR, as there's currently nothing in the game that does what you do. The current functionality only triggers the explosion as it's loaded by the reality bubble activities, while you're actually causing it to explode at the impact point while far away from it. Oh, another question what may be generally useful: How do you make the zombies to stay put? They have the advantage over breathers in that they don't melt away, but rather leave corpses behind, which would be useful to try to track down the corpse teleportation issue. |
Here's the one: #79303
the test was performed using 60mm_shell_m768, which deals the damage similar to a grenade, and can't create a massive crater
I used quick setup, which gives a speed mutation, which increases your speed ten times, so even when i walk, zombies have no time to spread much |
Hm, this is tricky. I've managed to block critters from teleporting into the reality bubble (when monster movement is processed), but dealing with corpses is a lot trickier, because the code drops items on the reality bubble map (and probably does nothing when the position isn't inbounds), far removed from anywhere the actual map used is known. |
do you mean it happens because all zombies hit by explosion die? doesn't sound plausible, single shot deal damage equal to a grenade, it has no ability to kill every single zed in a range |
No. I'm saying I've dealt with critter teleportation, but now, when critters die, they don't leave anything behind because the death handling code drops items at the bubble map, or, rather at the bubble map coordinates of the absolute position of the critters, which are usually off the bubble map. The surviving critters now appear approximately where they should ("approximately" as I'm using zombies now, and they move a little on their own). |
I've made some further progress, at the cost of a lot of changes (passing the appropriate map along to eventually end up where corpses and stuff are placed). |
I think I've got it, finally, and #79336 is the resultant PR. One thing I've noted from the mortars draft is that there doesn't seem to be any dispersion (which is very useful for testing purposes). The actual impact point should probably vary dependent on the operator's mortar skill, resulting in an impact point that both hit an adjacent tile, and land somewhere which isn't the center of a tile. The dispersion should probably be calculated in map squares from the tile center and then translated as OMTs and map squares (i.e. a distribution curve in map squares that's then translated for the purpose of determining the impact point in map squares within the impact OMT). |
Summary
None
Purpose of change
Correct issue mentioned in comment on #75567 after it was closed, i.e. creatures around far explosions are not (always) directly affected by it.
While looking at the code, it was cleaned up a little by making use of operation to get absolute critter positions. This operation didn't exist when the code was written, I think. That reduced the need to juggle with the reality bubble (there's still a need to determine whether player feedback should be printed).
Describe the solution
Add loading of critters on the explosion map before processing the explosion.
It was a bit tricky to track that one down, as the loading isn't performed by anything directly map related, but rather as a result of PC movement.
Describe alternatives you've considered
Testing
Created a test setup with breathers around a barrel bomb (breathers don't move from their locations). Saved it.
Activated the bomb and then walked well over 100 steps east and then returned.
Verified that some critters near the PC were injured, but those at the far side of the explosion weren't, and those around the barrel were injured only as a result of falling.
Made the changes and repeated the test.
![Screenshot (641)](https://private-user-images.githubusercontent.com/22739822/405636242-1d2b2a11-5791-4654-9648-d8ad5e7e5a5c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4OTcxMzAsIm5iZiI6MTczODg5NjgzMCwicGF0aCI6Ii8yMjczOTgyMi80MDU2MzYyNDItMWQyYjJhMTEtNTc5MS00NjU0LTk2NDgtZDhhZDVlN2U1YTVjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDAyNTM1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYzODVjMDIyZjhiMWQ1ZGM3NTkwN2ZiOWQ2NTRhMzk0NmUwZmY4ZTFkYTU5NDM0YWI5MzgxNDZmNDcwM2Q0YTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JGHi4FqmygDCtzOGv15_zpUPCh3zNHiqsiMQWFLxEUs)
Verified many breathers were gone, and all of the remaining ones were injured.
Also, as part of this test, a breakpoint was set in creature_tracker::remove to verify the "extra" critters placed into the creature tracker were removed properly. This was done by walking back towards the explosion, stop when the explosion happens and set the breakpoint, and then walk away again, verifying the number of loaded critters dropped to the "ambient" number before walking back to the explosion site.
Before:
After:
![Screenshot (642)](https://private-user-images.githubusercontent.com/22739822/405636308-a301664d-9b1b-4a93-8c8d-e1be772458cc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4OTcxMzAsIm5iZiI6MTczODg5NjgzMCwicGF0aCI6Ii8yMjczOTgyMi80MDU2MzYzMDgtYTMwMTY2NGQtOWIxYi00YTkzLThjOGQtZTFiZTc3MjQ1OGNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDAyNTM1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM3ZGVkYzVmY2FiNmI0ZTU5MmE5NTRkODU0MzZmZTM3OTgyOGZmYjg2ZGVlZWMyMzhlYWQzMTE4MTg2MmFhM2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.TEj3cTXXg3DNK0ZRbsN-wJSJ5A__wy0mBEvcr7Q0q-4)
Additional context