Skip to content

Conversation

@tslashd
Copy link
Member

@tslashd tslashd commented Dec 22, 2023

Uses an updated DB Schema (cs2_surftimer.txt) which will most likely change again

RunTime still needs to be addressed in this PR

  • Save/load map personal bests
    • Still need to save Current Run Map Start Speeds
      • We are always saving all Start and End velocities in order to be able to calculate the "client wanted speed" (XY, XYZ, etc.) when that becomes a thing
    • Messages on first ever PB for Map, beating it and just completing the Map
    • Styles kind of accounted for? 🤔
  • Save/load map checkpoints
    • Compare messages in chat
    • Using Dictionary with key the Checkpoint number
    • Styles should be handled by PersonalBest so it should be good for Checkpoints/Stages? 🤔
  • Build DEBUG and Release in VSCode
    • Command Palette (CTRL+SHIFT+P) > Run Task > build-release
    • Command Palette (CTRL+SHIFT+P) > Run Task > build-debug
    • Might need the C# Dev Kit extension for this to work, not sure
  • Some wonky speed limiter just for Map Start zones - DISABLED FOR NOW
  • Add Is to bools
  • Stage start pre speed shown in HUD
  • Show zone names (Map Start and Map End) in HUD on touching said zones
  • !s command = brokege
    • !s 6 and !s 7 send you to the same stage (tested on surf_beginnner)
  • Populate HUD and compare messages with WR (fastest run for the given map)
    • Maybe add WrRunCheckpoints dictionary to Map.cs so we can load the WR checkpoints inside of it for comparisons ? (Map class now has a PersonalBest object associated with it for WRs)
  • Show the rank of the player with total completions for the map
  • Make CurrentMap accessible inside PlayerStats.cs instead of passing arguments ?
  • Make CurrentMap accessible inside PlayerHUD.cs so that we can show Map Record Time and Map Completions
  • Replays - Not tracking Stage/Bonus times but Replay functionality for them is there
    • Personal Best
      • Map Record
      • Stage Record
      • Bonus Record
    • World Record
      • Map Record
      • Stage Record
      • Bonus Record
    • Try and compress replay_frames even more and store them in MapTimes (directly attached to the run)

Still to be done

  • async database queries
  • Saving the Checkpoints (CurrentRun) to the database should be made with Transactions
  • Make PluginPrefix accessible inside PlayerHUD.cs instead of passing arguments ?
  • SaveMapTime has the ability to re-load checkpoints, but we need to make LoadMapTimesData accessible in there as well
    • NOTE: Not re-loading any data at this point (whenever we save data for a new/improved run) as we need LoadMapTimesData to be called from here as well, otherwise we may not have the correct this.ID populated

Special thanks to @shacharrr for jumping on board and helping out with the Surf Initiative

@tslashd tslashd marked this pull request as draft January 1, 2024 13:23
@tslashd tslashd requested a review from 1zc January 2, 2024 15:04
1zc and others added 3 commits January 4, 2024 11:52
* Inherit Checkpoint object, replace RunTime with Ticks

* Fix errors with creating new Checkpoint

* Simplify PersonalBest base class by excluding ID and Rank from constructor
1zc and others added 10 commits January 9, 2024 12:16
* Tidy up player stats classes

* Move Checkpoints load method to PlayerStats

* Use info_teleport_destinations for player spawn locations

* Look for info_teleport_destinations with guideline names

* Fallback if associated info_teleport_destination cannot be found

* Append `spawn_` to info_teleport_destination standards

* Resolve warnings
* Test commit, fix stages

* Add files via upload

* Updated

* Delete src/bin/Debug/net7.0 directory

* .

* whoopsie?

* quick review

* Updated replay to work with bots

- Fixed bot spamming errors with the TriggerStartZone/TriggerEndZone
- Added reverse/pause replay (!rr/!rp)
Still need to fix more bots than wanted joining, and make DB queries async

* Working replays, not 100% done

* Fixed bot spawning rate, TODO:

* UPDATED: Default surf config to right configs
TODO: Add stage/bonuses/etc support when done, update bot_quota to change upon loading map time

* Bot changes name on replay loading

* Used FormatTime in necessry places.
Added cool HUD when spectating replays.
Added css_spec/css_replaybotpause/css_replaybotflip

* Fixed, error when no replay data

---------

Co-authored-by: Shachar <shachar262@gmail.com>
Co-authored-by: T <74899888+tslashd@users.noreply.github.com>


---------
Bots rely on this ws-cs2/CS2Fixes@2380ec6 
otherwise we get some wonky angles while the bot is surfing
…onus support (#10)

* Fixed bot noclipin when no replay

* Added saveloc/tele support

* Added practice mark to messages when in practice mode

* Now even when time not running, When tele it will start playing in practice mode

* Forgot to add the tele args lol, Fixed now

* Fixed error when !tele <num> larger than amount of teles or not a number

* Fixed Map stages counting. why wasn't this fix already :(

* Added support for more than one replay bot + plugin no longer relies on Will's version of cs2fixes

* Displaying time instead of ticks in bot replay now. would like for someone to check if there is a better way, but this works pretty well

* Added support for Personal Best replays with !pbreplay <maptime_Id/null>

* Updated readme

* Removed not needed comments

* Works also when no wr exists

* FormatTime correctly

* Reverted uneeded changes

* Temp patch for maps changing bot_quota, need to be addressed

* Cleaned code
@tslashd tslashd marked this pull request as ready for review January 22, 2024 12:34
@1zc
Copy link
Member

1zc commented Jan 24, 2024

Other than that, happy to merge so we can continue work based on the dev branch. Thanks a lot @tslashd @shacharrr

@1zc 1zc merged commit 01ce3f9 into CS2Surf:dev Jan 24, 2024
@tslashd tslashd deleted the personal-best branch December 28, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants