Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Better grenades #138

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

Conversation

econoraptor
Copy link
Contributor

@econoraptor econoraptor commented Jan 11, 2018

Most demos seem to have at least a few missing detonate events from times we would fully expect the event to be present. This PR interpolates the detonate events by tracking their associated entities

Additions:

  • Interpolate detonate starts and ends for smokes, molotovs/incendiaries, and decoys. Interpolations are accurate to the tick for smokes and molotovs, but there's an issue with decoys (see below).
  • Includes detonate ends at the end of round, which used to not be captured
  • EntityID handle on NadeArgs. This is a much more convenient way of matching detonate start and end events for a user. This is especially true now since interpolated positions arent perfect, though accuracy seems to be within one cell.
  • Interpolated bool added NadeArgs so that user can choose to use the position from a matching detonate event if one is interpolated and the other is uninterpolated.
  • ProjectileEntityID added to blind events

Problems:

  • As previously mentioned, positions aren't perfect, but they're really close
  • Decoys are sketchy. There's no property that signals the detonate start, but sometime before the detonate starts there is a flag set. After checking ~600 demos, I've settled on a 2 second threshold between the flag and interpolating the detonate start (to be clear, I'm referring to when it starts making noise, the explosion tick is accurate).
  • It's possible for entities to be replaced rather than destroyed. My code works as long as the entity isn't replaced by an entity with the same class, which I have yet to see in the demos I've checked.

… events now return a copy with NadeArgs.Interpolated = true
This should only happen rarely when another entity replaces it on the
first tick.
Subclass DetonateEntity rather than having it use generics.
Have a single container for DetonateEntities and deal with them more uniformly.
Use CurrentTime for decoy flag instead of IngameTick.
Found case where handling replaced entities didn't work.
Removed FirstTickOfRound.
Renamed some projectile serverclass variables.
@econoraptor
Copy link
Contributor Author

You may want to hold off on merging/testing this. After messing around with grenades I checked some other entities and realized that a lot of events can be more reliably handled by looking up entity properties. I'll make a number of PRs when I'm finished with the changes and you can decide which you want in the main branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant