logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
NWNX_System override

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
Ilerien



Joined: 31 Jan 2010
Posts: 3
Location: Russia

PostPosted: Sun Jan 31, 2010 4:17    Post subject: NWNX_System override Reply with quote

It's my first attempt to supplement NWNX plugin. The extension is currently very simple, but somebody might find it useful. Also, I'm going to extend system plugin further.

I'm bored with players complaining about unfair randomizer. It's known that NWN use pseudorandom number generator (possibly like this: http://en.wikipedia.org/wiki/Linear_congruential_generator) with seed depending on area parameters, so it's quite "nonrandom" Smile My function (TrueRandom()) takes random numbers directly from entropy pool (/dev/urandom). I've tested repeatedly its results and found that expectation & variance (and several other probability distribution characteristics) were noticeably closer to those of uniform distribution than expectation & variance of default randomizer.

Link: http://nwn.virusman.ru/svn/nwnx2-linux/branches/ilerien-system-override/
Download link (ZIP): http://nwn.virusman.ru/trac/nwnx2-linux/changeset/294/branches/ilerien-system-override?old_path=%2F&format=zip

A thousand thanks to virusman for consultation Smile
_________________
Simple NWNX_System extension
Gem of the North
Back to top
View user's profile Send private message Visit poster's website
Paul R



Joined: 17 Apr 2009
Posts: 42

PostPosted: Sun Jan 31, 2010 23:34    Post subject: Reply with quote

Looks good, I know there have been various implementations of random number functions, even using MySQL.

Just curious why you did it as a branch rather than as a patch to the trunk? Reason I'm asking is that there have been some useful additions such as this and the per player visual effects and timer bar but have been done as separate bits of code rather than extend the main branch.

Which kind of makes it difficult to implement without rewriting that extension again if they happened to be the same one.
_________________
oops
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Feb 01, 2010 2:33    Post subject: Reply with quote

Properly made branches can be compiled as a replacement for the original plugin.
They can also be easily merged into the trunk.
axs published his work as a separate plugin outside of the repository; this is not the case with this extension.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
kucik



Joined: 11 Feb 2009
Posts: 19
Location: Czech Republic

PostPosted: Mon Feb 01, 2010 17:55    Post subject: Reply with quote

Nice job.

Have you any idea how to replace built-in engine throws like attack rolls? Is to possible to locate this finctions in binary and replace them?
_________________
Les jambes en l'air, comme une femme lubrique,
Brûlante et suant les poisons,
Ouvrait d'une façon nonchalante et cynique
Son ventre plein d'exhalaisons.
Back to top
View user's profile Send private message Visit poster's website
Ilerien



Joined: 31 Jan 2010
Posts: 3
Location: Russia

PostPosted: Wed Feb 03, 2010 12:32    Post subject: Reply with quote

Quote:
Have you any idea how to replace built-in engine throws like attack rolls? Is to possible to locate this finctions in binary and replace them?
I'll try to hook built-in engine rolls (I think, those are calls of rand() function w/ seed generating when player is entering an area). Several hours with debugger... Smile
_________________
Simple NWNX_System extension
Gem of the North
Back to top
View user's profile Send private message Visit poster's website
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Mon Apr 26, 2010 2:17    Post subject: Reply with quote

Ilerien wrote:
I'll try to hook built-in engine rolls (I think, those are calls of rand() function w/ seed generating when player is entering an area). Several hours with debugger... Smile


Have you had any luck with that?
I've found the RollDice function which d100(), d20(), etc go through, but random(...) doesn't seem to call this.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group