Raised This Month: $7 Target: $400
 1% 

mapvote


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zerak
Senior Member
Join Date: Feb 2008
Old 02-03-2008 , 14:22   mapvote
Reply With Quote #1

Content
Description of the plugin
Plugin files and purpose
Configuration
Commands
Changelog
Bugs
Thanks

Description:

This plugin have an more advanced handling of how maps are choosen during votes and allows grouping of maps as well as player count condition for the map and "weight" which increase or decrease odds of selection. The weight can also be modified using external sources ex. use the result of "map rate" as a factor is currently included and supported by mapvote_reweight.

Example one might only want mapchooser with sound and some output then only install this modified mapchooser.
All the other plugins are however dependent on mapvote.

Plugins:
requires sourcemod 1.1
mapvote - this will create votes based on more arguments and pass it mapchooser, sourcemod or the included version
mapchooser - the one included in the package will add some vote output and possibility for sound, note that NO sound is included
rockthevote - only diffrence is that it depends on mapvote and will use mapvote selection algorithm instead of mapchooser => nominations is ignored, if you want nominations keep original rtv
mapvote_reweight - is an optional addition to mapvote and will use the result from plugin "map rate" and scale the odds for a map to be selected by multipling weight with the maps average rating but you can write one of your own and use another source or algorithm.

How to edit the mapfile (Def. $basedir/addons/sourcemod/configs/mapvote.ini ):
Here you can create groups of maps and tell how many maps to take from each group and parameters that is used when considering maps.
The structure looks like
"Groupname"
{
// Here you can add group parameters (add slots otherwise this group will not be used, all other parameters are optional)
"Mapname A"
{
// Here you add map paramaters (all parameters here are optional)
}

// Keep filling in the maps that should belong to this group with the above example of how a map entry should look like
}

You can have one map in several groups and you are guaranteed that it will not come up more than once in the vote menu.
See the included mapvote.ini for an example configuration.

Group parameters:
"slots" - number of maps to select from this group
"default weight" - if no weight is given for a map inside the group this value will be used inside instead (default is 100 if not specified). Used from this point forward. Can be used for lazy people or higher accuracy (like percentage isn't enough)

Map parameters:
"min" - min number of players
"max" - max number of players
"weight" - this is used to increase or decrease the chance of selection

Commands:

console cmds
mapvote - takes parameters and just forward to the command
sm_mapvote_print <prevmaps | maps> - used to make sure it read the files and works correctly

admin cmds
sm_mapvote_vote <now | round | map> - starts a vote that will take affect according to the argument
sm_mapvote_reloadmaps- force a reload of maps, can be used in conjunction of changing mapfile cvar by third parties since mapvote will reload maps automaticaly on mapchange if and only if the file have been modified since last read.

Changelog
1.2.1 - 1/1/2009
- another attempt to fix sounds (API is buggy)
- menu - splitted (better than a new category?)
- default sound added and enabled by default
1.2.0 - 29/12/2008
- permissions
- updated mapchooser for SM 1.1
- basic admin menu support
1.1.1 - 24/10/2008
- previous map being removed in wrong order
- 1.04 support (change in translation file to import)
1.1.0 - 30/8/2008
- updated 1.1 snapshot of mapchooser
- fixed multiple votes
- fixed rtv right before mapchange causing problems next round
- small changes
1.0.7 - 21/8/2008
- removed a warning (want longer name but this will work)
- added config file for mapvote for all except one variabel
- added randomorder cvar for votes
- added possibility to disable votes
- use the same memory fix as I posted in the forum, made a max instead of min causing index out of bound
- some small changes in mapchooser and how it handles when votes can be started
- will set failstate if mapchooser is set to create end of map vote
- fixed a typo in sound for mapchooser where max was set to 1.1 instead of 1.0
1.0.6 - 20/8/2008
- probably fixed TF2 winning_panel starting a vote
- if cvar for file has changed it will reload maps on the next round, if you want to reload instantly then you need to force with command
1.0.5 - 19/8/2008
- maybe fixed index out of bound
- sound in mapchooser is disabled by default
1.0.4 - 18/8/2008
- fixed no vote if nextmap is set
- mapchooser will not set "Pending vote" when it is disabled
1.0.3 - 10/8/2008
- added reweight in print IF mapvote_reweight is loaded
1.0.2 - 11/8/2008
- fixed display
1.0.1 - 10/8/2008
- mapvote_reweight - fix float and int usage making a more accurate reweight

Thanks to:
- Sourcemod team
- Thermopyle for debugging
- people on IRC
- Sound files are under creative common sampling plus 1.0 from this site
- votestart.wav - is made by Robinhood76
- voteend.wav - is made by reinsamba

Last edited by psychonic; 02-20-2010 at 10:36. Reason: the attachments don't comply with forum rules
zerak is offline
LocutusH
Senior Member
Join Date: Dec 2007
Location: Hungary
Old 02-04-2008 , 02:43   Re: mapvote
Reply With Quote #2

I dont really understand what this does.

1 Is it replacing the mapchooser, also is a rewrite of that?
2 If thats true, does it provide the basic function of mapchooser too?
3 For example can i setup an end-of-map vote with this?
4 What options do we have, to let it choose wich maplist is used?

I dont have a test server anymore, and its too much risk to test this on a well running pub, before we know what this really does, and if its bug free.
__________________
LocutusH is offline
zerak
Senior Member
Join Date: Feb 2008
Old 02-04-2008 , 07:26   Re: mapvote
Reply With Quote #3

1. It contains almost all of the mapchooser code since i couldnt just attach a new algorithm to it. The answere to question one is, yes it does.

2. I belive and hope it does since it is built on top of the code.

3. Since it is built on mapchooser that is kind of the point that it have end-of-map vote in the same manner however using another algorithm.

4. Look at votemap.ini, i left the description on how to use it there

Basic ide is to allow grouping of maps, lets say you want 4 maps in the vote to be selected from the standard maps and 2 maps from third-party (custom maps). Or optional if you have a 64 player server you might want diffrent maps to show up when there is less than 30 people and when more than 30 people. This is however untested at the current stage, will take a look at it later but cannot test it due to lack of server.

Code:
"standard maps"
{
    "slots" 4

    /* maps are added here, see mapvote.ini */
}
"custom maps"
{
    "slots" 2

    /* maps are added here, see mapvote.ini */
}
I totaly understand why you dont test it on your public, I was bored and coded a little inbetween game sessions

Last edited by zerak; 02-05-2008 at 06:29.
zerak is offline
LocutusH
Senior Member
Join Date: Dec 2007
Location: Hungary
Old 02-04-2008 , 07:49   Re: mapvote
Reply With Quote #4

Sounds very good

Now the only remaining question is, if we can implement the teamswap code our version of mapchooser provides. Look it at here in the new plugins section, maybe you can copy the corresponding swap algorithm to your plugin, to provide an extend+swap option too?

After that i see no point, why i would not change to this plugin
__________________
LocutusH is offline
zerak
Senior Member
Join Date: Feb 2008
Old 02-04-2008 , 08:27   Re: mapvote
Reply With Quote #5

That would be easy enough since it is the same code structure, could create a Cvar for it but would better if one could keep it seperated kind of like switchteam at half time does and then it could be a seperate plugin (like a cvar for switchteam). One reason not to switch is that this is marked Alpha since it hasen't been tested. Mostly added it as a reference if I have more questions and to get feedback (bugs and requests like yours). My intended test server had a too old CPU for source and hence the lack of testing.

Maybe will add more features once python or if structures gets added but also when the new mapchooser comes out and play
zerak is offline
arm5ky
Member
Join Date: Dec 2007
Old 02-04-2008 , 20:46   Re: mapvote
Reply With Quote #6

This is the answer to my prayers. Just need to get it working.

should be 3 standard and 2 custom but get: 4 standard and 3 custom



Installed:

sm_votemap_print nextvote

tc_hydro
ctf_well
cp_granary
ctf_turbine_v3
cp_grand_canyon_v1
cp_warpath2_1b
ctf_blitz
========================================

01:10:24 sm_mapvote_print maps
01:10:24 ========================================
-= New Group =-
-Slots: 3-
cp_dustbowl 0 -1
cp_gravelpit 0 -1
cp_well 0 -1
ctf_2fort 0 -1
cp_granary 0 -1
tc_hydro 0 -1
ctf_turbine_v3 0 -1
ctf_well 0 -1
-= New Group =-
-Slots: 2-
cp_jailbreak_b2 0 -1
cp_warpath2_1b 0 -1
cp_wolf 0 -1
cp_labor 0 -1
cp_desertfortress 0 -1
cp_grand_canyon_v1 0 -1
cp_science 0 -1
cp_shock 0 -1
cp_studio_rc3 0 -1
cp_u_turn_b4 0 -1
ctf_blitz 0 -1
ctf_mach2 0 -1
arm5ky is offline
arm5ky
Member
Join Date: Dec 2007
Old 02-06-2008 , 17:56   Re: mapvote
Reply With Quote #7

Quote:
Originally Posted by arm5ky View Post
This is the answer to my prayers. Just need to get it working.

should be 3 standard and 2 custom but get: 4 standard and 3 custom

Great plugin

So I want to allow only 1 slot for group 2, but it picks 2 maps. if i set 0 slots , it wont allow and doesn't pick any. Can you fix this?
arm5ky is offline
zerak
Senior Member
Join Date: Feb 2008
Old 02-07-2008 , 18:36   Re: mapvote
Reply With Quote #8

arm5ky did you get my message, and did you try the patch (latest version)? Just want to make sure it still is there, the bug that is. If it still is there then i will try to fix it tomorrow but please confirm you used the latest version, alpha 1.2. Really ashamed i didnt notice it after merging my code files but I thought I fixed it (see changelog), even though I havent optimized it yet. I got lazy and cloned the array instead of making a more sophisticated fix

LocutusH did you get my message about what you want since that should be a separate plugin rather then merged into this one.

Last edited by zerak; 02-07-2008 at 18:39.
zerak is offline
arm5ky
Member
Join Date: Dec 2007
Old 02-07-2008 , 18:56   Re: mapvote
Reply With Quote #9

Zerak,

Much appreciated

Thats done the trick. slot numbers are correct now.

For ref, this is on our live TF2 server as per my sig below.

Couple more questions:

1) I noted in the source, you comment out showing who has voted and for what. I really want that functionality, do i just dl your source uncomment and recompile?
2) Formating of the .ini. Our first attempt at adding min and max {} was not formatted properly and thus server would not boot. Took them out and it booted. Have been able to add them but formatting must be perfect and didnt seem to work anyway. But min/max would be great to get working, if I start adding criteria, can you run through any probs i get?
arm5ky is offline
zerak
Senior Member
Join Date: Feb 2008
Old 02-07-2008 , 19:02   Re: mapvote
Reply With Quote #10

1. I did? Where ?
If you refer to:
Code:
        // Why am I commented out? Because BAIL hasn't decided yet if
        // vote notification will be built into the Vote API.
        /*case MenuAction_Select:
        {
            decl String:Name[32], String:Map[32];
            GetClientName(param1, Name, sizeof(Name));
            GetMenuItem(menu, param2, Map, sizeof(Map));

            PrintToChatAll("[SM] %s has voted for map '%s'", Name, Map);
        }*/
then that isnt me, that is sourcemod's code

2. Give me an example, i thought it was kind of forgiving but sure you have to know what you are doing (look at the general and example in votemap.ini)
example:
Code:
    "de_nightfever"
    {
        "min"    "10"
        "max"    "20"
    }
really excited to know if it works (though i doubt it works flawless), maybe should have added some debugging outputs for it though :/
Also I should mention that it calculates the vote at the begining of the map and not right before vote time. The reason for this is sourcemod does this and it is easier to do a quick check/debug but i will look into this later, or now if you need it. Please add your criterias and suggestions and I find it odd that it crashes for you during mapvote.ini parsing.

Last edited by zerak; 02-08-2008 at 13:04.
zerak is offline
Reply


Thread Tools
Display Modes

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 01:20.


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