User Tag List

Results 1 to 9 of 9

Thread: Help with random block placement please

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export ModuleInstall CreatorInstall Creator Pro

    Join Date
    Jun 2006
    Location
    UK
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Help with random block placement please

    I'm sure there's a simple way to do this but for the life of me I can't think of it!!

    What I want to create is a playing field made up of blocks but everytime the game is played I need it to be randomized.
    The problem is that the blocks aren't all the same size. Lets use Tetris blocks as an example although this isn't going to be for a Tetris game.
    Some of the Tetris blocks may be long, some tall, others may be T shaped etc. How do I make it create a random playfield out of different size blocks with no gaps?

    All ideas would be appreciated

    Thanks
    Marc

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    I'm not sure there's a simple way to do this
    but would be happy hearing some creative idea on this

    What I can think of is:
    1) creating a grid of square blocks (say, an array of cells)
    2) randomly connect them (i.e. block 3,3 with block 3,2 make for a "I" block)
    3) use some "autotiling" procedure to make blocks fit each other:
    i.e.: http://www.saltgames.com/article/awareTiles/
    and give them an apt color (maybe based on number of squares) if needed

    the bad thing is this could result in some too "complex shaped" blocks, unless you strictly code step 2

    another approach may be preparing a set of predetermined blocks,
    and a procedure (>>> loop) placing them one by one from top-left corner and trying to fit them each other
    making sure you can use "single blocks" to fit in empty spaces that will surely pop out

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export ModuleInstall CreatorInstall Creator Pro

    Join Date
    Jun 2006
    Location
    UK
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Thanks for your reply.
    A lot to think about to try and get this working I think

  4. #4
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    May 2016
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I really hope that they will add the ability to check for instances in Fusion 3. That will makes auto tiling much easier without having to create detectors.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,336
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    A little late to there party, but here goes... a commented example
    I think it's the alternative approach Schrodinger mentioned.

    Oh, disregard that second level frame. Forgot to delete it..
    Attached files Attached files

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,300
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    You are seriously underestimating the complexity of what you're trying to do. This a very, very difficult problem - the kind of thing university maths students might write a thesis on.
    For example:
    https://oeis.org/A230031/a230031.pdf
    http://orion.math.iastate.edu/butler/papers/tiling.pdf

    Of course, if you allow gaps (or just fill them in with smaller polyominos like Popcorn does), that makes things very much easier.

  7. #7
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export ModuleInstall CreatorInstall Creator Pro

    Join Date
    Jun 2006
    Location
    UK
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Thanks Popcorn - that's a fantastic example, very clever

  8. #8
    Clicker Fusion 2.5Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    zip2kx's Avatar
    Join Date
    Jun 2015
    Posts
    767
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MuddyMole View Post
    You are seriously underestimating the complexity of what you're trying to do. This a very, very difficult problem - the kind of thing university maths students might write a thesis on.
    For example:
    https://oeis.org/A230031/a230031.pdf
    http://orion.math.iastate.edu/butler/papers/tiling.pdf

    Of course, if you allow gaps (or just fill them in with smaller polyominos like Popcorn does), that makes things very much easier.
    wow.
    i opened those and closed them immiedatly again lol

  9. #9
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,300
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Yep, my point exactly! Maths is scary

Similar Threads

  1. Random Number Block Game?
    By Emerson3 in forum Fusion 2.5
    Replies: 2
    Last Post: 28th January 2015, 09:23 PM
  2. Replies: 3
    Last Post: 16th September 2014, 12:47 PM
  3. Random placement
    By DemonD in forum Fusion 2.5
    Replies: 2
    Last Post: 16th August 2014, 05:25 PM
  4. random placement, collision + destruction
    By SolarB in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 10th March 2012, 05:07 AM
  5. creating objects with random placement....
    By mobilwon in forum The Games Factory 2 - Technical Support
    Replies: 4
    Last Post: 9th December 2006, 07:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •