wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > - Submit a resource -
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-14-2011, 08:00 AM   #16
Bribe
User
 
Bribe's Avatar
 
Join Date: Mar 2010
Posts: 233

Submissions (1)

Bribe will become famous soon enough (30)Bribe will become famous soon enough (30)

Send a message via AIM to Bribe
Default

It just makes the game not able to be reloaded? I thought it was something more obscure and harder to detect. Ok, that's easy enough to test. I will do that tonight (German time).
Bribe is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-14-2011, 06:03 PM   #17
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Quote:
Originally Posted by tamisrah
I would totally prefer a small tutorial on how to create those functions over this snippet. xD

Ok lets start with circular modulo groups.
For this to work we need a base 2 size.
Let us pick 2^3 = 8 as base size for our example.

We need to create a circular pseudorandom function for numbers: 0 1 2 3 4 5 6 7
First index (seed) is always 1.
We need a multiplicator M and addition factor A
Our function always looks like this: seed = (seed * M + A) mod B
Let us try M == 3 and A == 1
seed[1] = 1
seed[2] = 1*3 + 1 = 4
seed[3] = 4*3 + 1 = 13 // we got a number over 8 so we do 13 mod 8 = 5
seed[4] = 5*3 + 1 = 16 // 16 mod 8 = 0
seed[5] = 0*3 + 1 = 1

We have reached 1 and completed our circle.
But it is not a full circle because we only got indexes: 1 4 5 0 (half circle)
We can never create indexes 2 3 6 7 with this function, it is not good.

We need to experiment a little more.
Lets try M == 5 and A == 1
seed[1] = 1
seed[2] = 1*5 + 1 = 6
seed[3] = 6*5 + 1 = 31 -> 7 // remember the modulo 8
seed[4] = 7*5 + 1 = 36 -> 4
seed[5] = 4*5 + 1 = 21 -> 5
seed[6] = 5*5 + 1 = 26 -> 2
seed[7] = 2*5 + 1 = 11 -> 3
seed[8] = 3*5 + 1 = 16 -> 0
seed[9] = 0*5 + 1 = 1

Yeah we got full circle.

Things to remember:
B - Base should be power of 2. (2 4 8 16 32 64 128 ...)
M - Multiplicator should be odd number. (1 3 5 7 9.....)
A - Addition factor should be odd number. (1 3 5 7 9.....)

You always start with seed 1 and test until you go back to seed 1.
function always looks like this: seed = (seed * M + A) mod B
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.

Last edited by cohadar : 12-14-2011 at 06:03 PM.
cohadar is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 03:05 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services