AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011 (https://forums.alliedmods.net/showthread.php?t=148387)

Peace-Maker 01-29-2011 09:53

Re: SMLIB 0.9.2 BETA (274 Function Stocks) | updated 28.01.2011
 
PHP Code:

stock bool:Weapon_IsReloading(weapon

is missing an "return".

zeroibis 01-30-2011 18:54

Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
 
So I am guessing these new random value functions are more random than stock ones like: GetRandomInt() or GetRandomFloat()

Also the math_clamp does actually redefine the value to min or max if it is out of bounds right?

berni 01-30-2011 19:09

Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
 
Quote:

Originally Posted by zeroibis (Post 1403449)
So I am guessing these new random value functions are more random than stock ones like: GetRandomInt() or GetRandomFloat()

That's right, it's 100% random and uniform.
I tried psychonic's function first, but that wasn't completely random,
so I rewrote it and made some tests to make sure each value has the same chance of being returned.

Quote:

Originally Posted by zeroibis (Post 1403449)
Also the math_clamp does actually redefine the value to min or max if it is out of bounds right?

yes, it makes sure the value doesn't go below min or higher than max and corrects it if neccessary.

smlib 0.9.4 will be released today.

FaTony 01-31-2011 01:00

Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
 
Quote:

Originally Posted by berni (Post 1403457)
That's right, it's 100% random and uniform.

Heresy! You will have to use nuclear decay sensors or something like that to achieve 100% randomness and it's results still may be debated on a philosophical level.

berni 01-31-2011 01:07

Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
 
FaTony, your trolling slowly becomes annoying.
We all know that 100% randomness doesn't exist in the universe (chaos theory).
it's as random as it can be now in a sourcemod, and from a relative point of view that's 100%, not gonna debate this further.

berni 01-31-2011 01:10

Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
 
New smlib update available: smlib 0.9.4 beta

Compatibility breaks: Removed argument of Effect_FadeIn()

Changes:

Quote:

  • Added Entity_GetParent()
  • Added Entity_RemoveParent()
  • Added Entity_SetParent()
  • Added Math_MoveVector()
  • Removed unnecessary parameter kill in Function Effect_FadeIn()
  • Fixed missing any: type at "..." parameters
  • Added missing return in Function Weapon_IsReloading(), thanks to Peace-Maker!
  • Redesigned the smlib includes to allow including of single smlib includes and save some milli seconds.

Download here.

FaTony 01-31-2011 01:24

Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
 
Quote:

Originally Posted by berni (Post 1403565)
FaTony, your trolling slowly becomes annoying.
We all know that 100% randomness doesn't exist in the universe (chaos theory).
it's as random as it can be now in a sourcemod, and from a relative point of view that's 100%, not gonna debate this further.

You are scientifically incorrect. I guess SourcePawn is Turing complete, therefore it is possible to write the algorithm of infinite complexity in SourcePawn, so it'll be infinitely more random than yours. Your function is neither 100% random nor as random as possible in SourcePawn.

zeroibis 01-31-2011 02:30

Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
 
If it is random enough to give equal chance to all values in a few thousand runs that is a lot better than what we had before.

Also he said "random as it can be now" in that it is as random as it can be given the time. In order to achieve true randomness you will need to wait for an infinite duration for the now to apply for infinite randomness. So after infinite time is spent creating an infinity random random generator you can then evaluate if it is truly random. (I will try to be placed in suspended animation prior to death to await your results)

On another note I was wondering about effectiveness of the float version when used with decimal percentage values. For example: Math_GetRandomFloat(0.0,1.0)<=0.23

Is this fine, totally wrong or should I be saying 0.00,1.00 or something to improve accuracy?

FaTony 01-31-2011 03:16

Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
 
Infinite pseudo randomness =/= true randomness to me.

berni 01-31-2011 11:51

Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
 
Quote:

Originally Posted by zeroibis (Post 1403591)
On another note I was wondering about effectiveness of the float version when used with decimal percentage values. For example: Math_GetRandomFloat(0.0,1.0)<=0.23

Is this fine, totally wrong or should I be saying 0.00,1.00 or something to improve accuracy?

you can add as many 0's as you want, it will stay the same number :3
I don't know what exactly you mean, it will always have the same effectiveness.


All times are GMT -4. The time now is 21:59.

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