The MapRate Plugin is an extension for the GG1 MapChooser plugin for Counter-Strike. It introduces a system allowing players to rate the maps they play. Based on this collective player feedback, the plugin dynamically adjusts map weights within GG1 MapChooser, influencing how frequently each map appears in map votes.
- Counter Strike 2 Server
- CounterStrikeSharp
- GG1 MapChooser Plugin installed and configured.
-
Permission-Based Rating:
Control who can rate maps using the
MapRateFlag
parameter in the configuration file. Specify an admin flag (e.g.,@css/maprate
) or leave it empty to permit all players to rate. -
Rating Management:
- Player ratings are persistently stored in a database.
- Players must play a map a configurable number of times (
MapsToPlayBeforeRate
) before they are eligible to rate it. - Ratings can expire after a set duration (
RatingExpirationDays
), prompting players to re-rate. - The system calculates an average rating for each map based on all valid player ratings.
-
Rating Reminders:
- Players receive reminders to rate the current map if they haven't rated it yet or if their existing rating is nearing expiration.
- Reminders can be delivered via chat messages, on-screen messages, or an interactive menu.
- Timing for reminders is configurable:
- At a specific round number (
RoundToRemindRate
). - A specific number of seconds after a round starts (
SecondsFromRoundStartToRemindRate
). - After a specific delay following a GunGame match win (
SecondsFromGunGameWinToRemindRate
). - A specific number of minutes after the map starts (
MinutesFromMapStartToRemindRate
).
- At a specific round number (
- Reminders can trigger a configurable number of days before a rating expires (
DaysBeforeExpirationToRemindRate
).
-
Commands:
-
!ratemap
- Opens a rating menu for players possessing the required admin flag (defined by
MapRateFlag
). - Menu Options:
- 0 - Remove! (Effectively a very negative rating)
- 1 - Not Good
- 2 - Okay
- 3 - Good
- 4 - Very Good
- 5 - Among the Best!
- Direct Rating: Players can bypass the menu by typing
!ratemap <rating_value>
(e.g.,!ratemap 3
) to submit their rating directly. - Access Restriction: Players without the required flag will receive a message like:
Only Supporters can rate maps.
(Message may vary based on configuration/localization). - Re-Rating Information: If a player attempts to rate a map they have previously rated, the menu will display their prior rating and the date it was submitted.
- Opens a rating menu for players possessing the required admin flag (defined by
-
!maprate
- Displays the current map's average rating and the user's own rating (if available) in the chat.
- Example Output:
Average map rating: 4.25. You have rated the map 5 [2024-10-26]. Type !ratemap to change your rating.
- Available to All Players: This command does not require any special flags.
-
-
Integration with GG1 MapChooser Database:
-
Dynamic Map Weight Assignment:
- The plugin interacts with the
weight
field in the GG1 MapChooser map configuration file (e.g.,GGMCmaps.json
). - If a map's
weight
is not explicitly set in the GG1 MapChooser config:- The calculated average rating from this MapRate plugin is used as the weight.
- If no ratings exist for the map yet, GG1 MapChooser uses its own default weight setting.
- If a map's
weight
is manually set in the GG1 MapChooser config, that manually defined value takes precedence and overrides the MapRate average. - Recommendation: Configure GG1 MapChooser's default map weight to
3
. This aligns with the midpoint of MapRate's 0-5 scale, ensuring maps rated above 3 appear more frequently in votes, while those rated below 3 appear less often.
- The plugin interacts with the
-
Dynamic Map Weight Assignment:
-
Rating Expiration:
- To keep feedback relevant, ratings can automatically expire after a configurable period (
RatingExpirationDays
). - Players will be prompted to rate the map again after expiration and playing it sufficiently.
- An inactivity threshold (
IfPlayedMapExpirationDays
) can require players to replay maps if they haven't played them recently, potentially invalidating old ratings.
- To keep feedback relevant, ratings can automatically expire after a configurable period (
Plugin settings are managed in the configuration file located at:
csgo/addons/counterstrikesharp/configs/plugins/maprating/maprating.json
Key configurable parameters include:
-
Database Connection:
DatabaseHost
DatabasePort
DatabaseName
DatabaseUser
DatabasePassword
- Permissions & Eligibility:
MapRateFlag
: The admin flag required to use the!ratemap
command (leave empty for all players).MinutesToPlayOnMapToRecordPlayed
: Minimum time (in minutes) a player must be on a team for their playtime on the map to count towards eligibility.MapsToPlayBeforeRate
: How many times a player must have played a map (meeting the minimum time criteria) before they can rate it.
- Rating Lifecycle:
RatingExpirationDays
: Number of days until a player's rating for a map expires.IfPlayedMapExpirationDays
: Period of inactivity (in days) on a map after which a player might need to replay it before their rating is considered valid or before they can rate again.
- Rating Reminders:
RoundToRemindRate
: Trigger reminder based on this round number.SecondsFromRoundStartToRemindRate
: Trigger reminder this many seconds after a round starts.RoundStartRemindMenu
: If reminding at round start, usetrue
to show the rating menu directly,false
to show text messages (chat/center screen).SecondsFromGunGameWinToRemindRate
: Delay (in seconds) after a GunGame win before showing the rating reminder/menu.MinutesFromMapStartToRemindRate
: Trigger reminder this many minutes after the map initially loads.DaysBeforeExpirationToRemindRate
: Start reminding players to re-rate a map this many days before their current rating expires.
- Ensure all prerequisites (CounterStrikeSharp, GG1 MapChooser) are installed and working.
- Download the latest release of the MapRate Plugin.
- Place the plugin files into your CounterStrikeSharp plugins directory (
csgo/addons/counterstrikesharp/plugins/maprating/
. - Restart your server or load the plugin via console commands. This should automatically generate the default configuration file:
csgo/addons/counterstrikesharp/configs/plugins/maprating/maprating.json
- Set up a database (e.g., MySQL, PostgreSQL, SQLite - specify supported types if known) and ensure you have the necessary connection details (host, port, user, password, database name) and grant appropriate permissions to the database user.
- Edit the generated
maprating.json
configuration file, filling in your database credentials and customizing other parameters as desired. - Restart the server or reload the plugin for the configuration changes to take effect and for the plugin to create the necessary database tables.
This plugin is provided "as-is". It was developed to meet a specific set of requirements. While suggestions for improvements or new features are welcome, there is no guarantee of future updates.