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

Author Topic: SFML 2 Randomizer  (Read 15609 times)

0 Members and 1 Guest are viewing this topic.

Chuckleluck

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
SFML 2 Randomizer
« on: June 11, 2012, 06:08:17 pm »
Hello,
I've used SFML 1.6 for a little while, and when I made the switch to SFML 2, I noticed sf::Randomizer is gone.  Why was it removed?  And is there a new method built into SFML 2 that I could use to get random numbers?

Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML 2 Randomizer
« Reply #1 on: June 11, 2012, 06:53:13 pm »
The C++ standard has a random number generator, there was no point having a thin wrapper in SFML.
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10226
    • View Profile
    • development blog
    • Email
Re: SFML 2 Randomizer
« Reply #2 on: June 12, 2012, 03:12:23 pm »
Also the forum search would have answered you're question... ::)
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

Chuckleluck

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: SFML 2 Randomizer
« Reply #3 on: June 12, 2012, 06:57:12 pm »
Oh...heheh... :o

Thanks for the quick answer Laurent.  :D

aNewHobby

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • Live 4 Ever Or Die Trying
Re: SFML 2 Randomizer
« Reply #4 on: June 28, 2012, 06:53:38 am »
std::rand is a bit lame imo... but there is a neat randomiser in boost you can use if you like?

http://www.boost.org/doc/libs/1_49_0/doc/html/boost_random.html

It can do a lot more cool stuff, and I switched to it form my hobby project I am doing outside of school for random map generation. As you can have all sorts of restrictions and properties on the random numbers generated. Coll stuff like probabilities. Like for example, gen 100 numbs (1-100) but 50 of them have to be 5 (5 == tree sprite in my game for example.) but out of those 5 trees X trees are normal, y trees are rare and z trees are super rare and have a wood nymph living in it.. )
Twitter: @Jyinkies
My Own Little Spot on the Net: - Live4everOrDieTrying.info (Blog)

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6276
  • Thor Developer
    • View Profile
    • Bromeon
Re: SFML 2 Randomizer
« Reply #5 on: June 28, 2012, 08:11:45 pm »
By the way, the Boost.Random functionality is also available in the C++11 standard library and in TR1 (slightly different).
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Walks_With_Gaia

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: SFML 2 Randomizer
« Reply #6 on: August 04, 2021, 11:35:40 pm »
The C++ standard has a random number generator, there was no point having a thin wrapper in SFML.

I know I'm late to this particular party, but I think that was a bad idea. The C++ random lib is a bit, well, pants.