AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Galileo 1.1.290 (a feature rich map voting plugin) (https://forums.alliedmods.net/showthread.php?t=77391)

Arkshine 12-28-2010 13:58

Re: Galileo 1.1.290 (a feature rich map voting plugin)
 
No, you're wrong. It won't lag with that because, again :

- It won't happen often
- You won't loop through all the maps all the time
- equal() is not an intensive native

Yes, it can be optimized but that's not a major issue.

Using TravTrie, you would need to recode severals parts, thus more testing and such and like Brad said, that's not the priority. Still Brad is interested by your suggestion, and I'm sure he will consider another time. So, wait & see.

unique 12-28-2010 16:21

Re: Galileo 1.1.290 (a feature rich map voting plugin)
 
hy.this plugin give 5 maps for voting and after 1-5 min vot again 2 from those 5 maps?:?
and can i modify the time when will start the vote?

Brad 12-28-2010 20:45

Re: Galileo 1.1.290 (a feature rich map voting plugin)
 
Quote:

Originally Posted by unique (Post 1381194)
hy.this plugin give 5 maps for voting and after 1-5 min vot again 2 from those 5 maps?:?
and can i modify the time when will start the vote?

We refer to it as "runoff voting" and this plugin has it. View the CVAR listing on the first post of the thread.

-=hunter=- 12-28-2010 21:57

Re: Galileo 1.1.290 (a feature rich map voting plugin)
 
Arkshine
My tests:
http://s44.radikal.ru/i104/1012/35/4a655a6b8d2b.png

Used:
PHP Code:

/* Plugin generated by AMXX-Studio */ 

#include <amxmodx> 
#include <amxmisc> 
#include <celltrie> 

#define PLUGIN "New Plug-In" 
#define VERSION "1.0" 
#define AUTHOR "author" 

#define MAX_MAPS 3000 

new maps[MAX_MAPS][64]; 
new 
maps_count
new 
Trie:trie
new 
mapIdx;
new 
Profile:start
new 
Float:stop
new 
bool:bMapIdx;
new 
mapname[64]

public 
plugin_init()

    
register_plugin(PLUGINVERSIONAUTHOR
    
set_task(1.0"test"); 


public 
test() 

    
trie TrieCreate(); 
    
    
// addons/amxmodx/configs/maps.ini
    
new configs_dir[64], maps_file[64]; 
    
get_configsdir(configs_dir,64); 
    
formatex(maps_file,64,"%s/maps.ini",configs_dir); 
     
    new 
buffer[64], hFile;
    
    
server_print("^n-----------------------------------------------")
         
    
// ---------------------------- Adding map in array -------------------------- 
    
maps_count 0
    
    start 
StartProfile(); 
     
    
hFile fopen(maps_file,"rt")     
    while (
fgets(hFile,buffer,64))
    { 
        
trim(buffer);
        
strtolower(buffer);
        
maps[++maps_count] = buffer;
    } 
    
fclose(hFile); 
     
    
stop StopProfile(start)     
    
server_print("Adding Time in array is %f secs"stop); 
    
// --------------------------------------------------------------------------- 
         
     
    // ---------------------------- Adding map in Trie --------------------------- 
    
maps_count 0
    
    start 
StartProfile(); 
     
    
hFile fopen(maps_file,"rt"
    while (
fgets(hFile,buffer64)) 
    { 
        
trim(buffer
        
strtolower(buffer
        
TrieSetCell(triebuffer, ++maps_count);        
    }
    
fclose(hFile); 
     
    
stop StopProfile(start)     
    
server_print("Adding Time in Trie is %f secs"stop); 
    
// ---------------------------------------------------------------------------     
    
    
server_print("Total Maps = %d"maps_count);
     
    
// ------------------------- Search First Map in maps.ini ---------------------------
    
mapname "ae_sTrafeRs_heaven";    // <- First map in maps.ini
    
strtolower(mapname)
     
    
server_print("-----------------------------------------------")
    
server_print("Searching first map in maps.ini (%s) ..."mapname)    
    
SearchInArray(mapname"Searching using Array ...")
    
SearchInTrie(mapname"Searching using Trie ...")    
    
// ----------------------------------------------------------------------------------
    
    // ------------------------- Search Middle Map in maps.ini ---------------------------
    
mapname "etl_speedcliff";    // <- Middle map in maps.ini
    
strtolower(mapname)
     
    
server_print("-----------------------------------------------")
    
server_print("Searching middle map in maps.ini (%s) ..."mapname)    
    
SearchInArray(mapname"Searching using Array ...")
    
SearchInTrie(mapname"Searching using Trie ...")    
    
// ----------------------------------------------------------------------------------
    
    // ------------------------- Search Last Map in maps.ini ---------------------------
    
mapname "zr_icecave";    // <- Last map in maps.ini
    
strtolower(mapname)
     
    
server_print("-----------------------------------------------")
    
server_print("Searching last map in maps.ini (%s) ..."mapname)
    
SearchInArray(mapname"Searching using Array ...")
    
SearchInTrie(mapname"Searching using Trie ...")    
    
// ----------------------------------------------------------------------------------
    
    // ------------------------- Search nonexistent map in maps.ini ---------------------------
    
mapname "Hello";    // <- nonexistent map in maps.ini
    
strtolower(mapname)
     
    
server_print("-----------------------------------------------")
    
server_print("Searching nonexistent map in maps.ini (%s) ..."mapname)
    
SearchInArray(mapname"Searching using Array ...")
    
SearchInTrie(mapname"Searching using Trie ...")    
    
// ----------------------------------------------------------------------------------
}

public 
plugin_end() 

    
TrieDestroy(trie);     
}

stock SearchInArray(mapname[], comment[])
{
    
mapIdx = -1
    
    start 
StartProfile();
     
    for (new 
i=1i<=maps_counti++) 
    { 
        if (
equal(maps[i], mapname))
        {
            
mapIdx i;
            break;
        }
    }
     
    
stop StopProfile(start)
    
server_print("^n%s^nmapIdx = %d. Find time in array is %f secs"commentmapIdxstop); 
}

stock SearchInTrie(mapname[], const comment[])
{
    
mapIdx = -1
    
    start 
StartProfile();
    
    
bMapIdx TrieGetCell(triemapnamemapIdx);
     
    
stop StopProfile(start)     
    
    
server_print("^n%s^nmapIdx = %d. Find time in Trie is %f secs"commentmapIdxstop);


This test without prefixes. With its time will be (max search time * number of prefixes)

Quote:

- It won't happen often
Often, players often write in chat.
Quote:

- You won't loop through all the maps all the time
No, when player type any word in chat then plugin through all the maps and all prefixes.
Quote:

- equal() is not an intensive native
I changed from equali to equal in test plugin.

Brad 12-28-2010 22:12

Re: Galileo 1.1.290 (a feature rich map voting plugin)
 
Thank you for your benchmarks. That's something I like to see rather than the generic "it's better". :)

This will be looked at sometime in the future. It's not a high priority (though it appears to be an easy change) because while it's faster, both methods are still less than a thousandth of a second to run. The change wouldn't be perceptible.

Thanks again for doing the dirty work of benchmarking it.

Brad 12-28-2010 22:30

Re: Galileo 1.1.290 (a feature rich map voting plugin)
 
I'm going to restore the previous functionality of the vote display unless people like the gentler version in which case I'll try to make it a wee bit better.

Currently
When a vote begins, the server tells Galileo if a player already has a menu displayed. If the server says the player does, Galileo will patiently wait for it to go bye-bye, checking every second until the vote ends. The problem with this method is that the server will sometimes say the player has a menu displayed when the player doesn't.

Proposed
When a vote begins, Galileo will overwrite any existing menus. Everyone will always be shown a menu. This is how it worked prior to the 1.1.290 release. The problem with this method is that some servers make a lot of use of menus and it makes it likely that players will have a menu for something else overwritten.

Pain in the Ass Option
This is what I was going to do before I realized how much a pain in the ass it'd be, both for me writing it and for any players that it will apply to. I was going to change the way it currently works by telling a player, that the voting menu didn't show for, they could type "vote" and have the voting menu display, regardless of the server saying there's already a menu displayed.

So basically, if at least a few people like the way it currently works (except for the issue of it not showing sometimes) then I'll do it. Otherwise, I'm just reverting it back to the way it used to work. People basically have a day or two to voice their opinion.

Brad 12-28-2010 23:40

Re: Galileo 1.1.290 (a feature rich map voting plugin)
 
There might yet be another way (though I doubt it). Whoever is using the SVN version of Galileo, can you please PM me immediately? I have a version with some additional debug code that I want you to use that I'll need to personally send you.

gladius 12-29-2010 00:06

Re: Galileo 1.1.290 (a feature rich map voting plugin)
 
I think you could mix the "currently" and "Pain in the Ass Option" since probability that the player isn't open the menu are less than those that are now (I think). Then, a variable stores the player who voted, and after 3 seconds that the vote has started, get the players that haven't voted and send a message saying "If you haven't voted and you want to vote, write / galvote" or something).

PD: description about the new method ? :D I am lazy to send a pm :D

sorry for my english :)

user1690 12-29-2010 04:21

Re: Galileo 1.1.290 (a feature rich map voting plugin)
 
Must say i like the current version, just seems better in my opinion.

unique 12-29-2010 07:56

Re: Galileo 1.1.290 (a feature rich map voting plugin)
 
it is possible that if are less then 10 players on serv,galileo will give to vote only maps fy_ awp_ and 35hp?and if are more then 10 players,maps de_ and cs_?or selective maps from 2 file text like small_maps.txt(only if are less then 10 players) and big_maps.txt(10>players)?


All times are GMT -4. The time now is 22:30.

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