[solved] SortCustom2D with more than 3000values
problem solved by sawce by adding #pragma dynamic 32768
i have used this script before, and it works fine. but now there is a stack error. if i change the array_size to 3000 it will be executed. Code:
is there any way to fix it? part of the script: Code:
players.lvl (~4000lines) Code:
1177353836 |
Re: SortCustom2D with more than 3000values
SortCustom2D is using QuickSort algorithm. I dont know what version does it use exactly but some of them can run your system out of stack space even if you have just several thousands elements in your array, as it is massively recursive sort. To prevent this error there are implementations of QuickSort that use iteration with stack instead of recursion, but you would have to write it yourself or ask someone to make it for you.
|
Re: SortCustom2D with more than 3000values
Let me see if I get this right... you have a 4000+ array and you want to sort it... in PAWN... in a thread with a time-limited execution... under HL ?!?
I'm not the biggest fan of SQL but in your case it's the ONLY solution. EDIT: @Sylwester: Regrdless of the algorithm, the overhead is too much. Even if the SortCustom2D works with ~3000 entries, it does not mean it's the right way to do this. |
Re: SortCustom2D with more than 3000values
That code looks familiar!!
To solve using huge arrays, I just decided to sort the entries as they came in. Check the source of the latest version of GunGame. |
Re: SortCustom2D with more than 3000values
#pragma dynamic 32768
|
Re: SortCustom2D with more than 3000values
Quote:
Not everyone has access to an SQL server, and, so long as it is done someplace like mapload, that's not _that_ bad. Obviously SQL would be ideal, but it's not the end of the world. @noname\: Can you provide me with the entire script + full database file to test something? You can send via PM if you don't want it to be public. |
Re: SortCustom2D with more than 3000values
Quote:
Quote:
Quote:
your code looks really awesome! (btw: thanks for your great brainbread stock files) but i also want to show up three ranks above/below a users rank. [example] so your code is not the best for me. i will take a look on your gungame_sql and do the mysql port. ;p Quote:
edit:works like a charm =) Quote:
sure. check your pm's. thanks for your help! |
| All times are GMT -4. The time now is 21:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.