AnAkkk / TFTrue

http://tftrue.esport-tools.net/
GNU General Public License v2.0
37 stars 12 forks source link

Airshot changes #60

Closed TheBv closed 2 years ago

TheBv commented 2 years ago

This PR changes a couple of things related to airshots. It mostly includes a bunch of changes which I'd like to see get added/changed partially to allow for better custom log parsing.

Crossbow bolt hits now count as airshots (only on damage) Pretty self explanatory in general a "fun feature" to have.
Airshots use a "RayHull" to check for the distance to the ground This prevents some edge cases where the center of the players isn't above solid ground but the other 40% of the hitbox are. I think there's a debate to be had if this should be implemented...
Added a direct property to indicate rockets/pipes directly hitting an opponent Would allow for better identifying direct hit airshots and other things. Sadly a workaround for pipes needed to be added since the event "projectile_direct_hit" gets triggered after the damage event in tf2s source code (see: [this](https://github.com/mastercomfig/team-comtress-2/blob/d3ee4cf0aafa5adfa5096c3c6c7a6748a1784a97/src/game/shared/tf/tf_weaponbase_grenadeproj.cpp#L395))
Added a height property to indicate the distance from the player to the ground when they got airshot Would allow for some kind of filtering between "good" and "bad" airshots. I was considering adding this to the airshot property but logs.tf doesn't seem to parse this properly.

Like I mentioned these are mostly suggestions and I'm most of it is up to debate if it should even be implemented. I'd of course be willing to update/change things if needed :)

sapphonie commented 2 years ago

is this compatible with logstf's parser?

TheBv commented 2 years ago

is this compatible with logstf's parser?

All of these changes are compatible with logstf's parser. In general adding a new property to a line e.g X triggered "damage" against Y (property "Value") should never break logs.tf's parser. In general one could add anything at the end of the line from a logged event and the parser should be fine with it.

I must admit that I do not know this for certain since I do not know the code that's currently being used to parse log files but given the amount of time I've spent developing a log parser based on the original one zoob published some time ago I feel very confident.

So yeah the properties ((direct "1"),(height "X")) should not interfere with it at all. And the other changes only adjust if certain properties get logged or not.