csgo-practice-mode icon indicating copy to clipboard operation
csgo-practice-mode copied to clipboard

Grenade Education Tools

Open nkwiatek opened this issue 4 years ago • 13 comments

Hey splewis and crew,

In light of ESEA's announcement of NADR, I thought it might be good to share a fork I worked on back in April that adds features related to grenades to practicemode.

This set of 11 commits adds the following:

  • Visible holograms that appear around the map to show nade type and lineup, which can be teleported to by pressing +use, and toggled per-player with .holo.

  • A "scoring" heuristic that tells you whether you landed or a missed a saved grenade.

  • Storage of detonation locations in map configuration, and a debug method for admins to add detonation data to all saved nades en masse (sm_fixdetonations).

  • A "learning" mode (.learn) that teleports you throughout the saved nades in the map and challenges you to correctly throw the grenade.

These changes have been running on a private server for a few months with regular playtesting and appear stable. (Let me know if you'd like the ip/pass to test it out.) Note this stack also includes a change to csgoutils.

I tried to follow the conventions set forth in the codebase, although I'm sure not perfectly. :)

I'm asking you to consider taking this as a pull request to the main repo because I think these features could add value to the community you've built, especially as a DIY alternative to ESEA's recent announcement.

nkwiatek avatar Jun 18 '20 18:06 nkwiatek

This is actually insane, nice job Nick.

On Jun 18, 2020, at 2:21 PM, Nick Kwiatek [email protected] wrote:

Hey splewis and crew,

In light of ESEA's announcement of NADR https://play.esea.net/news/15588, I thought it might be good to share a fork I worked on back in April that adds features related to grenades to practicemode.

This set of 11 commits adds the following:

Visible holograms that appear around the map to show nade type and lineup, which can be teleported to by pressing +use, and toggled per-player with .holo.

A "scoring" heuristic that tells you whether you landed or a missed a saved grenade.

Storage of detonation locations in map configuration, and a debug method for admins to add detonation data to all saved nades en masse (sm_fixdetonations).

A "learning" mode https://streamable.com/c7scmq (.learn) that teleports you throughout the saved nades in the map and challenges you to correctly throw the grenade.

These changes have been running on a private server for a few months with regular playtesting and appear stable. (Let me know if you'd like the ip/pass to test it out.) Note this stack also includes a change to csgoutils https://github.com/nkwiatek/csgo-practice-mode/commit/753506ec6d011a1107ee98133d426cd707e9877d.

I tried to follow the conventions set forth in the codebase, although I'm sure not perfectly. :)

I'm asking you to consider taking this as a pull request to the main repo because I think these features could add value to the community you've built, especially as a DIY alternative to ESEA's recent announcement.

https://camo.githubusercontent.com/b387c835b317b773ea748dd621001cd69a1d2a29/68747470733a2f2f63646e2e646973636f72646170702e636f6d2f6174746163686d656e74732f3638373038363333373231313632393630382f3639343034353232353235323934353937312f32303230303333303030343434315f312e6a7067 https://camo.githubusercontent.com/410341af7485aedc77d808cee7203ac75b98cf78/68747470733a2f2f63646e2e646973636f72646170702e636f6d2f6174746163686d656e74732f3638373038363333373231313632393630382f3639333638373231323135393533333133362f32303230303332393031303133315f312e6a7067 https://camo.githubusercontent.com/c6a51d8dc67faee05608cf34f4ea7f7000487d45/68747470733a2f2f63646e2e646973636f72646170702e636f6d2f6174746163686d656e74732f3638373038363333373231313632393630382f3639363137313531313632323636343231332f32303230303430343231333233345f312e6a7067 You can view, comment on, or merge this pull request online at:

https://github.com/splewis/csgo-practice-mode/pull/160 https://github.com/splewis/csgo-practice-mode/pull/160 Commit Summary

Grenade Holograms Hologram Interactions and Hud holograms: fix clipping on floor discs Grenade Hologram client visibility toggle command Save Grenade Detonation Data Add CSU_OnManagedGrenadeExplode forward Add sm command to batch fix grenade detonation data Grenade Accuracy Reporting Fix Random Entity Deletion When Autostart is Enabled Assert when Hologram entities are deleted unexpectedly Learn Mode File Changes

M .gitignore https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-a084b794bc0759e7a6b77810e01874f2 (1) A materials/practicemode/disc.png https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-d4ac14c26a9026981358c45bd1d36d0f (0) A materials/practicemode/disc.vmt https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-be18627a84d04695cd3f6ab27b6aeb31 (6) A materials/practicemode/disc.vtf https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-a2583fa3de169b979ea0b7e7f0282556 (0) A materials/practicemode/ring.png https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-89a8d9161f28e82d1207ef88782fb3e1 (0) A materials/practicemode/ring.vmt https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-ad2aeae7d3f646ceecf4ab6c89280310 (6) A materials/practicemode/ring.vtf https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-882aebe68bb54afc8b0eeace75c9c22d (0) M scripting/csutils.sp https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-09a675e6cfd6042b352262f74c241532 (63) M scripting/include/csutils.inc https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-4a0b802cfee16067509180d2ecd46b08 (7) M scripting/practicemode.sp https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-df0ff2da45f573077ee52ba038093a99 (160) M scripting/practicemode/commands.sp https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-6f11641a94f7139fd75830921f4affbe (3) A scripting/practicemode/grenade_accuracy.sp https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-c9877d4b5ec327849f813b899d043f99 (407) M scripting/practicemode/grenade_commands.sp https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-5fe21bb80081590ac861b4ceb7407443 (82) A scripting/practicemode/grenade_hologram.sp https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-49e7cbedc7155b98e7a98c1ade2394ed (458) M scripting/practicemode/grenade_iterators.sp https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-9b0e5a1ff73dbc5b5daaa9d8dd47504f (35) M scripting/practicemode/grenade_menus.sp https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-0021b9e1ca9873599117a22e3559dd56 (19) M scripting/practicemode/grenade_utils.sp https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-a0ef3f5542b970ab2bf51ea03d0d391f (212) A scripting/practicemode/learn.sp https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-73945e554ab680c7394ac32af4c6f02d (345) M scripting/practicemode/util.sp https://github.com/splewis/csgo-practice-mode/pull/160/files#diff-5dde19450614e6f2fbf1754103668a47 (11) Patch Links:

https://github.com/splewis/csgo-practice-mode/pull/160.patch https://github.com/splewis/csgo-practice-mode/pull/160.patch https://github.com/splewis/csgo-practice-mode/pull/160.diff https://github.com/splewis/csgo-practice-mode/pull/160.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/splewis/csgo-practice-mode/pull/160, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACX7262ZZTU7B3EUOTYAATRXJLIZANCNFSM4OCBBFYQ.

Otoris avatar Jun 18 '20 18:06 Otoris

This is really nice - great work, really. I'll try to review shortly, but I expect we'll be able to merge in in.

splewis avatar Jun 27 '20 03:06 splewis

Made a quick pass, really only had style nitpicks. Everything looks good - I'm glad this fit nicely in the existing code without too much shuffling.

I had long ago wanted to store more per-grenade metadata, like the detonation location. I wanted to enable being able to stand in a location, and query for nades that land there, so this definitely makes adding that easier.

splewis avatar Jul 16 '20 03:07 splewis

Apologies for the major delay here; I'll do a pass on feedback this weekend!

nkwiatek avatar Sep 04 '20 18:09 nkwiatek

☝ looks like a resource url is broken here. fwiw i tested this change locally; it should build with a new link to updater.inc.

nkwiatek avatar Sep 07 '20 00:09 nkwiatek

@nkwiatek, @splewis Curious the status of this PR, looks amazing.

That said could this be hooked to a larger database of saved nade throws & meta data?

IE If I build a quick API and storage server where community users could upload lists of their favorite throws and you could then collate and download a list and load it into the game, either manually or more preferably over some type of console command.

I'd be interested to put that together as I haven't found a reliable way to browse and find the nade I really want, so many videos on YT and guides, would be nice to combine them all, could even refine them all as duplicates etc with the right meta.

danieliser avatar Oct 26 '20 08:10 danieliser

@danieliser

Curious the status of this PR, looks amazing.

Since last submitting, I've noticed some instability with multiple people in the server at once where holograms do not appear for all players. I'd like to track that bug down before @splewis merges, which I can get to this weekend.

That said could this be hooked to a larger database of saved nade throws & meta data?

I don't see why not. You could use Sourcemod's SQL api (dbi) to do this, or you could use the cfg format as an interchange format and e.g. curl for it at runtime, or write the .cfg files to disk and distribute sourcemod as a listen server launcher for the player to run locally on their machine.

nkwiatek avatar Oct 27 '20 19:10 nkwiatek

@nkwiatek that sounds awesome.

danieliser avatar Oct 28 '20 00:10 danieliser

That said could this be hooked to a larger database of saved nade throws & meta data?

Yes, I had hoped for such a system long ago. But it's a non-trivial thing to implement, especially since compatibility with the existing local configs needs to be retained. If someone is interested I'd gladly review their plans / PRs.

splewis avatar Oct 28 '20 00:10 splewis

Just for clarity, I'm working on something now @splewis. First goal is to record nades into configs and automate screencaptures to some degree, dump all that data into a searchable db server with an exposed API.

Second would be to let users submit their own, make playlists, export them to a cfg.

Lastly would be automating that export/import from the API to CSGO practice mode somehow that isnt' super technical.

Got the skillset and resources, just gotta flesh out the concept fully before I dive in.

Not sure how much it directly ties to this library, or if it would be something else entirely that supliments this mod. Either way is fine ultimately.

danieliser avatar Oct 28 '20 00:10 danieliser

Just pushed a few lingering bugfixes:

  • @fc80bbf is basically just addressing log noise.
  • @6ce5b07 addresses a silly gotcha in practicemode that probably never came up before: the grenade.cfg KeyValues parser fatals on (escaped) quote chars in the username/description strings etc. Turns out you just need set a flag on the instance, essentially KeyValues.WorkCorrectly(true)
  • @29dca31 fixes the bug I was hoping to understand: some hologram entities did not persist through round restarts, e.g. as caused by using .bot, or a player joining the other team, or mp_restartgame etc. Note that I don't know the root cause — why CSGO decides to delete some entities and not others on round restart, or whether there are other cases besides a round restart where CSGO will delete our entities — and so my solution treats the problem by hooking round_start.

nkwiatek avatar Nov 01 '20 04:11 nkwiatek

looks awesome. i just have 0 idea, how to implement this into our server. is there any guide out there?

sLickz0rr avatar Jun 30 '21 09:06 sLickz0rr

Curious as to the feasibility of merging some of these features in, even if only as a fork with a portion of this PR's content. In particular, I'm entertaining some similar aspirations as Daniel above and am interested in the 3 commits regarding nade detonation locations.

brookslobe avatar Jun 22 '22 20:06 brookslobe

What's the status on this?

johanohly avatar Dec 12 '22 15:12 johanohly

@JohnnyJTH thanks for asking. Unfortunately I think the right call is to shelve this. It's a non-trivial featureset that would surely add more surface area for bugs and requests to the project, something that would justify a major point release. I think it's risky to pull without more buy-in as an initiative, especially now that I haven't ran the code myself in some time.

nkwiatek avatar Dec 14 '22 00:12 nkwiatek