Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Azaral

Pages: 1 [2] 3 4 ... 8
16
Graphics / Re: Shader is running really slow. Not sure what it is.
« on: February 17, 2014, 05:53:01 am »
I changed it to take up the entire 1280x720 resolution and it now runs at around 23 fps.

17
Graphics / Re: Shader is running really slow. Not sure what it is.
« on: February 17, 2014, 05:51:16 am »
I changed the part for outputting the fps to once a second vs every frame and it runs 109-111 fps now.

18
Graphics / Re: Shader is running really slow. Not sure what it is.
« on: February 17, 2014, 05:46:27 am »
I ran it unaltered and was getting 90-110 fps.

19
Graphics / Re: [Beginner] Help with Bouncing Circles
« on: February 15, 2014, 05:52:23 pm »
The seed is to make the random generator behave differently on each run. If you did not set a seed, then the results would be the same each time you start the program. The balls would change colors in the same sequence every time the program is ran. That is the purpose of the seed, to prevent that.
Yeah, I know what a seed does, but I didn't know if the new random needs a seed too, or if, for example, the system time is automatically used as seed.

The seed is just the starting point. Random number generators work off of the previous value it generated to make a number.

20
Graphics / Re: [Beginner] Help with Bouncing Circles
« on: February 15, 2014, 05:16:47 am »
It looks like you keep resetting the seed for the random function. Take a look at the <random> part of the stl. IT has a lot better functionality than the old random.
Okay, I now I use the new random:
default_random_engine engine;
uniform_int_distribution<int> distribution(1,255);
auto random = bind ( distribution, engine );
 
I use this no matter which border is touched:
Ball[i].setFillColor(sf::Color(random(), random(), random()));
 

Now it definetely looks better, but do I need to set an extra seed for the generator?

The seed is to make the random generator behave differently on each run. If you did not set a seed, then the results would be the same each time you start the program. The balls would change colors in the same sequence every time the program is ran. That is the purpose of the seed, to prevent that.

21
Graphics / Re: [Beginner] Help with Bouncing Circles
« on: February 14, 2014, 10:43:19 pm »
Ok, still trying to fix my timestep, but meanwhile I added two features:

1. Outline can be (de-)activated by pressing the 'r' key
2. Circles change color when colliding with a window-border

But there's one thing I don't understand: It seems like the colors are always nearly the same. What did I do wrong?  :-\

It looks like you keep resetting the seed for the random function. Take a look at the <random> part of the stl. IT has a lot better functionality than the old random.

22
SFML projects / Re: Flappy Poro
« on: February 12, 2014, 10:19:47 pm »
Like Cadisol87 said, if you don't like a game, just don't play it :(

Or if you don't like a game, give constructive criticism and then don't play it. For example, "I feel the game has a difficulty curve too steep for me to enjoy it. It may of been beneficial to provide a lower difficulty option".

I'd rather someone politely tell me why they don't like something than just go "lol this sucks" and do no more :)

Requires too much thinking for the average player I think. Most expect to have everything handed to them and spelled out for them. Perhaps I am being too cynical.

23
SFML projects / Re: Flappy Poro
« on: February 12, 2014, 04:48:26 pm »
That's pretty sad and pathetic in my opinion. It's just a game, there is no reason for personal attacks on the creator of the game.

24
SFML projects / Re: Flappy Poro
« on: February 12, 2014, 03:06:39 pm »
Oh god i suck at this game lol. I can hardly ever get passed the second obstacle lol

25
Graphics / Re: [Beginner] Help with Bouncing Circles
« on: February 10, 2014, 12:34:31 am »
Also, beware of changing the velocity of one before you calculate the new velocity of the other. If you do not, then you will not have a correct collision.

I did that, didn't I?  ???

I don't know, I was just throwing that out there.

26
Graphics / Re: [Beginner] Help with Bouncing Circles
« on: February 09, 2014, 07:35:11 pm »
(mass - mass)

Why are you now again using separate coordinates instead of vectors? I think we agreed that vectors would make the code simpler and more readable ;)

And don't duplicate code, you can merge the four functions to one.

If you are suggesting that mass should be a vector, it can't be as it is a scalar.

However, all of these functions can be combined into a single function and if the vector arithmetic is set up correctly, you do not have to calculate the values of the vectors separately.

Also, beware of changing the velocity of one before you calculate the new velocity of the other. If you do not, then you will not have a correct collision.

28
General discussions / Re: Class for extremely big, or small, numbers
« on: February 07, 2014, 02:54:41 pm »
Well, they are small now, but I plan to allow the particle to gather up and squeeze a group of smaller particles into bigger particles. Eventually there will be really big particles that will be making numbers that are much bigger.

29
General discussions / Re: Class for extremely big, or small, numbers
« on: February 06, 2014, 10:27:20 pm »
Have you already searched for "big integer c++" or "big decimal c++"?
GMP is a known library.

Out of curiosity, what do you need it for?

I have searched for something similar and I found gmp. I was just trying to find more options.

I'm working on a particle accretion simulator for fun and working with really small numbers. I'm not getting enough precision with the numbers. 

Forgive me for asking, but out of curiosity, what could you possibly need more than the 19.26 decimal digits that long double gives you? Also, I don't think there is any way to store any number larger without losing precision.

edit: I guess you can ignore this post, other higher beings are more knowledgeable :)

I am using long double, but it is rounding numbers off. I calculate something with 13 decimals, and it is rounding off at 4 in some cases. I'm also getting read outs out equal numbers not being equal.

One such example is the gravitational constant,  0.0000000000667384. Already using up 11 decimals (I've had to truncate it to prevent getting 0 for results from rounding).

When calculating gravitational forces, you can easily get over the 19 decimals.

Fg = G * ( M1 + M2) / R ^ 2

If M1 + M2 = 1 and R ^ 2 (the squared distance between 1 and 2) is 2822400 (1680 * 1680, one side of my screen to the other).

Fg = G * 1 / 2,822,400 = 0.000000000000000023645975 ( 24 decimals )


30
General discussions / Class for extremely big, or small, numbers
« on: February 06, 2014, 09:52:36 pm »
Is there a class that allows for any number of digits before and after the decimal point for C++? Something that will allow me to have numbers that are bigger or smaller than what I can get with the standard data types.

Pages: 1 [2] 3 4 ... 8