User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18

Thread: How to generate a random topdown RPG level (with tiles)

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2011
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to generate a random topdown RPG level (with tiles)

    I am planning a top down RPG with random landscapes and random towns... (I know, I know)
    My biggest fear is performance. Because I have 64*64 tiles and need to place about 1000 of them.

    Question 1 - What Object should I chose for tiles.
    Active object with different Directions for different tiles? Paste the Actives to the background as soon as they show the right tile? Or should I go with backdrops (if even possible) or something else. Performance is key!

    Question 2 - Where would you store the information which tile has which graphic displayed?
    Should I make an Array? Isn't this a problem with 1000+ tiles? How would you do it?

    Question 3 - Making random gras is easy. But how would you do Paths?
    Is there a way to calculate with arrays? At the moment, I think I use an active which shoots through the tiles and sometimes slightly changes directions and makes a path with every tile it colides.

    Question 4 - How would you do it so the NPCs walk mostly on the path and not on the gras?
    How would you do the movement. Ball with bouncing or is there a better way to make NPC walk from A to B through a path?

    I just want to hear your ideas and experiences. You don't have to answer every question ;-)

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    oruga's Avatar
    Join Date
    Feb 2012
    Posts
    366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) definitively what you said is the best choice, shouldn't hurt performance as you are pasting the tiles as backdrops (and destroying the original creator after that).

    2) if tiles are static, external files could be a good choice (if possible, depends on your target platform), Actives with different directions/frames are good choices too, anything that let's you relate a graphic to a number will be needed. The Active backdrop object could help you here as well.

    I would love to see answers for 3 y 4!

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    1. Actives

    2. Array. x,y,z. X and Y for the position, Z for whatever info you want to store for the tile.

    3. This really depends on a lot of things... What type of paths are you talking about? How detailed? Do they serve a purpose other than purely graphical? Etc.

    4. Node based movement sounds like the best choice. The paths would have nodes spread along them... you could use one of the pathfinding extensions that handles node based movement for that.

  4. #4
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2011
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks! Already good answers!

    Are there more suggestions?

    Follow up questions (especially on Konidias):
    1. With actives, do you mean the solution add to backdrop and then destroy the active? Or paste to to background (they disappear when outside of the screen, perhaps I am missing something) Just clarification.
    2. Thanks for the suggestion. I forget that there is a Z in Arrays. Is there an easy way to work with arrays and see the values inside it? Sometimes it is a bit overwhelming...
    3 + 4. Characters should follow the paths, when they are in "go from House to Store" mode. How would you guys create paths and "Nodes"? Also I cant find the Node Movement and spread Nodes. Also I am kind of limited because of the IOS exporter. But any suggestions welcome!

  5. #5
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Morbus Crohn View Post
    Thanks! Already good answers!

    Are there more suggestions?

    Follow up questions (especially on Konidias):
    1. With actives, do you mean the solution add to backdrop and then destroy the active? Or paste to to background (they disappear when outside of the screen, perhaps I am missing something) Just clarification.
    2. Thanks for the suggestion. I forget that there is a Z in Arrays. Is there an easy way to work with arrays and see the values inside it? Sometimes it is a bit overwhelming...
    3 + 4. Characters should follow the paths, when they are in "go from House to Store" mode. How would you guys create paths and "Nodes"? Also I cant find the Node Movement and spread Nodes. Also I am kind of limited because of the IOS exporter. But any suggestions welcome!
    Morbus Crohn. I have an open source "Node Example" on my website. maybe you can adapt the coding for your uses.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    1. Could be possible to only create actives that you'll be seeing on screen (and a bit around it for when the camera moves around) This way you'd only be using a couple dozen actives at any given time. Not sure what kind of performance hit that would take though. :P It would be fun to test. I don't think pasting into the background is the way to go in this situation.

    2. There isn't an easy way to work with them that I know of... I suppose you could create one in MMF though... :p

    3+4. If you're limited with extensions you'll have to make some custom node based movement which isn't too hard once you figure out the basics... Just don't expect to do stuff like pathfinding around moving obstacles and all that. :P The nodes would just be placed at corner points/starting and ending points/intersections. Then you'd place the character at a node and it would be given an end node to go to, and you'd have to code the bit where it figures which nodes between the start and end to move to... then the character would walk from node to node in order, until it reaches it's end point.

    The "finding which nodes between the start and end to move to" bit is the tricky part. It would probably deal with figuring the shortest distance by testing the surrounding nodes and finding the least amount of nodes needed to reach the end node.

  7. #7
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Nov 2011
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @nivram
    Thanks for your example. I already tried it out and I will use something similar in case there is no easier solution.

    @Konidias
    Thanks. So would you chose to create 1000+ active tiles without pasting it as background object? Or is this just for the solution with the dynamic tiles generator (which sounds not easy ;-) ?
    Also your example sounds interesting. But isn't there an easy solution like: only pathway tiles are no obstacle and movement is like in an RTS game where it finds the shortest way from A to B? :-)

    Other suggestions, especially in regards of performance?

  8. #8
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I'm actually curious about the dynamic tile generation idea... I'll try to make an example of this... Can you give me the dimensions of your game screen so I can use that as a starting point? I'll use 64x64 sized tiles as well.

    The 1000 actives thing is only a solution with the dynamic tiles idea... I don't think it would work too well to have 1000 64x64 actives sitting around for no reason all the time. :p

    As for the path stuff... Well I wasn't sure how you wanted it... If only path tiles would be walkable, then it would be a little easier to do.

  9. #9
    Clicker iOS Export Module

    Join Date
    Feb 2010
    Location
    Behind the tree!
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Konidias
    1. Could be possible to only create actives that you'll be seeing on screen (and a bit around it for when the camera moves around) This way you'd only be using a couple dozen actives at any given time. Not sure what kind of performance hit that would take though. :P It would be fun to test. I don't think pasting into the background is the way to go in this situation.
    I did something like that quite a while ago.

    Heres the file infinateTileScrollSmooth2.mfa

  10. #10
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA 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)
    gkinfinity's Avatar
    Join Date
    May 2011
    Location
    USA
    Posts
    284
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I didn't realize what you were doing at first, but that's a very nice method. I was expecting you to be creating and destroying objects as you scrolled, but since the tiles are all the same object it isn't necessary. Cool stuff.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Generate a random number
    By LemonyLime in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 11th May 2012, 03:37 PM
  2. Generate random number between -n and +n
    By Boba Fonts in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 30th January 2010, 08:21 PM
  3. generate random terrain (for chrilley)
    By Tisnart in forum File Archive
    Replies: 0
    Last Post: 2nd January 2010, 04:52 PM
  4. generate random number
    By Shawn in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 1st December 2009, 03:36 AM
  5. Externally-stored tiles for level editing
    By DavidN in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 27th January 2007, 01:04 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
  •