*Author

chriskang

  • Guest
Random Number Generator https://elementscommunity.org/forum/index.php?topic=778.msg7340#msg7340
« on: December 15, 2009, 10:10:05 pm »

In all the code, there are 43 calls to the (good) actionscript random and 53 to Zanzarino's rand()

Deck shuffling uses the Fisher–Yates algorithm with actionscript random.
Wikipedia says it's a good idea:
http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle

Spinners use Math.random() from actionscript too, so no problem there either.

After a quick check, Zanzarino's (flawed) rand() is used by:
* mutations (creature's appearance, skill, skill cost, attack & life bonus)
* chances to freeze target with Ice Bolt/Ice Shield
* quantums gained with Quantum Pillars/Towers
* quantums lost with Dissipation Field
* quantums absorbed by Devourers
* quantums changed by Scramble effect
* effect from Chaos Seed/Chaos Power
* chances to miss with Fog Shield/Dusk Mantle



chriskang

  • Guest
Random Number Generator https://elementscommunity.org/forum/index.php?topic=778.msg7341#msg7341
« Reply #1 on: December 15, 2009, 10:10:05 pm »

The (good) Math.random() from actionscript is used for:
* Hatch effect
* all AI decisions (see my post on the wiki for a complete list)
* picking opponent in t50
* deck shuffling
* coin spinning (at the beginning)
* card spinning (after a victory)
* building deck of level 0 & 1 AI
* choosing your opponent in level 2, 3 & 6

Opponent for ranked pvp is chosen by the server, so I don't know how it's done.

Delreich

  • Guest
Random Number Generator https://elementscommunity.org/forum/index.php?topic=778.msg7342#msg7342
« Reply #2 on: December 15, 2009, 10:10:05 pm »
So, it is clear that the random number generator has some serious flaws at least as far as mutations goes (details here (http://elementscommunity.org/forum/index.php/topic,606.msg7464#msg7464)), leaving us with a short period, low quality RNG that changes between sessions only.
Some result are that it's much more likely than it should be to get identical mutants and there is a correlation between some of the effects (HP boost and ability, at least).

Question is, is this same flawed RNG used for other things? Perhaps even everything?

From what I have seen, it seems like deck shuffling and card lottery might be using this.
In my most recent session, I was screwed on pillars more than half of all games, getting either no pillars or nothing but pillars.
In my current session, the spinners seem very generous, so far giving me cards every win, sometimes two or three even.


Update in reply #16 (http://elementscommunity.org/forum/index.php/topic,778.msg21261#msg21261).

chriskang

  • Guest
Random Number Generator https://elementscommunity.org/forum/index.php?topic=778.msg7452#msg7452
« Reply #3 on: December 15, 2009, 10:10:06 pm »

Chris, since you seem to have your own version of the Trainer up, and since you seem to be able to edit it, have you thought about making all of the fixes that you talk about here, and perhaps adding more content? o-o
I probably think about that more than 10 times a day. I just don't want to do it without Zanzarino's consent.
I sent him an e-mail 2 weeks ago to offer my services but he never answered.
Changing the cards available in the bazaar, the starter decks and the AI decks (level 2, 3 & 6) is actually just a matter of parameters. It doesn't even require to decompile the swf. So I feel confident that there's no harm in doing this.
Editing the swf, on the contrary, is much more serious and risky for me.

Give me an agreement from Zanzarino and I can fix more than 10 bugs in a weeks' time.

Cisco

  • Guest
Random Number Generator https://elementscommunity.org/forum/index.php?topic=778.msg7453#msg7453
« Reply #4 on: December 15, 2009, 10:10:06 pm »

Hamster why not try to send an email he may be more responsive to the admin of the elements forum. I´ts gettin annoying anyways that Zan has Pract disapeard.ecspecially whene he was so activ before the last update

Evil Hamster

  • Guest
Random Number Generator https://elementscommunity.org/forum/index.php?topic=778.msg7454#msg7454
« Reply #5 on: December 15, 2009, 10:10:06 pm »

Hopefully Zanzarino will agree. A game like this really needs more than one developer. Zanzarino himself said he's busy right now with other things so having more people join the team would be a very wise choice. You seem to know your stuff and would probably be the right man for the job.

Problem right now it that players are getting bored really quick. False Gods are too easy and PvP has many issues. We need more updates to take this game to a new level and keep all the players interested.

So yeah.. more developers are needed asap.
Seconded

Scaredgirl

  • Guest
Random Number Generator https://elementscommunity.org/forum/index.php?topic=778.msg7455#msg7455
« Reply #6 on: December 15, 2009, 10:10:06 pm »

Chris, since you seem to have your own version of the Trainer up, and since you seem to be able to edit it, have you thought about making all of the fixes that you talk about here, and perhaps adding more content? o-o
I probably think about that more than 10 times a day. I just don't want to do it without Zanzarino's consent.
I sent him an e-mail 2 weeks ago to offer my services but he never answered.
Changing the cards available in the bazaar, the starter decks and the AI decks (level 2, 3 & 6) is actually just a matter of parameters. It doesn't even require to decompile the swf. So I feel confident that there's no harm in doing this.
Editing the swf, on the contrary, is much more serious and risky for me.

Give me an agreement from Zanzarino and I can fix more than 10 bugs in a weeks' time.
Hopefully Zanzarino will agree. A game like this really needs more than one developer. Zanzarino himself said he's busy right now with other things so having more people join the team would be a very wise choice. You seem to know your stuff and would probably be the right man for the job.

Problem right now it that players are getting bored really quick. False Gods are too easy and PvP has many issues. We need more updates to take this game to a new level and keep all the players interested.

So yeah.. more developers are needed asap.

Random Number Generator https://elementscommunity.org/forum/index.php?topic=778.msg7456#msg7456
« Reply #7 on: December 15, 2009, 10:10:06 pm »

Chris, since you seem to have your own version of the Trainer up, and since you seem to be able to edit it, have you thought about making all of the fixes that you talk about here, and perhaps adding more content? o-o

Random Number Generator https://elementscommunity.org/forum/index.php?topic=778.msg7457#msg7457
« Reply #8 on: December 15, 2009, 10:10:06 pm »

Hopefully Zanzarino will agree. A game like this really needs more than one developer. Zanzarino himself said he's busy right now with other things so having more people join the team would be a very wise choice. You seem to know your stuff and would probably be the right man for the job.

Problem right now it that players are getting bored really quick. False Gods are too easy and PvP has many issues. We need more updates to take this game to a new level and keep all the players interested.

So yeah.. more developers are needed asap.
Seconded
Thirded

chriskang

  • Guest
Random Number Generator https://elementscommunity.org/forum/index.php?topic=778.msg7766#msg7766
« Reply #9 on: December 15, 2009, 10:10:07 pm »

I remember someone saying he had received an e-mail from Zanzarino 2 or 3 weeks ago.
Was it Pilchard? If he's still around he might try too?

Evil Hamster

  • Guest
Random Number Generator https://elementscommunity.org/forum/index.php?topic=778.msg7767#msg7767
« Reply #10 on: December 15, 2009, 10:10:07 pm »

I'll try, but I doubt he'll answer me any more than anybody else...

Forfeit

  • Guest
Random Number Generator https://elementscommunity.org/forum/index.php?topic=778.msg7768#msg7768
« Reply #11 on: December 15, 2009, 10:10:07 pm »

Does anyone even go to that forum?

Also, Chris is defintly the person to help with the game. So I forth that idea.

 

anything
blarg: