 |
|  |
 | Just a thought... |  |
   
| CT Rank: Not Ranked |
| Field's place: sweeper |
| Grid Name: ct-eddie |
| GID: ed@ct/jedi |
| CT Wild Fort Rank: na |
| Joined: 22 Mar 2006 |
| Posts: 1X9362493 Posts |
Location: Wales, UK
|
|
Posted: Mon Dec 11, 2006 10:45 pm |
|
Sometimes, you can be playing at CTWF and you find the same map appears for 2 or 3 matches in a row, and some you never seem to see at all.
What if we were to have say exactly 6 maps per round (that's 72 maps).
Over 6 matches each map for each round gets played once.
So, if you happen to join the server at the start of match 1 of 6, and play for 6 matches, you will play every map once and no map twice.
The order they play in is, of course, random.
Not sure how to modify the script, some kind of routine that runs once every 6 matches to feed each map into a multidimentional array (whatever that is), then the script would read from that round by round. I would need help from the more experienced programmers on this.
Anyway, what do you think of the idea?
We would need lots of maps and idea's from you lot if we are to pull it off. |
|
|
   
| CT Rank: 10 |
| Field's place: def-sweep |
| Grid Name: ct¤kyle |
| GID: kyle@ct/jedi |
| CT Wild Fort Rank: na |
| Joined: 31 Mar 2006 |
| Posts: 458365372 Posts |
Location: United States
|
|
Posted: Mon Dec 11, 2006 11:27 pm |
|
do you understand my idea its a bit wiredly stated
i would much rather have coded it
like
at start initialization
int totalMaps;
int rounds[totalMaps];
for(int x =0; x<totalMaps; x++){
rounds[x] = 0;
} |
now when a map is picked lets assume the first 6 maps are for the first round
int z=1;
while (z=1){
map=rand(0)+6;//i think this counts from 0 up to 5
if(rounds[map] == 0){
//play may
z=0;
rounds[map]=1;
}
} |
I forgot about the check to see if all maps in that round have been played so here that is this would be first match
for(x=0;x<6 ;x++){
if (rounds[x] == 0){
x=6;
if ((x==5)){
for(int x =0; x<6; x++){
rounds[x] = 0;
}
|
EDIT: LAST CODE UPDATED |
_________________
In theory it should work in reality who knows if it will work.
MB53: I am 26 years old how can i be a teen ?
owned: You got the heart of a teen
Gonzap: and the innocence of a little child
|
|
Wacko
| CT Rank: Not a CTer |
| Field's place: |
| Grid Name: |
| GID: wrtlprnft@ct/public |
| CT Wild Fort Rank: |
| Joined: 06 Oct 2006 |
| Posts: 5Q36206 Posts |
Location: 0x08048000
|
|
Posted: Tue Dec 12, 2006 12:49 pm |
|
I wouldn't fix the number of maps per round.
Just mark every map that's played, then if for one round all maps have been played mark all maps in that round as “not played” and randomly select a new map.
That would be really easy to implement, and you could be sure that in (highest number of maps in a round)*2 - 1 matches you'd have played every map at least once.
$res = mysql_query('SELECT mapfile, id FROM maps_table WHERE round="' . $round . '" and played="0" ORDER BY RAND() LIMIT 1');
if(!($res = mysql_fetch_assoc($res))) {
mysql_query('UPDATE maps_table SET played="0" WHERE round="' . $round . '"');
$res = mysql_query('SELECT mapfile, id FROM maps_table WHERE round="' . $round . '" ORDER BY RAND() LIMIT 1');
if(!($res = mysql_fetch_assoc($res))) {
continue; //assumes this is happening in a loop. This shouldn't happen anyways
}
}
mysql_query('UPDATE maps_table SET played="1" WHERE id="' . $res['id'] . '"'); |
Something like that. |
|
|
|
Ex-CTer
| CT Rank: Not a CTer |
| Field's place: |
| Grid Name: |
| GID: Not working |
| CT Wild Fort Rank: |
| Joined: 27 Jul 2006 |
| Posts: 7S36280 Posts |
Location: Bakersfield, Ca
|
|
Posted: Wed Dec 13, 2006 5:26 pm |
|
Having a set number of maps per round makes it way too difficult for you to test new maps, Ed. I agree with wrtlprnft. Just set each map as played in the database and query only maps that are unplayed and pick one randomly. If no maps are unplayed, then clear the played setting on all and try again... If no maps are unplayed the second try, that means you have no maps for that round. |
|
_________________ 'Deen Foxx (Wargasm)
|
|
Friend
| CT Rank: Not a CTer |
| Field's place: |
| Grid Name: |
| GID: Manta@ct/public |
| CT Wild Fort Rank: |
| Joined: 18 Oct 2006 |
| Posts: A3610 Posts |
Location: California
|
|
Posted: Sat Dec 16, 2006 4:05 am |
|
I like how ed has it setup to go by categories, however sometimes my favorite maps are stuck in a category with a lot of entries and it rarely comes up. Also with a random number generator you can get the same map 2 times in a row.
Kyle's idea is very good, I wrote something similar into my script.
I tag each map into an array for selection and make sure a certain number of rounds have passed before a map will show up again. and at no time does the array ever get cleared. it's setup on a "first in" "first out" basis and when a map exits the array its once again placed into the pool of available maps. you need to keep a large enough pool or the selection will no longer be random and you might as well use an incrementing number. |
|
|
|
Wacko
| CT Rank: Not a CTer |
| Field's place: |
| Grid Name: |
| GID: wrtlprnft@ct/public |
| CT Wild Fort Rank: |
| Joined: 06 Oct 2006 |
| Posts: 5Q36206 Posts |
Location: 0x08048000
|
|
Posted: Sat Dec 16, 2006 7:18 am |
|
This should be fixed already. Though it is still possible that the same map gets played two times in a row (without us interfering), but this should be very unlikely, the probability is something around (numer of maps in that round)^(-2) for every round played. |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
|
|  |