TetWiis update – when is random not a random!

Answer – when its a rand() function call on the wii!

I was aware that there may be some frailties with the rand() function, but I didn’t expect to come across what I found!

My original code did the following to determine the next block

return (rand()%7) +1;

Which all seemed good and well.  I understood that it was only pseudo random, though what I didn’t expect was if I called it consecutively within quick succession of each other, that it would suddenly start returning the same number!  I noticed that if I dropped the blocks quick enough, that I could get 2 or 3 of the same type to appear in the list!  It took me a few goes to test this and make sure it wasn’t just chance, but sure enough, I could recreate it!

The solution – I decided to implement a mersenne twister random number generator!  I’d read about these types of generators before and searching the interweb, I came across http://www.bedaux.net/mtrand/ where sure enough, a simple enough implementation of it exists that I could pretty much take as a whole (Thanks Jasper!)

My randoms now really are random no matter how quickly I do it which obviously makes for a much better game of TetWiis 🙂

TetWiis Update

My ToDo list is as follows.  Anything struck out has been done!

Screen shot below todo list!

  • Increase drop speed with level increase
  • Fast drop of piece (rather than having to hold down)
  • Hold piece
  • Pretty up the blocks so they are not a solid lump of colour (in progress!)
  • Preview of piece where it will drop
  • Animate and ‘graphicalise ‘ the game over and pause text
  • Make the start screen so you can click on the menu items
  • Add an options screen where you can set the following (and maybe more):
    • ingame BGM
    • ingame BGM volume
  • Score board (maybe online!)
  • Sound effects
  • Test, test, test!
  • Support for classic controller/GameCube Pad

tetwiis-nov11

TetWiis Update

I’ve now after spending some time finally got the 6 block preview pane to start showing the blocks so you can see what is coming next, and i’ve just added the queue initialise (not tested yet!) so that it changes on every new game.  I’ve also re-jigged the background graphics a little to make the blocks fit in the preview panes, and to fit the game onto the screen properly!

I’ve also finally coded the scoring and levels/number of lines counts.

Next to do is following:

  • Increase drop speed with level increase
  • Fast drop of piece (rather than having to hold down)
  • Preview of piece where it will drop
  • Animate and ‘graphicalise ‘ the game over and pause text
  • Make the start screen so you can click on the menu items
  • Add an options screen where you can set the following (and maybe more):
    • ingame BGM
    • ingame BGM volume
  • Test, test, test!

BootMii Configuration Editor – Source

I’ve finally got around to releasing the source to BootMii Configuration Editor  😯

This doesn’t signal and end to development on it, but now feels like a good time to release the source as it’s been pretty static for a good while now, plus I’m concentrating on TetWiis right now!

The source is available here http://code.google.com/p/bootmiiconfigurationeditor/
and is released with an LGPL licence.

All as I ask is that if you do use any of this or make any changes to any of it, please credit me in the readme somewhere and let me know.

I’m happy to include and take on board any changes which better and improve the product, and to include these in the SVN repository!