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... |
All times are GMT -4. The time now is 22:54. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.