• 14
• 12
• 9
• 10
• 13
• ### Similar Content

• By Just4lol
Hello,
I'm looking for my dream teammate(s) to help me work on my Unity game. I still dont know where Im going with that project but I want to make a good final product that I would be able to sell or publish it for free on Steam.  Here a video of the prototype (The only thing I dint made is the skybox) https://www.youtube.com/watch?v=y2Otmt9jRkc
My discord : Just4lol#46982
I want somone at least as competent as me :
- I want somone with at least one year of experience in Unity (already worked with scriptable object and know oop).
- Already worked with shaders or can do editors tools is a plus.
- Can do 3d models in Blender or can do 2d art for the ui or particles effects.
- Can make soundtracks or sound effects a bonus.
Im a french Canadian so mind my english I will do my best to edit any errors I see.

• Greetings,
I am looking for team members to potentially collaborate on the development of various game projects as well as assistant applications potentially, tabletop games for example.  At the moment, I am doing the entire production on my own, which as a result is incredibly slow.  Any contributions will of course be credited, and as far as experience or skills, if you're confident that you can accomplish the tasks, then I'm more than willing to allow you to try.
The biggest need at the moment is some art skills.  I 'can' draw, but not well, which means that if I'm going for positive asthetics, that it's going to take all year.  In my 2D games, and 3D games, art has been the one hold up.  I'm currently trying to work around the art issue, using placeholders and the likes, but the result is that no matter how far I take the game in concept, it's still lightyears from completion.  The more I accomplish, the more art assets will be needed to utilize it.  I intend to work on my own skills still in this department, but that being said, people who just want to get their art into a product, or people who want to expand their portfolio, are more than welcome to take over the production of art assets.  If you only have experience in pixel art, that's fine, I have a pixel art project on-going.  If you only 3D model, that's fine too, I've had some success in concept art and the likes, and helpful friends as well. Are you more the writing type?  Me too, we can bounce ideas back and forth, help solidify the storyline and concepts as we go on into the development process. Business minded?  I'd love to learn more by seeing how you work.
I will say that, while I am working to advance my skills in all facets of game development, though my primary focus is programming, that being said I will always welcome a comrade, or ally.  Your position as a team member will not be nullified if I become able to fulfill the role.  The fact of the matter is, a team can accomplish more.  I do work a LOT on these projects, but I do understand that if you are joining this team, you aren't doing so for the wealth, meaning you likely have responsibilities elsewhere.  So, do not hesitate to contact me. If you are a beginner, looking to learn by practice, then you are welcome to come as well. We will utilize the best suited works for any development done, but it will always be merit based, meaning that whether you're a beginner that just joined, or me, if yours is more suited to the situation, yours will be used, and you will be credited for it.  Students, hobbyists, or professionals, all welcome.  If you're a professional though, I'm going to wonder why you are joining, but you are still welcome to join!
Samples are always welcome, but if you don't have any, or don't know what to submit to the diversity of my product description, then just contact me, elaborate on what you do, and I'll give you a subject.  One that will not be used unless you join the team, of that you have my word.
Matthew Suttles,
Seik Luceid#9656 on Discord, luceid.dezeir on Skype, or MatthewSuttles@Gmail.com
You can also respond to this thread though response time may be slower.

• I am looking for talents to form a team of making a strategy base action game. Talents I am currently looking for are : -
(I) Unity programmer (mobile)
(II) Game designer
(III) 3d Artist
(IV) SFX Artist
The attachment is some game concept for the game. All the concept will be turn into 3d or card form. The game will be strategy game where the players can form their own team and control the units in the battle field real time to fight against each others.  If you are interested to know more details please pm me or send an email to damnwing0405@gmail.com

• By bsudheer
Leap Leap Leap! is a fast-paced, endless running game where you leap from rooftop to rooftop in a computer simulated world.

This is a free run game and get excited by this fabulous computer simulated world of skyscrapers and surreal colors in parallax effect. On your way, collect cubes and revival points as many as you can to make a long run.

Features of Leap Leap Leap:
-Option of two themes: Black or White.
-Simple one touch gameplay.
-Attractive art.
-Effective use of parallax.
Appstore: https://itunes.apple.com/us/app/leap-leap-leap/id683764406?mt=8

• By BillyGD

Play Flick Football 3D @ https://gamejolt.com/games/flickfootball3d/326078
Flick Football 3D is a turn based football game inspired by the table top classic 'Subbuteo'.
The game is currently in very early Alpha development. There is still a lot to be done before the first proper release but I have decided to release this playable version to get as much feedback as possible.
The only game mode currently available in this release is the 'Practice Mode' which gives you control of both teams. Either play against yourself to get used to how the game works or play against friends and family on the same computer!
Planned Future Features Include:
-Take control of your own custom team in the single player campaign.
-Play in online leagues and tournaments against other players in the multiplayer mode.
-Fully customisable stadiums to make you stand out from the rest of the players.
-Improve your players stats and skills by playing matches and setting up training sessions.
Flick Football 3D is available for Windows, Mac and Browser.
Thank you for viewing my game, all feedback is greatly appreciated. I can be contacted at; BillyGDev@outlook.com
'Flick Football 3D' is also the development name for the game and I haven't yet decided what the full release will be called, so if you have any ideas please drop me a message!

# Unity Number Generator "CMWC 4096" and Implementation?

This topic is 3438 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

In another thread (C++ true random numbers), somebody mentioned that the generator CMWC 4096 by George Marsaglia was better in several ways (speed, period, simplicity, output quality) than the more commonly used Mersenne Twister. These details spurred me into investigating this generator, and I need some assistance doing so. A google quickly produced (not-so-great) C source code created by the creator of the CMWC algorithm (below). You can see a paper by the same person (taken from wikipedia) titled Random number generators. An explanation of the algorithm is also available on wikipedia: Complementary-multiply-with-carry RNGs. I think I understand the premise of the algorithm after reading the paper and several other comments by the author, but there are a couple of things in the code that don't seem to match the explanations. (1) To me, it looks like the carry is being added twice (once to 't' and again when the lower bits are extracted to 'x'). I would believe this is simply a basic mistake because it doesn't match my understanding of the math, but every reproduction of the algorithm seems to contain the apparent double addition of 'c'. (2) I also do not understand the purpose of the "if" statement and it's body - I don't see anything corresponding to it in his very simple explanation of the algorithm in the paper I linked above. I imagine that if (1) is not a mistake that this is related to it (testing for overflow), but I'm not aware of the reason for (1) so this also remains a mystery to me.
static unsigned long Q[4096], c=123;
unsigned long CMWC(void)
{
unsigned long long t, a=18782LL;
static unsignd long i=4095;
unsigned long x, m=0xFFFFFFFE;

i = (i + 1) & 4095;
t = a * Q + c;
c = (t >> 32);
x = t + c;
if(x < c)
{
++x;
++c;
}
return (Q = m - x);
}



##### Share on other sites
I realized something before I posted the above, but I apparently forgot while making the post. With respect to (1), the carry isn't added twice, but rather both Carry_n-1 and Carry_n are added. I still don't have any idea why, but it is an important distinction that two different carry values are added.

##### Share on other sites
This does not answer your question, but one of the first google results presents an implementation given by the author, and he includes a

if ((x+1)==0) { c++; x=0; }

between the if (x < c) and the return.

I just figured it might be relevant since it includes the carry variable as well.

I don't understand why he does that though... doesn't that knock out the only chance that the function will return 0xffffffff?

-Scott

##### Share on other sites
I agree. That code does not calculate the same function as documented on the wikipedia page. His cn is calculated as (a * Q + cn-1) mod b div b, and his x is calculated as (a * Q + cn-1) mod b + cn mod b then biased by 1 if x < cn (where b == 2^(2^sizeof unsigned long) and sizeof unsigned long == 4).

I can't for the life of me come up with any kind of reasonable algebraic transformation from the wikipedia equation and the implementation. Perhaps there are some cool manipulative tricks I've missed (such as Schrage's algorithm, only different).

I would also argue that a 16 kilobyte state vector per RNG is pretty expensive compared with the MT (or even other lag generators).

##### Share on other sites
I'll give it a try:
static unsigned long Q[4096], c=123; // Q holds the stateunsigned long CMWC(void){	unsigned long long t, a=18782LL;	static unsignd long i=4095;	unsigned long x, m=0xFFFFFFFE;	i = (i + 1) & 4095; // Advance through the state array, circularly	t = a * Q + c; // Notice that the result is computed as a 64-bit integer.                          // This is the core of a traditional LGC,	c = (t >> 32); // except we keep changing the constant we add.	x = t + c; // add the lower 32 bits with the higher 32 bits to avoid poor quality bits at the extremes.	if(x < c) // About 50% of the time (?? I don't know why this helps).	{		++x;		++c;	}	return (Q = m - x); // I don't know why this is better than simply (Q = x)'.}

##### Share on other sites
Quote:
 Original post by Bregma[...]I would also argue that a 16 kilobyte state vector per RNG is pretty expensive compared with the MT (or even other lag generators).
In some applications, such a large state is required. For example, consider a card game where each player can have a deck up to size S and there can be N players per game, you need to be able to generate a number from 0 to S!^N which grows very fast. If the game allowed up to 1000 cards per deck and 6 players per game, the state size required is 1000! ~= 2^8520 for one deck and (2^8520)^6 = 2^51120 for the initial game state, which is beyond MT's capability.

This kind of situation could easily happen in a customizable card game that doesn't have a maximum deck size in the rules, such as Magic the Gathering. In fact, to allow some tournament formats, you'd actually need two levels of RNGs (probably one 'seed generator' per tournament and then one 'game generator' per game) since a single one does possible provide the required state size.
Quote:
 I'll give it a try:[...]if(x < c) // About 50% of the time (?? I don't know why this helps).[...]
It's not 50% of the time: Since C is added to the value that determines X, X can only be lower than C if the value has overflowed. Overflow can only happen rather rarely since the range of C (0..18782 due to the ++C) is rather low and the range of the low 32 bits of T (0..2^32-1) is rather high. 99.99956272% of the time ((2^32-18782)/(2^32-1)), the lower bits of T will be small enough that no value of C will cause overflow.

[Edited by - Extrarius on October 22, 2008 11:22:48 AM]

##### Share on other sites
Quote:
Original post by Extrarius
Quote:
 I'll give it a try:[...]if(x < c) // About 50% of the time (?? I don't know why this helps).[...]
It's not 50% of the time: Since C is added to the value that determines X, X can only be lower than C if the value has overflowed. Overflow can only happen rather rarely since the range of C (0..18782 due to the ++C) is rather low and the range of the low 32 bits of T (0..2^32-1) is rather high. 99.99956272% of the time ((2^32-18782)/(2^32-1)), the lower bits of T will be small enough that no value of C will cause overflow.

Of course you are right. When I first read the algorithm, I thought that Q was a 64-bit integer.

Anyway, it's not clear to me what that if(x < c)' part does, and the same goes for the subtracting-from-0xfffffffe part.

##### Share on other sites
Quote:
 Original post by alvaroand the same goes for the subtracting-from-0xfffffffe part.

The same as subtracting 4 bit number.

14 - 0 = 14
14 - 1 = 13
14 - 15 = -1 mod 0xF = 15

Basically inverting the number, and shifting it by a little.

##### Share on other sites
Complement Multiply With Carry

I am not capable of translating the theory to an algorithm either, but I want to point out that the calculation of Mod (2^n-1) needs to use some tricks.

For example, if modulus = 2^n - 1 then there is an efficiency trick:

result = x Mod modulus

is equivilent to

result = (x And modulus) + (x >> n)
If (result >= modulus) Then result -= modulus

(^^ thats a bitwise And)

The later is generally much more efficient (assuming good branch prediction)

Now, note that he is using the constant 0xfffffffe, which is not his modulus (which is 0xffffffff) but in fact 1 less than his modulus .. this could explain what might be considered a spurious increment

note that (x And modulus) in his code is implicit with a conversion from 64-bit to 32-bit

##### Share on other sites
Quote:
Original post by Raghar
Quote:
 Original post by alvaroand the same goes for the subtracting-from-0xfffffffe part.

The same as subtracting 4 bit number.

14 - 0 = 14
14 - 1 = 13
14 - 15 = -1 mod 0xF = 15

Basically inverting the number, and shifting it by a little.

When I say I don't know what the code does I mean that I don't see how it's going to significantly affect the quality of the pseudo-random numbers generated.