Raised This Month: $51 Target: $400
 12% 

Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)


Post New Thread Reply   
 
Thread Tools Display Modes
Crude Oil
New Member
Join Date: Apr 2010
Old 05-22-2010 , 08:29   Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Reply With Quote #131

I realized my brother, Master Panda, who I helped figure out the day bug in this plugin never bothered to reupload the plugin and it's source after he forgot to include the latter (page 12 4th post).

I have no idea whether anyone still has an interest in this plugin, but the plugin compile I have attached in this post is the one on the OP only with the day bug fixed.

The fault was on line 374:

Code:
FormatTime(day_str, sizeof(day_str), "%u");

Formats in FormatTime are case-sensitive, %u should've been %U.

Code:
FormatTime(day_str, sizeof(day_str), "%U");

I hope I helped someone.
Attached Files
File Type: sp Get Plugin or Get Source (dmr.sp - 320 views - 23.3 KB)
Crude Oil is offline
Don.P1
New Member
Join Date: Sep 2009
Old 06-12-2010 , 05:45   Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Reply With Quote #132

i looking for a plugin which automatic changes between 2 different mapcycle files. ( 1 for day and 1 for night )

any idea ??

THX

Last edited by Don.P1; 06-12-2010 at 05:55.
Don.P1 is offline
Nightbox
Senior Member
Join Date: Apr 2008
Old 06-17-2010 , 13:09   Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Reply With Quote #133

Is it possible the following thing ?:

Code:
"map"			"ctf_mach4"
"default_nextmap"	"30"
"player_gte" "10"
If you don't get me: Set map restrictions and not next map restrictions.

So mach4 would be able to be on server if there are more than 10 people. (for exemple) and not the previous map to set a condition for next.
__________________
Nightbox is offline
Jindo
AlliedModders Donor
Join Date: May 2009
Location: England, UK
Old 06-17-2010 , 13:13   Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Reply With Quote #134

You'd set the players_gte thing on the map before ctf_mach4.
__________________
Jindo is offline
BentByBogus
Junior Member
Join Date: Apr 2010
Location: Germany
Old 06-29-2010 , 18:01   Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Reply With Quote #135

Can I set both player_lte and player_gte for one map?
Also does this work with latest CSS/SM ?
__________________
BentByBogus is offline
BentByBogus
Junior Member
Join Date: Apr 2010
Location: Germany
Old 06-30-2010 , 19:36   Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Reply With Quote #136

So I used that plugin and it works flawlessly on CSS.
Also the visualisation part of the web tool is amazing.
Thats how my cycle looks now.If thats not a straightforward graph I dont know... ^^. But it sure works!
So thanks for the plugin. I like it very much.



__________________
BentByBogus is offline
BentByBogus
Junior Member
Join Date: Apr 2010
Location: Germany
Old 11-02-2010 , 18:56   Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Reply With Quote #137

I have written a program in java that creates a rotation with "players_gte" and "players_lte" values.
For that is uses a minimum and a maximum value that is provided with a csv file.
Each value of each map is checked against each corresponding value of all other maps.
No duplicates or redundant links.
For example take this example input file:
Code:
map0;1;3
map1;4;6
map2;8;13
map3;9;14
map4;4;16
map5;3;12
map6;3;16
map7;2;17
map8;6;16
map9;6;14
map10;10;18
map11;3;15
map12;9;14
map13;3;16
map14;3;15
map15;5;14
map16;4;19
map17;2;12
map18;2;13
map19;2;17
The first String up to the first ';' is the mapname as you have probably guessed.
The second parameter between both ';' denotes the minimum amount of players that are legit for that map. The third value denotes the maximum allowed players for that map.
Running it through my app would yield this:
Code:
"rotation"
{
"start" "0"


"0"
{
"map" "map0"
"default_nextmap" "1"

"13"
   {"players_gte" "3"}
}

"1"
{
"map" "map1"
"default_nextmap" "2"

}

"2"
{
"map" "map2"
"default_nextmap" "3"

"4"
   {"players_lte" "8"}
}

"3"
{
"map" "map3"
"default_nextmap" "4"

"6"
   {"players_lte" "9"}
}

"4"
{
"map" "map4"
"default_nextmap" "5"

}

"5"
{
"map" "map5"
"default_nextmap" "6"

"2"
   {"players_gte" "12"}
}

"6"
{
"map" "map6"
"default_nextmap" "7"

}

"7"
{
"map" "map7"
"default_nextmap" "8"

}

"8"
{
"map" "map8"
"default_nextmap" "9"

"7"
   {"players_gte" "16"}
}

"9"
{
"map" "map9"
"default_nextmap" "10"

}

"10"
{
"map" "map10"
"default_nextmap" "11"

"2"
   {"players_lte" "10"}
}

"11"
{
"map" "map11"
"default_nextmap" "12"

"4"
   {"players_gte" "15"}
}

"12"
{
"map" "map12"
"default_nextmap" "13"

"6"
   {"players_lte" "9"}
"11"
   {"players_gte" "14"}
}

"13"
{
"map" "map13"
"default_nextmap" "14"

"7"
   {"players_gte" "16"}
}

"14"
{
"map" "map14"
"default_nextmap" "15"

"4"
   {"players_gte" "15"}
}

"15"
{
"map" "map15"
"default_nextmap" "16"

"1"
   {"players_lte" "5"}
"11"
   {"players_gte" "14"}
}

"16"
{
"map" "map16"
"default_nextmap" "17"

}

"17"
{
"map" "map17"
"default_nextmap" "18"

"2"
   {"players_gte" "12"}
}

"18"
{
"map" "map18"
"default_nextmap" "19"

"3"
   {"players_gte" "13"}
}

"19"
{
"map" "map19"
"default_nextmap" "0"

}

}
Or as a image:


As a side note those initial values above were randomly created. I assume applied realistically with less random boundaries your result would be more homogeneous.
I am going to pack it into a jar tomorrow and supply it to this site.
Hope you can put it to good use.
__________________
BentByBogus is offline
BentByBogus
Junior Member
Join Date: Apr 2010
Location: Germany
Old 11-04-2010 , 03:44   Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Reply With Quote #138

I have overhauled my searching algorithm to employ per gte/lte_players two runs trough all map bounds first time checking upper-to-lower and on the 2nd run upper-upper bounds for gte_players. By principle the same is true for lte_players. First run checking lower-to-upper and on the 2nd lower-to-lower. That way you gain more links between maps but may run into certain issues with changing to a map that has nearly the same lower bounds value as the current one. Since you can reliably predict a lower two-digit percentage of players always leaves after a map change you could end up playing on a map that does not suffice the current lower bounds value. Therefore I have put in place that there must be a gap of 2 (players) between lower-to-lower checks. I will probably introduce an additional argument that lets you specify the gap yourself.

I am going to give you a quick run down on how to use my tool.
First you need an input file with maps in this format:
mapname1;minvalue1;maxvalue1
mapname2;minvalue2;maxvalue2
mapname3;minvalue2;maxvalue3

Here is an example input file code:
Code:
map0;0;4
map1;2;6
map2;6;10
map3;2;4
map4;12;18
map5;16;20
map6;10;16
map7;5;10
map8;12;16
map9;2;8
map10;0;13
map11;7;18
map12;12;24
map13;0;6
Lets assume that file is called input.csv.

Put that file to the same directory where my tool is in and run it with this command:

Code:
java -jar jdmrg.jar input.csv output.txt false
output may be any file you like. Be aware that you dont specify a file that already exists. You wouldnt like the outcome for it would simply be overwritten.
Now the last bit "false" disables the randomizer in the code and the output is always the same. Obviously that is only true for the same input data provided...;)
After you executed there will be a log file where you can check up on some things.
Other than that just open the output file and put it in FLOOR_MASTERS online visualisation generator or put it immediately to use.
If you have any questions dont hesitate to ask. I will be further improving this tool since I still got some ideas but the main functionality is there.

EDIT 1: Apparently when starting the rotation at '0' that produces a bug so that the rotation keeps looping at the 2nd entry. I fixed that by starting the rotation at '1'.
Attached Files
File Type: zip jdmrg.zip (8.5 KB, 88 views)
__________________

Last edited by BentByBogus; 12-10-2010 at 13:24. Reason: bug fix
BentByBogus is offline
ChickenLover
Junior Member
Join Date: Aug 2010
Old 11-07-2010 , 08:11   Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Reply With Quote #139

Quote:
The fault was on line 374:

Code:
FormatTime(day_str, sizeof(day_str), "%u");
Formats in FormatTime are case-sensitive, %u should've been %U.

Code:
FormatTime(day_str, sizeof(day_str), "%U");
I hope I helped someone.
I tried applying this but I'm still unable to get this to work. I get the error messages in the logs still even after the code change. When cp_freight_final1 loads it just sets the nextmap as cp_freight_final1 again. It never picks between cp_gorge and cp_mountainlab.

This is a sample of my dmr where it breaks. Is something wrong with it?

Code:
    "50"
    {
        "map"            "cp_freight_final1"
        "default_nextmap"    "60"
                "70"
                {
                "day_eq"    "mwfu"
                }
    }
    "60"
    {
        "map"            "cp_mountainlab"
        "default_nextmap"    "80"
    }
    "70"
    {
        "map"            "cp_gorge"
        "default_nextmap"    "80"
    }
ChickenLover is offline
ChickenLover
Junior Member
Join Date: Aug 2010
Old 11-15-2010 , 09:00   Re: Dynamic Map Rotations (Nextmap Based on # of Players, Time, etc)
Reply With Quote #140

Looks like I fixed this by changing %u on line 374 to %w.

Code:
FormatTime(day_str, sizeof(day_str), "%w");
%U is for what week it is. %w is for what day of the week it is starting with Sunday as 0.
ChickenLover is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode