20.11.2009, 18:12
Thanks for the input and opinions.
The first post has been updated, I downloaded ubuntu(debian) and got it compiled properly. The makefile should be good for all linux releases. The .so is also included.
@ Orb - The speed results surprised me actually, seeing that the results when run in c++ the average time for call is about 60-70ns. My guess is there must be a bottleneck in the way the pawn vm and the plugin communicate.
Now to clear up how I made my speed assumption. My gm is random heavy, and one of these areas are when a player is team balanced they are chosen a random skin from and array and a spawn location (array also) using the method random(sizeof(array)) survivors array is a bit over 200. When you would /kill (which is just SpawnPlayer()) over and over again there would be a slight hiccup or noticeable lag. Most of the time you don't have to spam it to notice the delay. When I switched to MRandom and went back and spammed the command there was no delay or lag at all. As fast as I spammed as fast as I spawned. To me that's a return in speed. My theory is possibly that off loading the maths and such from the pawn vm cured the lag, but that's just an assumption.
What I know is a fact is that my car starting has not gone into a 15 no start loop. In fact the longest tries I have encountered is about 3 till vehicle start. Also in my testing of my new server patch where I utilize this plugin the checkpoints are not appearing Glen Park, Glen Park, Glen Park. Also there is the added benefit of a random float value, something pawn's random doesn't do.
I have since your posts Orb been looking into some other algorithms and found a few I like and want to try, so I am going to turn this project from a Mersenne Twister only plugin to a Multi-PRNG plugin. Each Method will just have its own set of functions so it will be easy to test and try them all and ultimately the choice of what random can be left to the scripter.
@DiDok - Let me know how it goes.
Thanks,
C-P
The first post has been updated, I downloaded ubuntu(debian) and got it compiled properly. The makefile should be good for all linux releases. The .so is also included.
@ Orb - The speed results surprised me actually, seeing that the results when run in c++ the average time for call is about 60-70ns. My guess is there must be a bottleneck in the way the pawn vm and the plugin communicate.
Now to clear up how I made my speed assumption. My gm is random heavy, and one of these areas are when a player is team balanced they are chosen a random skin from and array and a spawn location (array also) using the method random(sizeof(array)) survivors array is a bit over 200. When you would /kill (which is just SpawnPlayer()) over and over again there would be a slight hiccup or noticeable lag. Most of the time you don't have to spam it to notice the delay. When I switched to MRandom and went back and spammed the command there was no delay or lag at all. As fast as I spammed as fast as I spawned. To me that's a return in speed. My theory is possibly that off loading the maths and such from the pawn vm cured the lag, but that's just an assumption.
What I know is a fact is that my car starting has not gone into a 15 no start loop. In fact the longest tries I have encountered is about 3 till vehicle start. Also in my testing of my new server patch where I utilize this plugin the checkpoints are not appearing Glen Park, Glen Park, Glen Park. Also there is the added benefit of a random float value, something pawn's random doesn't do.
I have since your posts Orb been looking into some other algorithms and found a few I like and want to try, so I am going to turn this project from a Mersenne Twister only plugin to a Multi-PRNG plugin. Each Method will just have its own set of functions so it will be easy to test and try them all and ultimately the choice of what random can be left to the scripter.
@DiDok - Let me know how it goes.
Thanks,
C-P