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

Galileo 1.1.290 (a feature rich map voting plugin)


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-28-2010 , 13:58   Re: Galileo 1.1.290 (a feature rich map voting plugin)
Reply With Quote #1011

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.
__________________
Arkshine is offline
Old 12-28-2010, 13:58
Arkshine
This message has been deleted by Arkshine. Reason: lag
Old 12-28-2010, 14:06
Arkshine
This message has been deleted by Arkshine. Reason: lag
unique
Senior Member
Join Date: Sep 2007
Old 12-28-2010 , 16:21   Re: Galileo 1.1.290 (a feature rich map voting plugin)
Reply With Quote #1012

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?

Last edited by unique; 12-28-2010 at 16:43.
unique is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-28-2010 , 20:45   Re: Galileo 1.1.290 (a feature rich map voting plugin)
Reply With Quote #1013

Quote:
Originally Posted by unique View Post
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.
__________________
Brad is offline
-=hunter=-
Senior Member
Join Date: Jul 2008
Old 12-28-2010 , 21:57   Re: Galileo 1.1.290 (a feature rich map voting plugin)
Reply With Quote #1014

Arkshine
My tests:


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.

Last edited by -=hunter=-; 12-28-2010 at 22:08.
-=hunter=- is offline
Send a message via ICQ to -=hunter=- Send a message via Skype™ to -=hunter=-
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-28-2010 , 22:12   Re: Galileo 1.1.290 (a feature rich map voting plugin)
Reply With Quote #1015

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 is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-28-2010 , 22:30   Re: Galileo 1.1.290 (a feature rich map voting plugin)
Reply With Quote #1016

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 is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-28-2010 , 23:40   Re: Galileo 1.1.290 (a feature rich map voting plugin)
Reply With Quote #1017

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.
__________________
Brad is offline
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 12-29-2010 , 00:06   Re: Galileo 1.1.290 (a feature rich map voting plugin)
Reply With Quote #1018

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 ? I am lazy to send a pm

sorry for my english
__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).


Last edited by gladius; 12-29-2010 at 00:10.
gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
user1690
Junior Member
Join Date: Dec 2010
Old 12-29-2010 , 04:21   Re: Galileo 1.1.290 (a feature rich map voting plugin)
Reply With Quote #1019

Must say i like the current version, just seems better in my opinion.
user1690 is offline
unique
Senior Member
Join Date: Sep 2007
Old 12-29-2010 , 07:56   Re: Galileo 1.1.290 (a feature rich map voting plugin)
Reply With Quote #1020

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)?
unique 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 18:48.


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