User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 26

Thread: Tile Solver (Procedural Generation)

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    ScrotieFlapWack's Avatar
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Tile Solver (Procedural Generation)

    Hi Guys,

    I am looking for some help on how to make a 'Tile Solver' for my game. I am generating tiles at a certain X position off screen and I am moving all tiles X positions across the screen to give a scrolling effect (for an endless runner game).

    I have some global values which basically keep track of when to create gaps and also control the length of the platforms that are generated. Once the tiles reach a certain X position off screen (on the left) they are destroyed. I also have a global value to control the height of the platforms too.

    I am looking for help on how I can start to create a solver which will place the correct tile by its neighboring tiles. My tile sprite has 32 animation directions, each of these animation directions holds a different tile. My current setup in the event editor basically generates the tiles and platform lengths and gaps and height. When there is a change in height I want to change the tile that is generated to a different tile and then when there is a gap in the platform I want to change the end tile of the platform and the start tile of the new platform.

    I don't know what the best way is to handle this and I am pretty sure that I may need a 'For Each' loop because I am dealing with instances which are the tiles that are being generated.

    There is probably more than one way to do this, if you need to see the logic in the event sheet I am happy to provide screenshots. Right now the global values I have is "Platform Length", "Platform Gap", "Height", "Ticker". The value names are pretty clear, I use them in combination with some simple comparing and random() functions to give variation in the gaps and platform lengths.

  2. #2
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    ScrotieFlapWack's Avatar
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I can provide the project if it would make it a little easier to determine how to start something like this.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    If you have thought of a full "logic" behind how to create the neighboring tiles,
    for every situation that can happen,
    I think you can start coding each case and than all would be gradually worked out

    If you need some ideas on how to start, an (essential, just the basics) .mfa would surely help

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    ScrotieFlapWack's Avatar
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I can upload a link to my Dropbox so the .MFA project can be downloaded there, might be a little easier to understand how my code is generating these tiles then. I appreciate the response too!

    https://www.dropbox.com/sh/cz51lkd6g...yf5DHD9wa?dl=0

    I'd love to be able to learn or take away some knowledge from this, I don't know if this type of programming is easy for the average or professional user of CF2.5 but rather than actually doing the work and sending the project back I would prefer if it could be looked at and then some advice given on the best approach to make this tile solver.

    I appreciate all the help!

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Got it!
    Will take a look during the day, if nobody does this before

    now I have to go unfortunately

  6. #6
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    ScrotieFlapWack's Avatar
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    No problem. Thanks so much for you help man!

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    You may think of a couple ways to approach this (and more),
    best one would be the one that suits your taste:

    1) tile-by-tyle: in the tile creation event, you know which kind of tile you're going to generate,
    because you have all the parameters, except maybe if there's been a "gap" before
    you could store that, say there's just been a gap
    (gap lenght = 0 + only one action when event loops)
    you set a flag on,
    then if you detect this flag on when creating the tile, change the animation accordingly (and set flag off)

    2) post-processing: this may be quicker, easier to visualize and probably handyer to do.
    Each time you create a tile, you start a set of tests to determine its "situation".
    You place a detector checking for neighboring tiles, i.e. if none is detected on its left (Xleft -1)
    this has to be a "after gap" tile, then you test height, to see if you want a different set of graphics,
    and so on.

    A suggestion in both cases would be not just using directions, but also animation numbers,
    because, if I got it correctly
    a different height tile can also be a "after gap" tile
    so you may i.e.

    a) store tile type in directions (top=top tile, top left=corner tile, etc.)
    b) store graphic variations in animations (height=1 >>> walking animation) AND use directions anyway for its "relative" position
    so you can just sync height to animation number
    and then change graphic direction basing on tests above


    Of course all these tests may become more and more complex depending on how far your procedural generation would go.


    (side note: your jelly joystick logo is AWESOME )

  8. #8
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    ScrotieFlapWack's Avatar
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    @schrodinger, thanks so much for the response man! Some very great suggestions here. I didn't think to store the tile types as animation states, thats a great idea!

    As for the tile by tile approach, this game is for mobile devices so I think the overheads of doing that method for a mobile game is not the best idea but none the less its a great idea and one that ran past my mind a few days ago.

    Option 2 seems like the best approach for me, I am trying to figure out how I would place a detector object to check each neighboring tile. Could this detector be an invisible object and all the code for the checks just be attached to that?

    Sorry if I'm sounding stupid, I'm still very new to CF2.5 and programming in general it's a completely different way of thinking for me haha.

    Also, thanks for the nice comment about my logo haha, if you ever need a favor for a logo just drop me a PM, you are helping me out a hugely so I would like to repay the favor if you need it

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Hey you're up to a difficult task,
    that's definitely an advanced thing to do,
    one that requires a careful planning and thinking,
    hardly any question is stupid, and particularly in such situation!

    Yes I'd say you could use an invisible object,
    can be a one pixel active object, you would place this detector in various positions relative to the tile
    and do so inside a "fastloop": fastloops happen inside a gameframe (timewise speaking)
    so you won't notice the time loss due to detector being placed around and tests being performed
    these tests would just be:
    detector in this position overlapping tile? >>> set this value to xx

    then in the end of the loop you would set your graphics depending on these "test results"

    If you want I can provide a very basic example with just one checking,
    than you could expand on that (if you like it)

    (thanks for offering your help with graphics, very kind!
    I may knock your door in the future then )

  10. #10
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    ScrotieFlapWack's Avatar
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Ahh man that would be awesome if you could do a simple example so I can learn from it, thanks so much!

    And yes, I look forward to repaying you haha

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Procedural Dungeon Generation (1st person rendering)
    By bad_rick in forum Guides, Tutorials, Examples, Widgets
    Replies: 11
    Last Post: 28th December 2014, 12:13 AM
  2. Procedural Generation
    By coreyschroeder in forum Fusion 2.5
    Replies: 11
    Last Post: 25th July 2014, 01:00 PM
  3. Procedural Generation(Sort of..)
    By JimmyTHicks in forum The Games Factory 2 - Technical Support
    Replies: 9
    Last Post: 3rd June 2013, 03:42 PM

Posting Permissions

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