Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
2 Attachment(s)
Dynamic Map Rotations is a plugin I wrote to allow me to automatically alter the map rotation based on the current server conditions. With Dynamic Map Rotations, you can skip maps based on the number of players on the server or the time of day, and it's easy to add more conditions.
Dynamic Map Rotations replaces nextmap.smx but reproduces the in-game "nextmap" functionality and the sm_setnextmap command. For brevity, I'll sometimes use "DMR" in place of dynamic map rotations. Configuration
Commands
Dynamic map rotations are essentially keyvalues structures. I'll go through an illustrative example of how to create a simple DMR. Let's begin with a simple basic mapcycle.txt: Code:
cp_gravelpit Code:
"rotation"
http://www.2fort2furious.com/images/dmr_original.gif Now let's say we want to skip ctf_well when the number of players on the server is <= 12. The corresponding DMR looks like: Code:
"rotation" http://www.2fort2furious.com/images/dmr_skipwell.gif One more example. Let's add cp_badlands to the rotation and throw in a few more conditional nextmaps: Code:
"rotation" http://www.2fort2furious.com/images/dmr_badlands.gif First, notice how I used the section name "bdlnds". Remember that section names are arbitrary -- I could have just been consistent and chosen "40" or chosen anything at all. Let's look closely at section 20 (ctf_well). There are two conditional nextmaps and a default_nextmap. The first condition reads "IF the number of players <= 10 AND the current server time is <= 11AM, THEN the next map is section bdlnds (cp_badlands)". The second condition reads "IF the number of players <= 10 THEN the next map is section 10 (cp_gravelpit). If none of the conditional nextmaps are true, then the nextmap is the default_nextmap: section 30 (cp_dustbowl). Conditional nextmaps are evaluated in the order they're written, and the first one that is true is taken. So in the case of ctf_well, if the number of players were, for example 8, and it was 1AM, then the next map would be cp_badlands. If the number of players were 8 and it was 2PM, then the next map would be cp_gravelpit. It's really pretty straightforward! Automated DMR Generator Understandably, typing up a DMR is a pain. I've written a simple web tool to help get you started as well as visualize your DMR. Simply paste your mapcycle.txt into the top text box to generate the basic DMR. You can then modify it to add custom conditions. You can use the bottom text box to create a visualization of your DMR similar to the example images you've seen in this post. Custom Conditions
Installation
These cvars are modified and used directly by the plugin and should be considered read only. Modify them at your own peril.
This plugin was developed for a TF2 server, but I don't have any reason to believe it would misbehave in other games. Please let me know if it works with other games. Version History
I'd love to hear any feedback or suggestions about the plugin. |
Re: Dynamic Map Rotations
I will try this out. Just what I needed. Have to figure out the txt file a little bit more.
|
Re: Dynamic Map Rotations
Let me know if you need any help constructing your dmr.txt. I'm on gamesurge as FLOOR_MASTER. |
Re: Dynamic Map Rotations
looks very interesting, I'll check this out.
|
Re: Dynamic Map Rotations
hi
im gonna try this on my insurgency server (217.163.31.17:27015). many thanks for the automated generator - it helped me alot for figuring this baby out :) i'll let you know the outcome. for your reference my following rotation is set to: Code:
"rotation" |
Re: Dynamic Map Rotations
nice work
|
Re: Dynamic Map Rotations
hi
unfortuantely this plugin doesnt seem to be working for insurgency. I used your automated tool to generate the dmr.txt (seen above^^). unfortuantely there isnt much in the way of info in the error logs except for: Code:
L 03/23/2008 - 21:49:58: Info (map "ins_almaden") (file "errors_20080323.log") have i implemented the plugin incorrectly? thanks in advance |
Re: Dynamic Map Rotations
Your dmr.txt is perfect, so the error involves some incompatibility between the plugin and Insurgency. I'm downloading the Insurgency client/server now and will try to duplicate the problem.
|
Re: Dynamic Map Rotations
Quote:
just in case its me being thick......i added the cvars (dmr_map_key and dmr_force_nextmap) to the sourcemod.cfg file, exactly how you wrote them above ^^ (e.g. without numbers/values against them). if it was me being thick - apologies :) just so you know it is controlling the map rotation as nextmap.smx is disabled and the maps are rotating just not using the dynamic function that this plugin is made for. many thanks in advance for your time |
Re: Dynamic Map Rotations
I've uploaded version 0.2 which should address the bug in Insurgency - I wasn't able to reproduce your specific errors but I did find what I think is the bug that lead to your errors.
The other thing I noticed was that the in-game "nextmap" command didn't work, and the command didn't work in nextmap.smx either. I've added fixing this on my todo list. Please let me know if this version works out for you... |
Re: Dynamic Map Rotations
Hi thanks for the quick response. ive uploaded it and now testing it.
thanks for spotting the other bug and putting it on your list - that would be excellent! thanks again |
Re: Dynamic Map Rotations
hi ive just tested it and with 9 people on the server the map changed from baghdad to haditha whereas it should have moved to sinjar.
sorry :) let me know what i can do to help and thanks for looking into this cheers CoG |
Re: Dynamic Map Rotations
I'm sorry for the late reply. Would you be willing to send me a copy of your server config (please delete any passwords stored within)?
|
Re: Dynamic Map Rotations
wanted to send it via pm but unfortunately it was too long so here it is:
hostname "The.O.C Insurgency | 2.0e | *recruiting*" sv_lan "0" // Server is a lan server ( no heartbeat, no authentication, no non-class C addresses sv_region "3" // The region of the world to report this server in. sv_alltalk "0" // If 0, players from team one cannot talk to players in team two over voice sv_password "" // Server password for entry into multiplayer games rcon_password "" // Remote Console Password. sv_rcon_banpenalty "30" // Number of minutes to ban users who fail rcon authentication sv_rcon_log "1" // Enable/disable rcon logging. sv_rcon_maxfailures "5" // Max number of times a user can fail rcon authentication before being banned sv_rcon_minfailures "5" // Number of times a user can fail rcon authentication in sv_rcon_minfailuretime before being banned sv_rcon_minfailuretime "30" // Number of seconds to track failed rcon authentications sv_rcon_banpenalty "30" // Number of minutes to ban users who fail rcon authentication sv_rcon_log "1" // Enable/disable rcon logging. sv_rcon_maxfailures "5" // Max number of times a user can fail rcon authentication before being banned sv_rcon_minfailures "5" // Number of times a user can fail rcon authentication in sv_rcon_minfailuretime before being banned sv_rcon_minfailuretime "30" // Number of seconds to track failed rcon authentications // Specific settings ins_forceautoassign 0 // Forces a Player to Auto-Assign when Joining ins_forcesquadopen 0 // Forces all Squads to be Open ins_gamecount 3 // How many rounds pr map ins_roundtimer 300 // Maximum length of a round in seconds ins_tkdetect "0" // Auto Kick TKs ins_tkremove "0" // How Many TKs before Kicking mp_chattime "8" // Length of Time (in Seconds) for Players to Commune When the Game is Over (min. 2.000000 max. 10.000000) mp_friendlyfire "1" // Defines Friendly-Fire Status (min. 0.000000 max. 1.000000) //mp_timelimit "25" // Time on one map mp_limitteams "2" // Maximum Difference between Team Sizes mp_winlimit "5" // Defines how Many Rounds Played by One Team before Map Rotates mp_respawnlimit "10" sv_pausable "0" // Is the server pausable. sv_cheats "0" // Allow cheats on server sv_voiceenable "1" // Enables Ingame Voices sv_contact "" // Contact email for server sysop sv_downloadurl "" // Location from which clients can download missing files sv_allowdownload "1" // Allow clients to download files (Enable= 1 Disable= 0) sv_allowupload "1" // Allow clients to upload files like spraylogo's (Enable= 1 Disable= 0) sv_timeout "30" // After this many seconds without a message from a client, the client is dropped sv_gravity "800" // World gravity settings (Default= 800) sv_maxvelocity "3500" // Maximum velocity an object can have ingame (Default= 3500) sv_maxspeed "350" // Maximum speed a player can move (Default= 350) ///////////////manual! sv_unlag "1" // Enables player lag compensation sv_maxrate "25000" // Max bandwidth rate allowed on server, 0 == unlimited sv_minrate "7500" // Min bandwidth rate allowed on server, 0 == unlimited sv_maxunlag "1" // Maximum lag compensation in seconds sv_unlag_fixstuck "1" // Disallow backtracking a player for lag compensation if it will cause them to become stuck net_maxfilesize "32" // Maximum allowed file size for uploading in MB net_queued_packet_thread "0" // Use a high priority thread to send queued packets out instead of sending them each frame. fps_max "555" // Frame rate limiter ins_cachesabotage "1" // When Enabled, Allows a Team to Sabotage their own Caches ins_deadcam_modes "0" // Restricts Spectator Modes ins_deadcam_targets "1" // Restricts Spectator Targets ins_deadchat "0" // Determines whether Dead Players can Chat to Alive Players ins_deadinfofull "1" // Determines whether or not to use Full Death Information ins_dmgfactor "1" // Factor Reduction of Damage in FF ins_endgametime "4" // Change how Long the Winning Players get to Wander Around ins_firetype "0" // Defines if you can Fire either Always, Never or During Warmup ins_forceautoassign "1" // Forces a Player to Auto-Assign when Joining ins_forcesquadopen "0" // Forces all Squads to be Open ins_locksquads "0" // Lock Squads During a Running Game ins_maskotherteam "0" // When Enabled the Other Teams Score will not be Updated until the End of the Round ins_objdisable "0" // Ignore Objective States ins_randomlayout "1" // Determines wether or not to use Random Layouts ins_roundtimer "900" // Length of Time (in Seconds) of each Round ins_scorefrozen "0" // Determines whether or not the Score is Frozen ins_strictnaming "1" // When Enabled, the Player can only Change his name Once per Round ins_suppresskillhint "0" // Supress the Kill Hint from being Sent ins_teamsize "0" // Maximum Team Size ins_teamswap "0" // When Restarting and Enabled, Teams will Swap ins_timertype "1" // Defines which Timer to Use ins_tkdetect "0" // Auto Kick TKs ins_tkremove "4" // How Many TKs before Kicking ins_warmuptime "12" // Warm-Up Time before a Game (in Seconds) ins_warmuptype "0" // Defines Warm-Up Type ins_gamecount "3" // game notifications (min 0, max 30) ins_clanleaderpass "0" // Defines the Password for Clan Leaders ins_clanmode "0" // Defines whether Clan Mode is Active ins_decalfrequency "8" // Decalfrequency // Execute Ban File exec banned_user.cfg // Force Mapcycle File mapcyclefile "mapcycle.txt" // Enable bots on this server. bot_enabled 1 ========================= Now that im looking at my config is the mapcycle "mapcycle.txt" causing the problem? thanks in advance |
Re: Dynamic Map Rotations
I used your config file on my server and the plugin worked properly, skipping the appropriate maps since I was the only one on the server, so unfortunately the particular game settings you're using aren't causing the issue. I have a few more questions to help me reproduce the error you're receiving:
1) Are you running a Windows or Linux server? 2) Did you load the plugin in the middle of some other map that wasn't the first map (which is perfectly fine) or did you restart the server? 3) Could you attach errors_20080323.log to your reply? It should be located in addons/sourcemod/logs in your server's insurgency directory. (Click on "Go Advanced" to attach files) |
Re: Dynamic Map Rotations
1 Attachment(s)
Quote:
1) Its a linux server 2) I loaded the plugin whilst a map was playing (i forget which one) and then restarted the server. 3) attached :) you will see errors for "deathnotice.smx" which is a plugin for displaying who killed who to admins which is working sporadically so pleas ignore those. (here for reference) im also using MMS 1.4.3 and soucemod v1 if that helps. my plugins list looks like: Code:
Code:
L 03/27/2008 - 05:00:48: [dmr.smx] Reset dmr_map_key to "10" appreciate your help on this one. |
Re: Dynamic Map Rotations
I'm sorry to say that I still can't duplicate the bug you're experiencing. I've reproduced your setup as close as I can and can't find any reason why it wouldn't work.
Anyone out there have any insights? The plugin's been working flawlessly on my servers... |
Re: Dynamic Map Rotations
Quote:
cheers |
Re: Dynamic Map Rotations
1 Attachment(s)
one question before i will start the plugin with my dmr.txt
can i delete/rename the original cycle file to deactivate it? |
Re: Dynamic Map Rotations
You can leave mapcycle.txt alone -- what really matters is that you disable nextmap.smx. You can either delete mapcycle.smx or, preferrably, move mapcycle.smx to the disabled folder (addons/sourcemod/plugins/disabled).
|
Re: Dynamic Map Rotations
This is only for advanced users: By the way, this command will be removed eventually or recreated as another command, but for now, the server console command dmr will reload dmr.txt (dmr_file, actually) and display the nextmap in console. If you want to skip ahead in your DMR, change the cvar dmr_map_key (be sure to use the "dmr" command afterwards to verify that the map key is correct). Remember that the default_nextmap and conditional nextmaps of dmr_map_key are used to determine the next map.
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Fantasic,
Could you add another custom condition? Day of week would be very handy. Weekdays we would have stock maps, but would like a mixture on Saturday and customs only on Sunday!! |
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
I've uploaded version 0.3 which includes support for specifying the day of the week. Here's what I wrote in the original post about how to use it:
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Now tha is fast work.:up:
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Does this work with RTV or not? If not I guess its worth taking it out for this. :)
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
I did some quick testing with RTV and TF2 a few weeks ago and they appear to work fine together. Note that your rotation will continue where it left off after the RTV map (the nextmap won't be skipped).
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
1 Attachment(s)
Here is my new mapcycle. Hope it works :)
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
I updated dmr.php to support drawing day_eq and day_neq.
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
With the new ads plugin the {SM_NEXTMAP} feature shows my other map cycle. So far thats about it.
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Can you link to the specific plugin? I'm guessing the ads plugin gets its information off of a nextmap cvar, and if so, I can fix that easily.
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Will this be able to do the random map cycle too?
also if it would be possible to automatically change map i.e. if 0 players on? |
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Impressive work. Approved. Sorry it took so long.
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
My problem is that at end of map, when scores are shown, players do nextmap to see whats next, but it gives the name of the map that is on next + 1.
This confuses and doesnt look very good. Cos people leve if they don't like it when in fact it will be something different. |
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
1 Attachment(s)
Here's an interim release v0.3.1 that you can try out that moves the nextmap change from the start of intermission to the actual start of the next map.
Also, the cvar dmr_nextmap is (roughly - still working on this) kind of the value of the nextmap. It doesn't update very often yet, but you can use it as a placeholder in the ads plugin: {dmr_nextmap}. I would suggest not using it now. |
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
I want to make it for my server stays on ctf_2fort unless there are more than 2 people in the server.
How can I do this? This DMR thing is confusing me too much, I'll give +rep to anyone who can make me a DMR cfg file. I want every map on the cycle, but I want it to skip every one of them except 2fort unless there is more than 2 people in the server... |
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Quote:
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Quote:
|
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
This breaks any plugin that relies on the "sm_nextmap" cvar, I found another, autonextmap. Can that be made to work in DMR? I saw your post about dmr_nextmap, what prevents just exporting a public sm_nextmap cvar?
And just a random suggestion, I don't really care if you add it, but I had the idea and figured I'd throw it out there in case anyone likes it.. Add a condition for "if an admin is present", for those custom maps that are fun, but maybe a little buggy, then you can be sure griefers wont just run rampant. |
Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Incidentally, the last few versions I've posted define "admins_lte" and "admins_gte". I honestly haven't tested them at all and have no idea if they work yet, which is why I haven't mentioned that they exist. Feel free to try them out and let me know :).
In your case, you'd want "admins_gte" "1" to check if there's at least one admin on or "admins_lte" "0" to check if there are no admins on. [EDIT] I'll be gone for a week and back Wednesday the 23rd, after which I'll start working on this again. |
All times are GMT -4. The time now is 20:36. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.